diff options
Diffstat (limited to 'security-utils/src/test/java/com/yahoo/security/SharedKeyTest.java')
-rw-r--r-- | security-utils/src/test/java/com/yahoo/security/SharedKeyTest.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/security-utils/src/test/java/com/yahoo/security/SharedKeyTest.java b/security-utils/src/test/java/com/yahoo/security/SharedKeyTest.java index 26627e9a5fa..90b8beb461f 100644 --- a/security-utils/src/test/java/com/yahoo/security/SharedKeyTest.java +++ b/security-utils/src/test/java/com/yahoo/security/SharedKeyTest.java @@ -285,12 +285,12 @@ public class SharedKeyTest { String plaintext = "...hello world?"; byte[] encrypted = streamEncryptString(plaintext, myShared); // Corrupt MAC tag in ciphertext - encrypted[encrypted.length - 1] ^= 0x80; + encrypted[encrypted.length - 1] ^= (byte)0x80; // We don't necessarily know _which_ exception is thrown, but one _should_ be thrown! assertThrows(Exception.class, () -> doOutputStreamCipherDecrypt(myShared, encrypted)); // Also try with corrupted ciphertext (pre MAC tag) - encrypted[encrypted.length - 1] ^= 0x80; // Flip MAC bit back to correct state - encrypted[encrypted.length - 17] ^= 0x80; // Pre 128-bit MAC tag + encrypted[encrypted.length - 1] ^= (byte)0x80; // Flip MAC bit back to correct state + encrypted[encrypted.length - 17] ^= (byte)0x80; // Pre 128-bit MAC tag assertThrows(Exception.class, () -> doOutputStreamCipherDecrypt(myShared, encrypted)); } |