summaryrefslogtreecommitdiffstats
path: root/crypto/cmp/cmp_util.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-04-03 11:29:54 +0200
committerDr. David von Oheimb <dev@ddvo.net>2021-04-14 17:03:11 +0200
commit9518f8957ae5a156e55117c511996ee1775612a2 (patch)
tree09041d47c3cbd3b4336d91404a9d0d8a9cca5066 /crypto/cmp/cmp_util.c
parentf56c9c7c942cd82595bb47808c732048141dc72d (diff)
cmp_util.c: Fix OSSL_CMP_log_open() in case OPENSSL_NO_TRACE
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14842)
Diffstat (limited to 'crypto/cmp/cmp_util.c')
-rw-r--r--crypto/cmp/cmp_util.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/cmp/cmp_util.c b/crypto/cmp/cmp_util.c
index eef297d50b..56f2b0eeb8 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 */