JNI: throw Exception instead of error value when error encountered

pull/212/head
Ruby Martin 2026-04-27 16:48:24 -06:00
parent a034cf797b
commit 90cc4ca513
1 changed files with 5 additions and 1 deletions

View File

@ -163,6 +163,9 @@ JNIEXPORT jint JNICALL Java_com_wolfssl_wolfcrypt_Asn_getPkcs8AlgoID
if (ret == 0) {
ret = (int)algoId;
}
else {
throwWolfCryptExceptionFromError(env, ret);
}
return (jint)ret;
@ -170,7 +173,8 @@ JNIEXPORT jint JNICALL Java_com_wolfssl_wolfcrypt_Asn_getPkcs8AlgoID
(void)env;
(void)class;
(void)pkcs8Der;
return (jint)NOT_COMPILED_IN;
throwNotCompiledInException(env);
return 0;
#endif
}