From f3248cefe1e234ca471e6ad326bc2f4efaa56ca1 Mon Sep 17 00:00:00 2001 From: Spencer Wilson Date: Mon, 29 Jul 2024 09:57:41 -0400 Subject: [PATCH] Define OpenSSL guard iff OQS_USE_OPENSSL is set Signed-off-by: Spencer Wilson --- src/common/common.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/common/common.h b/src/common/common.h index 26fd2cef1..18993d0a5 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -43,24 +43,26 @@ extern "C" { * This is a temporary workaround until a better error * handling strategy is developed. */ -#if defined(OQS_USE_OPENSSL) && !defined(OPENSSL_NO_STDIO) +#ifdef OQS_USE_OPENSSL +#ifdef OPENSSL_NO_STDIO #define OQS_OPENSSL_GUARD(x) \ do { \ if( 1 != (x) ) { \ fprintf(stderr, "Error return value from OpenSSL API: %d. Exiting.\n", x); \ - OSSL_FUNC(ERR_print_errors_fp)(stderr); \ exit(EXIT_FAILURE); \ } \ } while (0) -#else +#else // OPENSSL_NO_STDIO #define OQS_OPENSSL_GUARD(x) \ do { \ if( 1 != (x) ) { \ fprintf(stderr, "Error return value from OpenSSL API: %d. Exiting.\n", x); \ + OSSL_FUNC(ERR_print_errors_fp)(stderr); \ exit(EXIT_FAILURE); \ } \ } while (0) -#endif // defined(OQS_USE_OPENSSL) && !defined(OPENSSL_NO_STDIO) +#endif // OPENSSL_NO_STDIO +#endif // OQS_USE_OPENSSL /** * Certain functions (such as OQS_randombytes_openssl in