From: Dr. David von Oheimb Date: Sat, 3 Apr 2021 09:29:54 +0000 (+0200) Subject: cmp_util.c: Fix OSSL_CMP_log_open() in case OPENSSL_NO_TRACE X-Git-Tag: openssl-3.0.0-alpha15~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9518f8957ae5a156e55117c511996ee1775612a2;p=thirdparty%2Fopenssl.git cmp_util.c: Fix OSSL_CMP_log_open() in case OPENSSL_NO_TRACE Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/14842) --- diff --git a/crypto/cmp/cmp_util.c b/crypto/cmp/cmp_util.c index eef297d50bd..56f2b0eeb82 100644 --- a/crypto/cmp/cmp_util.c +++ b/crypto/cmp/cmp_util.c @@ -22,15 +22,19 @@ int OSSL_CMP_log_open(void) /* is designed to be idempotent */ { -#ifndef OPENSSL_NO_STDIO +#ifdef OPENSSL_NO_TRACE + return 1; +#else +# ifndef OPENSSL_NO_STDIO BIO *bio = BIO_new_fp(stdout, BIO_NOCLOSE); if (bio != NULL && OSSL_trace_set_channel(OSSL_TRACE_CATEGORY_CMP, bio)) return 1; BIO_free(bio); -#endif +# endif ERR_raise(ERR_LIB_CMP, CMP_R_NO_STDIO); return 0; +#endif } void OSSL_CMP_log_close(void) /* is designed to be idempotent */