We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a60fe9f commit 9fb94d8Copy full SHA for 9fb94d8
cpp/ql/src/Security/CWE/CWE-326/InsufficientKeySize.ql
@@ -31,7 +31,10 @@ class KeyStrengthFlow extends DataFlow::Configuration {
31
KeyStrengthFlow() { this = "KeyStrengthFlow" }
32
33
override predicate isSource(DataFlow::Node node) {
34
- node.asInstruction().(IntegerConstantInstruction).getValue() != "0"
+ exists(int bits |
35
+ node.asInstruction().(IntegerConstantInstruction).getValue().toInt() = bits and
36
+ bits < getMinimumKeyStrength(_, _) and
37
+ bits > 0 // exclude sentinel values
38
}
39
40
override predicate isSink(DataFlow::Node node) {
0 commit comments