]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
cmp_util.c: Fix OSSL_CMP_log_open() in case OPENSSL_NO_TRACE
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Sat, 3 Apr 2021 09:29:54 +0000 (11:29 +0200)
committerDr. David von Oheimb <dev@ddvo.net>
Wed, 14 Apr 2021 15:03:11 +0000 (17:03 +0200)
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14842)

crypto/cmp/cmp_util.c

index eef297d50bddb45b1f668cabda1d5c0ba6511a6e..56f2b0eeb8236c2a0d902805c680ed5c315fac64 100644 (file)
 
 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 */