Found by the wychcheck-jce Wycheproof runner.
Failing tests
EcdhTest.testInvalidPublicParamsSecp256r1
EcdhTest.testInvalidPublicParamsSecp384r1
EcdhTest.testInvalidPublicParamsSecp521r1
EcdhTest.testModifiedPublicEcdh
EcdhTest.testModifiedPublicEcdhSpec
EcdhTest.testWrongOrderEcdhSecp256r1
DhTest.testDHDistinctParameters
Root cause
WolfCryptException extends RuntimeException, not GeneralSecurityException. The Wycheproof tests catch GeneralSecurityException on adversarial/invalid key inputs and expect that to succeed. Instead WolfCryptException propagates uncaught, causing the test to fail with a runtime exception rather than a handled exception.
JCE callers that wrap KeyAgreement.doPhase() or generateSecret() in a catch (GeneralSecurityException) block will see uncaught WolfCryptException if an adversarial/invalid public key is passed in.
Priority
Low — affects adversarial/edge-case code paths not exercised by normal application code.
Found by the wychcheck-jce Wycheproof runner.
Failing tests
EcdhTest.testInvalidPublicParamsSecp256r1EcdhTest.testInvalidPublicParamsSecp384r1EcdhTest.testInvalidPublicParamsSecp521r1EcdhTest.testModifiedPublicEcdhEcdhTest.testModifiedPublicEcdhSpecEcdhTest.testWrongOrderEcdhSecp256r1DhTest.testDHDistinctParametersRoot cause
WolfCryptExceptionextendsRuntimeException, notGeneralSecurityException. The Wycheproof tests catchGeneralSecurityExceptionon adversarial/invalid key inputs and expect that to succeed. InsteadWolfCryptExceptionpropagates uncaught, causing the test to fail with a runtime exception rather than a handled exception.JCE callers that wrap
KeyAgreement.doPhase()orgenerateSecret()in acatch (GeneralSecurityException)block will see uncaughtWolfCryptExceptionif an adversarial/invalid public key is passed in.Priority
Low — affects adversarial/edge-case code paths not exercised by normal application code.