Skip to content
Snippets Groups Projects
Commit 39f79b55 authored by akwizgran's avatar akwizgran
Browse files

Ensure ciphertext is always modified in unit test.

parent 3dab4543
No related branches found
No related tags found
No related merge requests found
......@@ -33,8 +33,7 @@ public class PasswordBasedKdfTest extends BriarTestCase {
byte[] ciphertext = crypto.encryptWithPassword(input, password);
// Modify the ciphertext
int position = random.nextInt(ciphertext.length);
int value = random.nextInt(256);
ciphertext[position] = (byte) value;
ciphertext[position] = (byte) (ciphertext[position] ^ 0xFF);
byte[] output = crypto.decryptWithPassword(ciphertext, password);
assertNull(output);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment