Skip to content

Commit 391bf34

Browse files
Explicit precedence clarifies logic in UseOfLegacyAlgorithm.ql (#36)
Not strictly a bugfix since CodeQL's precedence handles this already (disjunction occurs before conjunction) but the and/or logic for handling "DES" becomes clearer when wrapped in parens.
1 parent 02d605c commit 391bf34

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cpp/src/crypto/UseOfLegacyAlgorithm.ql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ where
3636
* descend
3737
* destroy
3838
*/
39-
40-
cipherName = "DES" and
41-
functionName.regexpMatch(".*(?<!no|mo|co)des(?!cri(be|ption|ptor)|ign|cend|troy).*")
39+
(
40+
cipherName = "DES" and
41+
functionName.regexpMatch(".*(?<!no|mo|co)des(?!cri(be|ption|ptor)|ign|cend|troy).*")
42+
)
4243
)
4344
select call.getLocation(),
4445
"Potential use of legacy cryptographic algorithm " + cipherName + " detected in function name " +

0 commit comments

Comments
 (0)