Skip to content

Commit 401315c

Browse files
geoffw0hvitved
andauthored
Update rust/ql/lib/codeql/rust/frameworks/rustcrypto/RustCrypto.qll
Co-authored-by: Tom Hvitved <[email protected]>
1 parent 9f04de8 commit 401315c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

rust/ql/lib/codeql/rust/frameworks/rustcrypto/RustCrypto.qll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ class StreamCipherInit extends Cryptography::CryptographicOperation::Range {
2626
// `cipher::KeyIvInit::new`, `cipher::KeyIvInit::new_from_slices`, `rc2::Rc2::new_with_eff_key_len` or similar.
2727
exists(CallExprBase ce, string rawAlgorithmName |
2828
ce = this.asExpr().getExpr() and
29-
ce.getStaticTarget()
30-
.getCanonicalPath()
31-
.matches(["%::new", "%::new_from_slice", "%::new_with_eff_key_len", "%::new_from_slices"]) and
29+
ce.getStaticTarget().getName().getText() =
30+
["new", "new_from_slice", "new_with_eff_key_len", "new_from_slices"] and
3231
// extract the algorithm name from the type of `ce` or its receiver.
3332
exists(Type t, TypePath tp |
3433
t = inferType([ce, ce.(MethodCallExpr).getReceiver()], tp) and

0 commit comments

Comments
 (0)