From: x2018 Date: Wed, 1 Dec 2021 08:15:44 +0000 (+0800) Subject: remove redundant ERR_raise X-Git-Tag: openssl-3.2.0-alpha1~3232 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecf60b9e27c041e7c95669b52a399fc2f20fd0fe;p=thirdparty%2Fopenssl.git remove redundant ERR_raise Reviewed-by: Shane Lontis Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/17175) --- diff --git a/crypto/cmp/cmp_vfy.c b/crypto/cmp/cmp_vfy.c index d9fd23425b5..cdfad0a6317 100644 --- a/crypto/cmp/cmp_vfy.c +++ b/crypto/cmp/cmp_vfy.c @@ -34,10 +34,8 @@ static int verify_signature(const OSSL_CMP_CTX *cmp_ctx, return 0; bio = BIO_new(BIO_s_mem()); /* may be NULL */ - if (bio == NULL) { - ERR_raise(ERR_LIB_CMP, ERR_R_MALLOC_FAILURE); + if (bio == NULL) return 0; - } /* verify that keyUsage, if present, contains digitalSignature */ if (!cmp_ctx->ignore_keyusage && (X509_get_key_usage(cert) & X509v3_KU_DIGITAL_SIGNATURE) == 0) { diff --git a/crypto/x509/t_x509.c b/crypto/x509/t_x509.c index ae39b0f231a..13ccb35508a 100644 --- a/crypto/x509/t_x509.c +++ b/crypto/x509/t_x509.c @@ -470,10 +470,8 @@ int X509_STORE_CTX_print_verify_cb(int ok, X509_STORE_CTX *ctx) int cert_error = X509_STORE_CTX_get_error(ctx); BIO *bio = BIO_new(BIO_s_mem()); /* may be NULL */ - if (bio == NULL) { - ERR_raise(ERR_LIB_X509, ERR_R_MALLOC_FAILURE); + if (bio == NULL) return 0; - } BIO_printf(bio, "%s at depth = %d error = %d (%s)\n", X509_STORE_CTX_get0_parent_ctx(ctx) != NULL ? "CRL path validation"