C++: performance tweaks for InsufficientKeySize

This commit is contained in:
Robert Marsh
2022-03-02 15:59:42 -05:00
parent a60fe9f4b8
commit 9fb94d85b4

View File

@@ -31,7 +31,10 @@ class KeyStrengthFlow extends DataFlow::Configuration {
KeyStrengthFlow() { this = "KeyStrengthFlow" }
override predicate isSource(DataFlow::Node node) {
node.asInstruction().(IntegerConstantInstruction).getValue() != "0"
exists(int bits |
node.asInstruction().(IntegerConstantInstruction).getValue().toInt() = bits and
bits < getMinimumKeyStrength(_, _) and
bits > 0 // exclude sentinel values
}
override predicate isSink(DataFlow::Node node) {