Skip to content
Snippets Groups Projects
Commit da217aad authored by tholenst's avatar tholenst Committed by Copybara-Service
Browse files

Fix a test in the AesSivKeyManagerTest to actually check the right thing...

Fix a test in the AesSivKeyManagerTest to actually check the right thing (namely, if the wrong version makes validateKey fail).

PiperOrigin-RevId: 266087262
parent a8fa6dd7
No related branches found
No related tags found
Loading
......@@ -101,18 +101,11 @@ public class AesSivKeyManagerTest {
@Test
public void validateKey_version() throws Exception {
AesSivKeyManager manager = new AesSivKeyManager();
for (int i = 0; i < 100; i++) {
if (i == 64) {
manager.validateKey(createAesSivKey(i));
} else {
try {
manager.validateKey(createAesSivKey(i));
fail();
} catch (GeneralSecurityException e) {
// expected
}
}
try {
manager.validateKey(AesSivKey.newBuilder(createAesSivKey(64)).setVersion(1).build());
fail();
} catch (GeneralSecurityException e) {
// expected
}
}
......
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