mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Changed casing on TCipherType, Added some initial fixes for hash support, started developing openssl hashing modeling.
This commit is contained in:
@@ -162,9 +162,9 @@ class EVPCipherGetterCall extends OpenSSLAlgorithmGetterCall {
|
||||
Expr resultExpr;
|
||||
|
||||
EVPCipherGetterCall() {
|
||||
// Flow out through the return pointer itself (trace the pointer, not what it is pointing to)
|
||||
resultExpr = this and
|
||||
resultNode.asExpr() = this and
|
||||
isPossibleOpenSSLFunction(this.getTarget()) and
|
||||
(
|
||||
this.getTarget().getName() in ["EVP_get_cipherbyname", "EVP_get_cipherbyobj"] and
|
||||
valueArgExpr = this.getArgument(0) and
|
||||
@@ -188,6 +188,38 @@ class EVPCipherGetterCall extends OpenSSLAlgorithmGetterCall {
|
||||
|
||||
override Expr getResultExpr() { result = resultExpr }
|
||||
}
|
||||
|
||||
class EVPDigestGetterCall extends OpenSSLAlgorithmGetterCall {
|
||||
DataFlow::Node valueArgNode;
|
||||
DataFlow::Node resultNode;
|
||||
Expr valueArgExpr;
|
||||
Expr resultExpr;
|
||||
|
||||
EVPDigestGetterCall() {
|
||||
resultExpr = this and
|
||||
resultNode.asExpr() = this and
|
||||
isPossibleOpenSSLFunction(this.getTarget()) and
|
||||
(
|
||||
this.getTarget().getName() in [
|
||||
"EVP_get_digestbyname", "EVP_get_digestbyobj", "EVP_get_digestbynid"
|
||||
] and
|
||||
valueArgExpr = this.getArgument(0) and
|
||||
valueArgNode.asExpr() = valueArgExpr
|
||||
or
|
||||
this.getTarget().getName() = "EVP_MD_fetch" and
|
||||
valueArgExpr = this.getArgument(1) and
|
||||
valueArgNode.asExpr() = valueArgExpr
|
||||
)
|
||||
}
|
||||
|
||||
override DataFlow::Node getValueArgNode() { result = valueArgNode }
|
||||
|
||||
override DataFlow::Node getResultNode() { result = resultNode }
|
||||
|
||||
override Expr getValueArgExpr() { result = valueArgExpr }
|
||||
|
||||
override Expr getResultExpr() { result = resultExpr }
|
||||
}
|
||||
// /**
|
||||
// * Predicates/classes for identifying algorithm sinks.
|
||||
// * An Algorithm Sink is a function that takes an algorithm as an argument.
|
||||
|
||||
Reference in New Issue
Block a user