From: tb Date: Wed, 5 Jul 2023 12:49:42 +0000 (+0000) Subject: Improve BN_bn2bin() error check for readability X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bd6cba7c556e5896d33b257f44f858271ff0e07b;p=openbsd Improve BN_bn2bin() error check for readability --- 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; }