Fix tests and fix getStringValue method

This commit is contained in:
Ed Minnix
2023-12-21 22:40:50 -05:00
parent 6455e1893d
commit 8051cfcef5
4 changed files with 15 additions and 5 deletions

View File

@@ -27,7 +27,9 @@ import InsecureCryptoFlow::PathGraph
string getStringValue(DataFlow::Node algo) {
result = algo.asExpr().(StringLiteral).getValue()
or
result = algo.asExpr().(PropertiesGetPropertyMethodCall).getPropertyValue()
exists(string value | value = algo.asExpr().(PropertiesGetPropertyMethodCall).getPropertyValue() |
result = value and not value.regexpMatch(getSecureAlgorithmRegex())
)
}
from InsecureCryptoFlow::PathNode source, InsecureCryptoFlow::PathNode sink, CryptoAlgoSpec c