mirror of
https://github.com/github/codeql.git
synced 2026-04-18 05:24:01 +02:00
Rust: Update for latest main, and autoformat.
This commit is contained in:
@@ -22,14 +22,26 @@ class StreamCipherInit extends Cryptography::CryptographicOperation::Range, Data
|
||||
StreamCipherInit() {
|
||||
// a call to `cipher::KeyInit::new`, `cipher::KeyInit::new_from_slice`,
|
||||
// `cipher::KeyIvInit::new`, `cipher::KeyIvInit::new_from_slices` or `rc2::Rc2::new_with_eff_key_len`.
|
||||
exists(Path p, string rawAlgorithmName |
|
||||
this.asExpr().getExpr().(CallExpr).getFunction().(PathExpr).getPath() = p and
|
||||
exists(PathExpr p, string rawAlgorithmName |
|
||||
this.asExpr().getExpr().(CallExpr).getFunction() = p and
|
||||
p.getResolvedCrateOrigin().matches("%/RustCrypto%") and
|
||||
p.getPart().getNameRef().getText() =
|
||||
p.getPath().getPart().getNameRef().getText() =
|
||||
["new", "new_from_slice", "new_from_slices", "new_with_eff_key_len"] and
|
||||
(
|
||||
rawAlgorithmName = p.getQualifier().getPart().getNameRef().getText() or
|
||||
rawAlgorithmName = p.getQualifier().getPart().getGenericArgList().getGenericArg(0).(TypeArg).getTy().(PathType).getPath().getPart().getNameRef().getText()
|
||||
rawAlgorithmName = p.getPath().getQualifier().getPart().getNameRef().getText() or
|
||||
rawAlgorithmName =
|
||||
p.getPath()
|
||||
.getQualifier()
|
||||
.getPart()
|
||||
.getGenericArgList()
|
||||
.getGenericArg(0)
|
||||
.(TypeArg)
|
||||
.getTypeRepr()
|
||||
.(PathTypeRepr)
|
||||
.getPath()
|
||||
.getPart()
|
||||
.getNameRef()
|
||||
.getText()
|
||||
) and
|
||||
algorithmName = simplifyAlgorithmName(rawAlgorithmName)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user