From 90cc4ca51378182418b1d515d94e234dd68a7b56 Mon Sep 17 00:00:00 2001 From: Ruby Martin Date: Mon, 27 Apr 2026 16:48:24 -0600 Subject: [PATCH] JNI: throw Exception instead of error value when error encountered --- jni/jni_asn.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jni/jni_asn.c b/jni/jni_asn.c index fc69ef6d..719b0056 100644 --- a/jni/jni_asn.c +++ b/jni/jni_asn.c @@ -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 }