From 026eb4403c1bab456e82f67727bc3443847855ce Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 3 Jul 2023 11:10:28 +0000 Subject: [PATCH] sign_sig: test on assignment --- lib/libcrypto/ecdsa/ecs_ossl.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/libcrypto/ecdsa/ecs_ossl.c b/lib/libcrypto/ecdsa/ecs_ossl.c index 73aed6eb62f..1dce05c35f9 100644 --- a/lib/libcrypto/ecdsa/ecs_ossl.c +++ b/lib/libcrypto/ecdsa/ecs_ossl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecs_ossl.c,v 1.58 2023/07/03 11:06:28 tb Exp $ */ +/* $OpenBSD: ecs_ossl.c,v 1.59 2023/07/03 11:10:28 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project */ @@ -278,10 +278,11 @@ ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len, int attempts = 0; ECDSA_SIG *sig = NULL; - group = EC_KEY_get0_group(eckey); - priv_key = EC_KEY_get0_private_key(eckey); - - if (group == NULL || priv_key == NULL) { + if ((group = EC_KEY_get0_group(eckey)) == NULL) { + ECDSAerror(ERR_R_PASSED_NULL_PARAMETER); + goto err; + } + if ((priv_key = EC_KEY_get0_private_key(eckey)) == NULL) { ECDSAerror(ERR_R_PASSED_NULL_PARAMETER); goto err; } -- 2.20.1