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 {
7171 byte [] cleanResult = kdf .deriveData (spec );
7272 sink (cleanResult ); // Safe - no taint
7373 }
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+ }
7487}
Original file line number Diff line number Diff line change 8787| KDFDataflowTest.java:60:14:60:19 | result | semmle.label | result |
8888subpaths
8989testFailures
90+ | KDFDataflowTest.java:85:23:85:39 | // $ hasTaintFlow | Missing result: hasTaintFlow |
You can’t perform that action at this time.
0 commit comments