summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ecdsa/ecdsa.c
diff options
context:
space:
mode:
authortb <>2023-07-05 12:49:42 +0000
committertb <>2023-07-05 12:49:42 +0000
commit9914c89497017b4305c8eec078335a5caabb9c2c (patch)
tree1be278ab6757ff7a23161c8a704200cb5547d702 /src/lib/libcrypto/ecdsa/ecdsa.c
parent498fab0efc6473d808db50ba126dd8886c0e6f5e (diff)
downloadopenbsd-9914c89497017b4305c8eec078335a5caabb9c2c.tar.gz
openbsd-9914c89497017b4305c8eec078335a5caabb9c2c.tar.bz2
openbsd-9914c89497017b4305c8eec078335a5caabb9c2c.zip
Improve BN_bn2bin() error check for readability
Diffstat (limited to 'src/lib/libcrypto/ecdsa/ecdsa.c')
-rw-r--r--src/lib/libcrypto/ecdsa/ecdsa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ecdsa/ecdsa.c b/src/lib/libcrypto/ecdsa/ecdsa.c
index 20d605cafd..d0cc846af3 100644
--- a/src/lib/libcrypto/ecdsa/ecdsa.c
+++ b/src/lib/libcrypto/ecdsa/ecdsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecdsa.c,v 1.2 2023/07/05 12:27:36 tb Exp $ */ 1/* $OpenBSD: ecdsa.c,v 1.3 2023/07/05 12:49:42 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -196,7 +196,7 @@ ecdsa_prepare_digest(const unsigned char *digest, int digest_len,
196 const EC_GROUP *group; 196 const EC_GROUP *group;
197 int digest_bits, order_bits; 197 int digest_bits, order_bits;
198 198
199 if (!BN_bin2bn(digest, digest_len, e)) { 199 if (BN_bin2bn(digest, digest_len, e) == NULL) {
200 ECDSAerror(ERR_R_BN_LIB); 200 ECDSAerror(ERR_R_BN_LIB);
201 return 0; 201 return 0;
202 } 202 }