mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
Add more source of crypto call
This commit is contained in:
@@ -10,7 +10,7 @@ private import semmle.python.frameworks.Django
|
||||
|
||||
/** A method call that produces cryptographic result. */
|
||||
abstract class ProduceCryptoCall extends API::CallNode {
|
||||
/** Gets a type of cryptographic operation such as HMAC, signature or Hash. */
|
||||
/** Gets a type of cryptographic operation such as MAC, signature, Hash or ciphertext. */
|
||||
abstract string getResultType();
|
||||
}
|
||||
|
||||
@@ -113,6 +113,21 @@ private class ProduceHashCall extends ProduceCryptoCall {
|
||||
override string getResultType() { result = "Hash" }
|
||||
}
|
||||
|
||||
/** A method call that produces a ciphertext. */
|
||||
private class ProduceCiphertextCall extends ProduceCryptoCall {
|
||||
ProduceCiphertextCall() {
|
||||
this =
|
||||
cryptodome()
|
||||
.getMember("Cipher")
|
||||
.getMember(["DES", "DES3", "ARC2", "ARC4", "Blowfish", "PKCS1_v1_5"])
|
||||
.getMember(["ARC4Cipher", "new", "PKCS115_Cipher"])
|
||||
.getMember("encrypt")
|
||||
.getACall()
|
||||
}
|
||||
|
||||
override string getResultType() { result = "ciphertext" }
|
||||
}
|
||||
|
||||
/** A data flow sink for comparison. */
|
||||
private predicate existsFailFastCheck(Expr firstInput, Expr secondInput) {
|
||||
exists(Compare compare |
|
||||
|
||||
Reference in New Issue
Block a user