Skip to content

Commit da8a7f3

Browse files
committed
More cleanup
1 parent eceda7a commit da8a7f3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

cpp/ql/src/experimental/campaigns/nccoe-pqc-migration/QuantumVulnerableDiscovery/WinCng/WindowsCngPQCVulnerableUsage.qll

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import cpp
22
import WindowsCng
33

4-
predicate keyGenAndImportFunctionName(string name) { name in ["BCryptImportKeyPair", "BCryptGenerateKeyPair"] }
5-
6-
predicate keyGenAndImportFunction(Function f){
7-
exists(string name | f.hasGlobalName(name) and keyGenAndImportFunctionName(name))
8-
}
9-
104
//TODO: Verify NCrypt calls (parameters) & find all other APIs that should be included (i.e. decrypt, etc.)
115

126

@@ -46,7 +40,7 @@ predicate stepOpenAlgorithmProvider(DataFlow::Node node1, DataFlow::Node node2)
4640
predicate stepImportGenerateKeyPair(DataFlow::Node node1, DataFlow::Node node2) {
4741
exists(FunctionCall call |
4842
node1.asExpr() = call.getArgument(0) and
49-
keyGenAndImportFunction(call.getTarget()) and
43+
exists(string name | name in ["BCryptImportKeyPair", "BCryptGenerateKeyPair"] and call.getTarget().hasGlobalName(name)) and
5044
node2.asDefiningArgument() = call.getArgument(1)
5145
)
5246
}

0 commit comments

Comments
 (0)