@@ -33,8 +33,22 @@ predicate vulnProviderLiteral(StringLiteral lit) {
33
33
)
34
34
}
35
35
36
- //TODO: Verify NCrypt calls (parameters) & find all other APIs that should be included (i.e. decrypt, etc.)
37
36
// ------------------ Default SINKS ----------------------
37
+ /**
38
+ * Argument at index 0 of call to NCryptSignHash:
39
+ * [in] NCRYPT_KEY_HANDLE hKey
40
+ */
41
+ class NCryptSignHashArgumentSink extends BCryptOpenAlgorithmProviderSink {
42
+ int index ;
43
+ string funcName ;
44
+
45
+ NCryptSignHashArgumentSink ( ) {
46
+ index = 0 and
47
+ funcName = "NCryptSignHash " and
48
+ isCallArgument ( funcName , this .asExpr ( ) , index )
49
+ }
50
+ }
51
+
38
52
/**
39
53
* Argument at index 0 of call to BCryptSignHash:
40
54
* [in] BCRYPT_KEY_HANDLE hKey,
@@ -85,30 +99,14 @@ class BCryptEncryptArgumentSink extends BCryptOpenAlgorithmProviderSink {
85
99
* [in] NCRYPT_KEY_HANDLE hKey,
86
100
*/
87
101
class NCryptEncryptArgumentSink extends BCryptOpenAlgorithmProviderSink {
88
- int index ;
89
- string funcName ;
90
-
91
- NCryptEncryptArgumentSink ( ) {
92
- index = 0 and
93
- funcName = "NCryptEncrypt" and
94
- isCallArgument ( funcName , this .asExpr ( ) , index )
95
- }
96
- }
97
-
98
-
99
- /**
100
- * Argument at index 1 of call to NCryptEncrypt:
101
- * _Inout_ NCRYPT_KEY_HANDLE hKey,
102
- */
103
- class SslEncryptPacketArgumentSink extends BCryptOpenAlgorithmProviderSink {
104
- int index ;
105
- string funcName ;
102
+ int index ;
103
+ string funcName ;
106
104
107
- SslEncryptPacketArgumentSink ( ) {
108
- index = 1 and
109
- funcName = "SslEncryptPacket " and
110
- isCallArgument ( funcName , this .asExpr ( ) , index )
111
- }
105
+ NCryptEncryptArgumentSink ( ) {
106
+ index = 0 and
107
+ funcName = "NCryptEncrypt " and
108
+ isCallArgument ( funcName , this .asExpr ( ) , index )
109
+ }
112
110
}
113
111
114
112
// ----------------- Default SOURCES -----------------------
0 commit comments