Skip to content

Commit 7a27635

Browse files
committed
Moving queries and modifying query to include BCryptEncrypt
1 parent 1932163 commit 7a27635

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

cpp/ql/src/experimental/campaigns/nccoe-pqc-migration/QuantumVulnerableDiscovery/WinCng.ql renamed to cpp/ql/src/experimental/campaigns/nccoe-pqc-migration/QuantumVulnerableDiscovery/WinCng/WinCng.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import cpp
1515
import DataFlow::PathGraph
1616
import WindowsCng
17-
import WindowsCngPQCVAsymmetricKeyUsage
17+
import WindowsCngPQCVulnerableUsage
1818

1919
// CNG-specific DataFlow configuration
2020
class BCryptConfiguration extends TaintTracking::Configuration {
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
import cpp
22
import WindowsCng
3+
4+
predicate vulnerableCngFunctionName(string name) {
5+
name in ["BCryptSignHash", "BCryptEncrypt"]
6+
}
7+
8+
predicate vulnerableCngFunction(Function f)
9+
{
10+
exists(string name | f.hasGlobalName(name) and vulnerableCngFunctionName(name))
11+
}
12+
313
//TODO: Verify NCrypt calls (parameters) & find all other APIs that should be included (i.e. decrypt, etc.)
414
predicate isExprKeyHandleForBCryptSignHash(Expr e){
515
exists( FunctionCall call |
616
e = call.getArgument(0)
7-
and
8-
call.getTarget().hasGlobalName("BCryptSignHash")
17+
and
18+
vulnerableCngFunction(call.getTarget())
919
)
1020
}
1121

0 commit comments

Comments
 (0)