From c2e60d523f3601eb37eb8c0217eb858e3df9d394 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Wed, 17 Apr 2024 11:16:18 -0600 Subject: [PATCH] fix for WOLFSSL_NO_PEM build --- src/ssl_load.c | 2 +- tests/api.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ssl_load.c b/src/ssl_load.c index 43982c4dc..3575b6379 100644 --- a/src/ssl_load.c +++ b/src/ssl_load.c @@ -2530,7 +2530,7 @@ int ProcessFile(WOLFSSL_CTX* ctx, const char* fname, int format, int type, } /* Try to detect type by parsing cert header and footer. */ if ((ret == 0) && (type == DETECT_CERT_TYPE)) { -#ifndef NO_CODING +#if !defined(NO_CODING) && !defined(WOLFSSL_NO_PEM) const char* header = NULL; const char* footer = NULL; diff --git a/tests/api.c b/tests/api.c index 698afe2a2..ad07619f7 100644 --- a/tests/api.c +++ b/tests/api.c @@ -12505,7 +12505,7 @@ static int test_wolfSSL_PKCS8(void) XFILE f = XBADFILE; int bytes = 0; WOLFSSL_CTX* ctx = NULL; -#if defined(HAVE_ECC) && !defined(NO_CODING) +#if defined(HAVE_ECC) && !defined(NO_CODING) && !defined(WOLFSSL_NO_PEM) int ret; ecc_key key; word32 x = 0; @@ -12665,7 +12665,7 @@ static int test_wolfSSL_PKCS8(void) ExpectIntEQ(wolfSSL_CTX_use_PrivateKey_buffer(ctx, buff, bytes, WOLFSSL_FILETYPE_PEM), WOLFSSL_SUCCESS); -#ifndef NO_CODING +#if !defined(NO_CODING) && !defined(WOLFSSL_NO_PEM) /* decrypt PKCS8 PEM to key in DER format */ ExpectIntGT((bytes = wc_KeyPemToDer(buff, bytes, der, (word32)sizeof(der), NULL)), 0);