From bd6cba7c556e5896d33b257f44f858271ff0e07b Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 5 Jul 2023 12:49:42 +0000 Subject: [PATCH] Improve BN_bn2bin() error check for readability --- lib/libcrypto/ecdsa/ecdsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/ecdsa/ecdsa.c b/lib/libcrypto/ecdsa/ecdsa.c index 20d605cafd0..d0cc846af30 100644 --- a/lib/libcrypto/ecdsa/ecdsa.c +++ b/lib/libcrypto/ecdsa/ecdsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecdsa.c,v 1.2 2023/07/05 12:27:36 tb Exp $ */ +/* $OpenBSD: ecdsa.c,v 1.3 2023/07/05 12:49:42 tb Exp $ */ /* ==================================================================== * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. * @@ -196,7 +196,7 @@ ecdsa_prepare_digest(const unsigned char *digest, int digest_len, const EC_GROUP *group; int digest_bits, order_bits; - if (!BN_bin2bn(digest, digest_len, e)) { + if (BN_bin2bn(digest, digest_len, e) == NULL) { ECDSAerror(ERR_R_BN_LIB); return 0; } -- 2.20.1