Skip to content

Commit c01c060

Browse files
committed
Crypto: more ID renaming to include "examples", fix singleton issues with ql-for-ql, use formatted test for WeakAsymmetricKeyGenSize (add post processing in the qlref), misc expected files updated (test passed locally but on rerun vscode reports failures, known bug with vscode unit tests).
1 parent 540daa6 commit c01c060

File tree

16 files changed

+31
-26
lines changed

16 files changed

+31
-26
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ module JCAModel {
230230
bindingset[name]
231231
predicate key_agreement_name_to_type_known(Crypto::TKeyAgreementType type, string name) {
232232
type = Crypto::DH() and
233-
name.toUpperCase() in ["DH"]
233+
name.toUpperCase() = "DH"
234234
or
235235
type = Crypto::EDH() and
236236
name.toUpperCase() = "EDH"
@@ -1659,7 +1659,7 @@ module JCAModel {
16591659
Expr getOutput() { result = output }
16601660

16611661
Expr getInput() {
1662-
super.getMethod().hasStringSignature(["doFinal(byte[])"]) and result = this.getArgument(0)
1662+
super.getMethod().hasStringSignature("doFinal(byte[])") and result = this.getArgument(0)
16631663
or
16641664
super.getMethod().hasStringSignature("update(byte[])") and result = this.getArgument(0)
16651665
}

java/ql/src/experimental/quantum/Examples/BadMacOrderDecryptToMac.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @name Bad MAC order: decrypt to mac
33
* @description MAC should be on a cipher, not a raw message
4-
* @id java/quantum/bad-mac-order-decrypt-to-mac
4+
* @id java/quantum/examples/bad-mac-order-decrypt-to-mac
55
* @kind path-problem
66
* @problem.severity error
77
* @tags quantum

java/ql/src/experimental/quantum/Examples/BadMacOrderMacOnEncryptPlaintext.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @name Bad MAC order: Mac and Encryption share the same plaintext
33
* @description MAC should be on a cipher, not a raw message
4-
* @id java/quantum/bad-mac-order-encrypt-plaintext-also-in-mac
4+
* @id java/quantum/examples/bad-mac-order-encrypt-plaintext-also-in-mac
55
* @kind path-problem
66
* @problem.severity error
77
* @tags quantum

java/ql/src/experimental/quantum/Examples/InsecureIVorNonceSource.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Insecure nonce/iv (static value or weak random source)
3-
* @id java/quantum/insecure-iv-or-nonce
3+
* @id java/quantum/examples/insecure-iv-or-nonce
44
* @description A nonce/iv is generated from a source that is not secure. This can lead to
55
* vulnerabilities such as replay attacks or key recovery. Insecure generation
66
* is any static nonce, or any known insecure source for a nonce/iv if

java/ql/src/experimental/quantum/Examples/NonAESGCMCipher.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Cipher not AES-GCM mode
3-
* @id java/quantum/non-aes-gcm
3+
* @id java/quantum/examples/non-aes-gcm
44
* @description An AES cipher is in use without GCM
55
* @kind problem
66
* @problem.severity error

java/ql/src/experimental/quantum/Examples/ReusedNonce.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @name Reuse of cryptographic nonce
33
* @description Reuse of nonce in cryptographic operations can lead to vulnerabilities.
4-
* @id java/quantum/reused-nonce
4+
* @id java/quantum/examples/reused-nonce
55
* @kind path-problem
66
* @problem.severity error
77
* @tags quantum

java/ql/src/experimental/quantum/Examples/UnknownHash.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @name Unknown hashes
33
* @description Finds uses of cryptographic hashing algorithms of unknown type.
4-
* @id java/quantum/unknown-hash
4+
* @id java/quantum/examples/unknown-hash
55
* @kind problem
66
* @problem.severity error
77
* @tags quantum

java/ql/src/experimental/quantum/Examples/UnknownIVorNonceSource.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Unknown nonce/iv source
3-
* @id java/quantum/unknown-iv-or-nonce-source
3+
* @id java/quantum/examples/unknown-iv-or-nonce-source
44
* @description A nonce/iv is generated from a source that is not secure. Failure to initialize
55
* an IV or nonce properly can lead to vulnerabilities such as replay attacks or key recovery.
66
* IV may be unknown at a decryption operation (IV would be provided alongside the ciphertext).

java/ql/src/experimental/quantum/Examples/UnknownKDFIterationCount.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @name Unknown key derivation function iteration count
33
* @description Detects key derivation operations with an unknown iteration count.
4-
* @id java/quantum/unknown-kdf-iteration-count
4+
* @id java/quantum/examples/unknown-kdf-iteration-count
55
* @kind problem
66
* @problem.severity error
77
* @tags quantum

java/ql/src/experimental/quantum/Examples/WeakAsymmetricKeyGenSize.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Weak Asymmetric Key Size
3-
* @id java/quantum/weak-asymmetric-key-gen-size
3+
* @id java/quantum/examples/weak-asymmetric-key-gen-size
44
* @description An asymmetric key of known size is less than 2048 bits for any non-elliptic curve key operation.
55
* @kind path-problem
66
* @problem.severity error

0 commit comments

Comments
 (0)