Skip to content

Commit d548e47

Browse files
authored
False positive workaround for incorrectly identified OpenSSL functions. (#67)
1 parent e1949c7 commit d548e47

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cpp/ql/lib/experimental/cryptography/utils/OpenSSL/CryptoFunction.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ private string normalizeFunctionName(Function f, string algType) {
115115
(result.matches("RSA") implies not f.getName().toUpperCase().matches("%UNIVERSAL%")) and
116116
//rsaz functions deemed to be too low level, and can be ignored
117117
not f.getLocation().getFile().getBaseName().matches("rsaz_exp.c") and
118+
// SHA false positives
119+
(result.matches("SHA") implies not f.getName().toUpperCase().matches("%SHAKE%")) and
120+
// CAST false positives
121+
(result.matches("CAST") implies not f.getName().toUpperCase().matches(["%UPCAST%", "%DOWNCAST%"])) and
118122
// General False positives
119123
// Functions that 'get' do not set an algorithm, and therefore are considered ignorable
120124
not f.getName().toLowerCase().matches("%get%")

0 commit comments

Comments
 (0)