Ruby: fix some cases where we assume that a CryptographicOperation is using CBC when it is not

This commit is contained in:
Alex Ford
2022-05-17 14:54:57 +01:00
parent c620fceb82
commit f92782d4e7
7 changed files with 47 additions and 6 deletions

View File

@@ -81,6 +81,8 @@ class EncryptionAlgorithm extends MkEncryptionAlgorithm, CryptographicAlgorithm
override string getName() { result = name }
override predicate isWeak() { isWeak = true }
predicate isStreamCipher() { isStreamCipher(name) }
}
/**

View File

@@ -65,3 +65,8 @@ predicate isStrongPasswordHashingAlgorithm(string name) {
* Holds if `name` corresponds to a weak password hashing algorithm.
*/
predicate isWeakPasswordHashingAlgorithm(string name) { name = "EVPKDF" }
/**
* Holds if `name` corresponds to a stream cipher.
*/
predicate isStreamCipher(string name) { name = ["CHACHA", "RC4", "ARC4", "ARCFOUR", "RABBIT"] }