Skip to content

Commit 8e6031d

Browse files
committed
Crypto: Fix further acronym casing and remove unused field
1 parent b809750 commit 8e6031d

File tree

5 files changed

+22
-24
lines changed

5 files changed

+22
-24
lines changed

cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/CipherAlgorithmInstance.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ predicate knownOpenSslConstantToCipherFamilyType(
3333
or
3434
name.matches("CAST5%") and type = KeyOpAlg::TSymmetricCipher(KeyOpAlg::CAST5())
3535
or
36-
name.matches("2DES%") and type = KeyOpAlg::TSymmetricCipher(KeyOpAlg::DoubleDES())
36+
name.matches("2DES%") and type = KeyOpAlg::TSymmetricCipher(KeyOpAlg::DOUBLE_DES())
3737
or
38-
name.matches("3DES%") and type = KeyOpAlg::TSymmetricCipher(KeyOpAlg::TripleDES())
38+
name.matches("3DES%") and type = KeyOpAlg::TSymmetricCipher(KeyOpAlg::TRIPLE_DES())
3939
or
4040
name.matches("DES%") and type = KeyOpAlg::TSymmetricCipher(KeyOpAlg::DES())
4141
or

cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/HashAlgorithmInstance.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ predicate knownOpenSslConstantToHashFamilyType(
1515
or
1616
name = "BLAKE2S" and type instanceof Crypto::BLAKE2S
1717
or
18-
name.matches("GOST%") and type instanceof Crypto::GOSTHash
18+
name.matches("GOST%") and type instanceof Crypto::GOST_HASH
1919
or
2020
name = "MD2" and type instanceof Crypto::MD2
2121
or

cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/PaddingAlgorithmInstance.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ predicate knownOpenSslConstantToPaddingFamilyType(
4040
or
4141
name = "PKCS7" and type = KeyOpAlg::PKCS7()
4242
or
43-
name = "PKCS1V15" and type = KeyOpAlg::PKCS1_v1_5()
43+
name = "PKCS1V15" and type = KeyOpAlg::PKCS1_V1_5()
4444
)
4545
)
4646
}
@@ -100,7 +100,7 @@ class KnownOpenSslPaddingConstantAlgorithmInstance extends OpenSslAlgorithmInsta
100100
override OpenSslAlgorithmValueConsumer getAvc() { result = getterCall }
101101

