Open quapka opened 1 month ago
It took me some time but I figured out this is the source of the first exception: https://github.com/wolfSSL/wolfcrypt-jni/blob/5ce2d0ea9a9e54efa204ae7b1a725db9f6543b9a/src/main/java/com/wolfssl/provider/jce/WolfCryptKeyPairGenerator.java#L295
ECTester expects that the provider will choose some default parameters/keysize when the KeyPairGenerator is not provided with them but wolfCrypt does not do that and instead raises an exception.
Other issues of the sort "com.wolfssl.wolfcrypt.WolfCryptException : ASN parsing error, invalid input" are due to the wolfCrypt provider expecting keys in ASN.1 DER format (as it internally uses the wc_EccPublicKeyDecode function) while ECTester (and the rest of the Java providers/the world) uses the ANSI X9.62 format.
WolfSSL complaints about keysize, which affects the tests. This does not show immediately in the GitHub Actions, because the exit code of the test itself is
0
, e.g. here.However, the output of the test-case is this (see
default_wolfCrypt.txt
file in this artefact):