skip test error for JDK versions ECKeyFactory that may not support all wolfCrypt curves

pull/38/head
Chris Conlon 2022-08-17 16:37:41 -06:00
parent 58a89ab02f
commit f98ae38819
2 changed files with 10 additions and 2 deletions

View File

@ -222,7 +222,7 @@ public class WolfCryptKeyPairGenerator extends KeyPairGeneratorSpi {
pair = new KeyPair(eccPub, eccPriv);
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
throw new RuntimeException(e);
}
if (debug.DEBUG)

View File

@ -217,7 +217,15 @@ public class WolfCryptKeyPairGeneratorTest {
new ECGenParameterSpec(enabledCurves.get(i));
kpg.initialize(ecSpec);
KeyPair kp = kpg.generateKeyPair();
try {
KeyPair kp = kpg.generateKeyPair();
} catch (Exception e) {
/* Some JDK versions' ECKeyFactory may not support all
* wolfCrypt's ECC curves */
if (!e.toString().contains("Unknown named curve")) {
throw e;
}
}
}
}