102102
KeyOpAlg::PaddingSchemeType getKnownPaddingType() {
103-
this.(Literal).getValue().toInt() in [1, 7, 8] and result = KeyOpAlg::PKCS1_v1_5()
103+
this.(Literal).getValue().toInt() in [1, 7, 8] and result = KeyOpAlg::PKCS1_V1_5()
104104
or
105105
this.(Literal).getValue().toInt() = 3 and result = KeyOpAlg::NoPadding()
106106
or

java/ql/lib/experimental/quantum/JCA.qll

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ module JCAModel {
180180
type = KeyOpAlg::TSymmetricCipher(KeyOpAlg::DES())
181181
or
182182
upper = "TRIPLEDES" and
183-
type = KeyOpAlg::TSymmetricCipher(KeyOpAlg::TripleDES())
183+
type = KeyOpAlg::TSymmetricCipher(KeyOpAlg::TRIPLE_DES())
184184
or
185185
upper = "IDEA" and
186186
type = KeyOpAlg::TSymmetricCipher(KeyOpAlg::IDEA())
@@ -1522,9 +1522,7 @@ module JCAModel {
15221522
}
15231523

15241524
class MacGetInstanceAlgorithmValueConsumer extends Crypto::AlgorithmValueConsumer {
1525-
MacGetInstanceCall call;
1526-
1527-
MacGetInstanceAlgorithmValueConsumer() { this = call.getAlgorithmArg() }
1525+
MacGetInstanceAlgorithmValueConsumer() { this = any(MacGetInstanceCall c).getAlgorithmArg() }
15281526

15291527
override Crypto::ConsumerInputDataFlowNode getInputNode() { result.asExpr() = this }
15301528

shared/quantum/codeql/quantum/experimental/Standardization.qll

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ module Types {
2828
IDEA() or
2929
KUZNYECHIK() or
3030
MAGMA() or
31-
TripleDES() or
32-
DoubleDES() or
31+
TRIPLE_DES() or
32+
DOUBLE_DES() or
3333
RC2() or
3434
RC4() or
3535
RC5() or
@@ -48,9 +48,9 @@ module Types {
4848
OtherSignatureAlgorithmType()
4949

5050
newtype TKemAlgorithmType =
51-
Kyber() or
52-
FrodoKEM() or
53-
OtherKEMAlgorithmType()
51+
KYBER() or
52+
FRODO_KEM() or
53+
OtherKemAlgorithmType()
5454

5555
newtype TCipherStructureType =
5656
Block() or
@@ -94,9 +94,9 @@ module Types {
9494
or
9595
type = MAGMA() and name = "Magma" and s = Block()
9696
or
97-
type = TripleDES() and name = "TripleDES" and s = Block()
97+
type = TRIPLE_DES() and name = "TripleDES" and s = Block()
9898
or
99-
type = DoubleDES() and name = "DoubleDES" and s = Block()
99+
type = DOUBLE_DES() and name = "DoubleDES" and s = Block()
100100
or
101101
type = RC2() and name = "RC2" and s = Block()
102102
or
@@ -134,11 +134,11 @@ module Types {
134134
this = TSignature(OtherSignatureAlgorithmType()) and result = "UnknownSignature"
135135
or
136136
// Key Encapsulation Mechanisms
137-
this = TKeyEncapsulation(Kyber()) and result = "Kyber"
137+
this = TKeyEncapsulation(KYBER()) and result = "Kyber"
138138
or
139-
this = TKeyEncapsulation(FrodoKEM()) and result = "FrodoKEM"
139+
this = TKeyEncapsulation(FRODO_KEM()) and result = "FrodoKEM"
140140
or
141-
this = TKeyEncapsulation(OtherKEMAlgorithmType()) and result = "UnknownKEM"
141+
this = TKeyEncapsulation(OtherKemAlgorithmType()) and result = "UnknownKEM"
142142
or
143143
// Unknown
144144
this = TUnknownKeyOperationAlgorithmType() and result = "Unknown"
@@ -149,9 +149,9 @@ module Types {
149149
or
150150
this = TSymmetricCipher(DESX()) and result = 184
151151
or
152-
this = TSymmetricCipher(DoubleDES()) and result = 112
152+
this = TSymmetricCipher(DOUBLE_DES()) and result = 112
153153
or
154-
this = TSymmetricCipher(TripleDES()) and result = 168
154+
this = TSymmetricCipher(TRIPLE_DES()) and result = 168
155155
or
156156
this = TSymmetricCipher(CHACHA20()) and result = 256
157157
or
@@ -225,7 +225,7 @@ module Types {
225225
}
226226

227227
newtype TPaddingSchemeType =
228-
PKCS1_v1_5() or // RSA encryption/signing padding
228+
PKCS1_V1_5() or // RSA encryption/signing padding
229229
PSS() or
230230
PKCS7() or // Standard block cipher padding (PKCS5 for 8-byte blocks)
231231
ANSI_X9_23() or // Zero-padding except last byte = padding length
@@ -241,7 +241,7 @@ module Types {
241241
or
242242
this = OAEP() and result = "OAEP"
243243
or
244-
this = PKCS1_v1_5() and result = "PKCS1_v1_5"
244+
this = PKCS1_V1_5() and result = "PKCS1_v1_5"
245245
or
246246
this = PKCS7() and result = "PKCS7"
247247
or
@@ -255,7 +255,7 @@ module Types {
255255
newtype THashType =
256256
BLAKE2B() or
257257
BLAKE2S() or
258-
GOSTHash() or
258+
GOST_HASH() or
259259
MD2() or
260260
MD4() or
261261
MD5() or

0 commit comments

Comments
 (0)