From 942899defadd2c1d0fca12f6833b900bb5c604ac Mon Sep 17 00:00:00 2001 From: Norman Ashley Date: Mon, 7 Oct 2024 23:10:42 -0400 Subject: [PATCH] Update ossl_helpers.c Remove OPENSSL build-time macro from helper functions. --- src/common/ossl_helpers.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/common/ossl_helpers.c b/src/common/ossl_helpers.c index cd2c91f10..3e5262e54 100644 --- a/src/common/ossl_helpers.c +++ b/src/common/ossl_helpers.c @@ -27,28 +27,21 @@ static void fetch_ossl_objects(void) { sha384_ptr = OSSL_FUNC(EVP_MD_fetch)(NULL, "SHA384", NULL); sha512_ptr = OSSL_FUNC(EVP_MD_fetch)(NULL, "SHA512", NULL); -#if defined(OQS_USE_SHA3_OPENSSL) sha3_256_ptr = OSSL_FUNC(EVP_MD_fetch)(NULL, "SHA3-256", NULL); sha3_384_ptr = OSSL_FUNC(EVP_MD_fetch)(NULL, "SHA3-384", NULL); sha3_512_ptr = OSSL_FUNC(EVP_MD_fetch)(NULL, "SHA3-512", NULL); shake128_ptr = OSSL_FUNC(EVP_MD_fetch)(NULL, "SHAKE128", NULL); shake256_ptr = OSSL_FUNC(EVP_MD_fetch)(NULL, "SHAKE256", NULL); -#endif -#if defined(OQS_USE_AES_OPENSSL) + aes128_ecb_ptr = OSSL_FUNC(EVP_CIPHER_fetch)(NULL, "AES-128-ECB", NULL); aes128_ctr_ptr = OSSL_FUNC(EVP_CIPHER_fetch)(NULL, "AES-128-CTR", NULL); aes256_ecb_ptr = OSSL_FUNC(EVP_CIPHER_fetch)(NULL, "AES-256-ECB", NULL); aes256_ctr_ptr = OSSL_FUNC(EVP_CIPHER_fetch)(NULL, "AES-256-CTR", NULL); -#endif if (!sha256_ptr || !sha384_ptr || !sha512_ptr -#if defined(OQS_USE_SHA3_OPENSSL) || !sha3_256_ptr || !sha3_384_ptr || !sha3_512_ptr || !shake128_ptr || !shake256_ptr -#endif -#if defined(OQS_USE_AES_OPENSSL) || !aes128_ecb_ptr || !aes128_ctr_ptr || !aes256_ecb_ptr || !aes256_ctr_ptr -#endif ) { fprintf(stderr, "liboqs warning: OpenSSL initialization failure. Is provider for SHA, SHAKE, AES enabled?\n"); }