File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
src/test/java/org/owasp/esapi/crypto Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -191,9 +191,8 @@ public final void testMIC() {
191191 encryptor .init (Cipher .ENCRYPT_MODE , key , ivSpec );
192192 byte [] raw = encryptor .doFinal ("This is my secret message!!!" .getBytes ("UTF8" ));
193193 CipherText ciphertext = new CipherText (cipherSpec , raw );
194- // TODO: Replace this w/ call to KeyDerivationFunction as this is
195- // deprecated! Shame on me!
196- SecretKey authKey = CryptoHelper .computeDerivedKey (key , key .getEncoded ().length * 8 , "authenticity" );
194+ KeyDerivationFunction kdf = new KeyDerivationFunction ( KeyDerivationFunction .PRF_ALGORITHMS .HmacSHA1 );
195+ SecretKey authKey = kdf .computeDerivedKey (key , key .getEncoded ().length * 8 , "authenticity" );
197196 ciphertext .computeAndStoreMAC ( authKey );
198197// System.err.println("Original ciphertext being serialized: " + ciphertext);
199198 byte [] serializedBytes = ciphertext .asPortableSerializedByteArray ();
You can’t perform that action at this time.
0 commit comments