mirror of
https://github.com/github/codeql.git
synced 2026-04-21 15:05:56 +02:00
Changed casing on TCipherType, Added some initial fixes for hash support, started developing openssl hashing modeling.
This commit is contained in:
@@ -3,7 +3,7 @@ import experimental.Quantum.Language
|
||||
import EVPCipherConsumers
|
||||
import OpenSSLAlgorithmGetter
|
||||
|
||||
predicate literalToCipherFamilyType(Literal e, Crypto::TCipherType type) {
|
||||
predicate literalToCipherFamilyType(Literal e, Crypto::TCipherType type) {
|
||||
exists(string name, string algType | algType.toLowerCase().matches("%encryption") |
|
||||
resolveAlgorithmFromLiteral(e, name, algType) and
|
||||
(
|
||||
@@ -21,9 +21,9 @@ predicate literalToCipherFamilyType(Literal e, Crypto::TCipherType type) {
|
||||
or
|
||||
name.matches("CAST5") and type instanceof Crypto::CAST5
|
||||
or
|
||||
name.matches("2DES") and type instanceof Crypto::DOUBLEDES
|
||||
name.matches("2DES") and type instanceof Crypto::DoubleDES
|
||||
or
|
||||
name.matches(["3DES", "TRIPLEDES"]) and type instanceof Crypto::TRIPLEDES
|
||||
name.matches(["3DES", "TRIPLEDES"]) and type instanceof Crypto::TripleDES
|
||||
or
|
||||
name.matches("DES") and type instanceof Crypto::DES
|
||||
or
|
||||
@@ -52,7 +52,6 @@ predicate literalToCipherFamilyType(Literal e, Crypto::TCipherType type) {
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
class CipherKnownAlgorithmLiteralAlgorithmInstance extends Crypto::CipherAlgorithmInstance instanceof Literal
|
||||
{
|
||||
OpenSSLAlgorithmGetterCall cipherGetterCall;
|
||||
@@ -81,7 +80,9 @@ class CipherKnownAlgorithmLiteralAlgorithmInstance extends Crypto::CipherAlgorit
|
||||
|
||||
override string getRawAlgorithmName() { result = this.(Literal).getValue().toString() }
|
||||
|
||||
override Crypto::TCipherType getCipherFamily() { literalToCipherFamilyType(this, result) }
|
||||
override Crypto::TCipherType getCipherFamily() {
|
||||
literalToCipherFamilyType(this, result)
|
||||
}
|
||||
}
|
||||
// override Crypto::TCipherType getCipherFamily() {
|
||||
// if this.cipherNameMappingKnown(_, super.getAlgorithmName())
|
||||
|
||||
Reference in New Issue
Block a user