Skip to content

Commit f8576fb

Browse files
alexrfordRasmusWL
andauthored
Python: avoid missing cryptography uses due to unhandled encryption modes
Co-authored-by: Rasmus Wriedt Larsen <[email protected]>
1 parent 9e483ac commit f8576fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/ql/lib/semmle/python/frameworks/Cryptography.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ private module CryptographyModel {
195195
call.getArg(0), call.getArgByName("algorithm")
196196
] and
197197
exists(DataFlow::Node modeArg | modeArg in [call.getArg(1), call.getArgByName("mode")] |
198-
modeArg = modeClassRef(modeName).getReturn().getAUse()
199-
or
200-
modeArg.asExpr() instanceof None and modeName = "<none>"
198+
if modeArg = modeClassRef(modeName).getReturn().getAUse()
199+
then any()
200+
else modeName = "<None or unknown>"
201201
)
202202
)
203203
}

0 commit comments

Comments
 (0)