Skip to content

Commit 7afd57e

Browse files
authored
Merge pull request #246 from pusher/testOpenFailsAfterClearKey
Test open fails after clear key
2 parents 39f16b2 + d003f33 commit 7afd57e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/test/java/com/pusher/client/crypto/nacl/SecretBoxOpenerTest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ public class SecretBoxOpenerTest {
1111

1212
byte[] key = Base64.decode("6071zp2l/GPnDPDXNWTJDHyIZ8pZMvQrYsa4xuTKK2c=");
1313

14-
byte[] nonce = Base64.decode("xsbOS0KylAV2ziTDHrP/7rSFqpCOah3p");
1514
byte[] cipher = Base64.decode("tvttPE2PRQp0bWDmaPyiEU8YJGztmTvTN77OoPwftTNTdDgJXwxHQPE=");
15+
byte[] nonce = Base64.decode("xsbOS0KylAV2ziTDHrP/7rSFqpCOah3p");
1616

1717
SecretBoxOpener subject;
1818

@@ -35,4 +35,11 @@ public void openFailsForTamperedCipher() {
3535

3636
subject.open(tamperedCipher, nonce);
3737
}
38+
39+
@Test(expected = NullPointerException.class)
40+
public void openFailsAfterClearKey() {
41+
subject.clearKey();
42+
43+
subject.open(cipher, nonce);
44+
}
3845
}

0 commit comments

Comments
 (0)