add test for opaque cv25519 subkey (which previously crashed)

This commit is contained in:
Vincent Breitmoser
2017-04-24 19:40:34 +02:00
parent c313f45219
commit c9f9ad0477
2 changed files with 33 additions and 0 deletions

View File

@@ -52,6 +52,18 @@ public class OpaqueKeyTest {
assertTrue(log.containsType(LogType.MSG_KC_ERROR_MASTER_ALGO));
}
@Test
public void testOpaqueOidSubKey__canonicalize__shouldFail() throws Exception {
// key from GnuPG's test suite, sample msg generated using GnuPG v2.1.18
// TODO use for actual tests once eddsa is supported!
UncachedKeyRing ring = readRingFromResource("/test-keys/ed25519-cv25519-sample-1.asc");
OperationLog log = new OperationLog();
ring.canonicalize(log, 0);
assertTrue(log.containsType(LogType.MSG_KC_ERROR_MASTER_ALGO));
}
@Test
public void testOpaqueSubKey__canonicalize__shouldStrip() throws Exception {
UncachedKeyRing ring = readRingFromResource("/test-keys/eddsa-subkey.pub.asc");