From 88c9095743a12cf8fc1793c607ba3a1e4fa86483 Mon Sep 17 00:00:00 2001 From: vnugent Date: Wed, 29 May 2024 13:25:51 -0400 Subject: refactor!: return NC_SUCCESS when validating secret key --- src/noscrypt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/noscrypt.c') diff --git a/src/noscrypt.c b/src/noscrypt.c index 258ba8d..f1aabd4 100644 --- a/src/noscrypt.c +++ b/src/noscrypt.c @@ -542,7 +542,9 @@ NC_EXPORT NCResult NC_CC NCValidateSecretKey(const NCContext* ctx, const NCSecre CHECK_CONTEXT_STATE(ctx, 0) /* Validate the secret key */ - return secp256k1_ec_seckey_verify(ctx->secpCtx, sk->key); + return secp256k1_ec_seckey_verify(ctx->secpCtx, sk->key) == 1 + ? NC_SUCCESS + : E_OPERATION_FAILED; } /* Ecdsa Functions */ -- cgit