File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
java/ql/test/library-tests/dataflow/kdf Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -71,4 +71,17 @@ public static void testCleanUsage() throws Exception {
71
71
byte [] cleanResult = kdf .deriveData (spec );
72
72
sink (cleanResult ); // Safe - no taint
73
73
}
74
+
75
+ public static void testThenExpand (byte [] cleanIKM ) throws Exception {
76
+ String userInput = source ("" );
77
+ byte [] taintedInfo = userInput .getBytes ();
78
+
79
+ HKDFParameterSpec .Builder builder = HKDFParameterSpec .ofExtract ();
80
+ builder .addIKM (cleanIKM );
81
+ HKDFParameterSpec spec = builder .thenExpand (taintedInfo , 32 );
82
+
83
+ KDF kdf = KDF .getInstance ("HKDF-SHA256" );
84
+ byte [] result = kdf .deriveData (spec );
85
+ sink (result ); // $ hasTaintFlow
86
+ }
74
87
}
Original file line number Diff line number Diff line change 87
87
| KDFDataflowTest.java:60:14:60:19 | result | semmle.label | result |
88
88
subpaths
89
89
testFailures
90
+ | KDFDataflowTest.java:85:23:85:39 | // $ hasTaintFlow | Missing result: hasTaintFlow |
You can’t perform that action at this time.
0 commit comments