Skip to content

Commit d68f3cf

Browse files
committed
Crypto: InsecureIVorNonceSource now ignored null to avoid being too noisy.
1 parent ffd191d commit d68f3cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ import experimental.quantum.Language
1818
from Crypto::NonceArtifactNode nonce, Crypto::NodeBase src, Crypto::NodeBase op, string msg
1919
where
2020
nonce.getSourceNode() = src and
21+
// NOTE: null nonces should be handled seaparately, often used for default values prior to initialization
22+
// failure to initialize should, in practice, lead to a NullPointerException, which is a separate concern
23+
// however there may be APIs where NULL uses a default nonce or action.
24+
not src.asElement() instanceof NullLiteral and
2125
(
2226
// Case 1: Any constant nonce/iv is bad, regardless of how it is used
2327
src.asElement() instanceof Crypto::GenericConstantSourceInstance and

0 commit comments

Comments
 (0)