summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/evp/ctrl_params_translate.c4
-rw-r--r--test/keymgmt_internal_test.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/crypto/evp/ctrl_params_translate.c b/crypto/evp/ctrl_params_translate.c
index b17ce3cbf9..d17017a78e 100644
--- a/crypto/evp/ctrl_params_translate.c
+++ b/crypto/evp/ctrl_params_translate.c
@@ -465,8 +465,8 @@ static int default_fixup_args(enum state state,
ERR_raise(ERR_LIB_EVP, ERR_R_MALLOC_FAILURE);
return 0;
}
- if (!BN_bn2nativepad(ctx->p2,
- ctx->allocated_buf, ctx->buflen)) {
+ if (BN_bn2nativepad(ctx->p2,
+ ctx->allocated_buf, ctx->buflen) < 0) {
OPENSSL_free(ctx->allocated_buf);
ctx->allocated_buf = NULL;
return 0;
diff --git a/test/keymgmt_internal_test.c b/test/keymgmt_internal_test.c
index 40fc464bc2..dd0de2f599 100644
--- a/test/keymgmt_internal_test.c
+++ b/test/keymgmt_internal_test.c
@@ -88,7 +88,7 @@ static int get_ulong_via_BN(const OSSL_PARAM *p, unsigned long *goal)
int ret = 1; /* Ever so hopeful */
if (!TEST_true(OSSL_PARAM_get_BN(p, &n))
- || !TEST_true(BN_bn2nativepad(n, (unsigned char *)goal, sizeof(*goal))))
+ || !TEST_int_ge(BN_bn2nativepad(n, (unsigned char *)goal, sizeof(*goal)), 0))
ret = 0;
BN_free(n);
return ret;