@@ -33,8 +33,22 @@ predicate vulnProviderLiteral(StringLiteral lit) {
3333 )
3434}
3535
36- //TODO: Verify NCrypt calls (parameters) & find all other APIs that should be included (i.e. decrypt, etc.)
3736// ------------------ 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+
3852/**
3953 * Argument at index 0 of call to BCryptSignHash:
4054 * [in] BCRYPT_KEY_HANDLE hKey,
@@ -85,30 +99,14 @@ class BCryptEncryptArgumentSink extends BCryptOpenAlgorithmProviderSink {
8599 * [in] NCRYPT_KEY_HANDLE hKey,
86100 */
87101class 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 ;
106104
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+ }
112110}
113111
114112// ----------------- Default SOURCES -----------------------
0 commit comments