diff --git a/wolfcrypt/src/coding.c b/wolfcrypt/src/coding.c index 1834c2da3..6ead79caf 100644 --- a/wolfcrypt/src/coding.c +++ b/wolfcrypt/src/coding.c @@ -133,7 +133,7 @@ int Base64_Decode(const byte* in, word32 inLen, byte* out, word32* outLen) } -#if defined(OPENSSL_EXTRA) || defined (SESSION_CERTS) || defined(WOLFSSL_KEY_GEN) || defined(WOLFSSL_CERT_GEN) || defined(HAVE_WEBSERVER) +#if defined(WOLFSSL_BASE64_ENCODE) static const byte base64Encode[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', @@ -324,7 +324,7 @@ int Base64_EncodeEsc(const byte* in, word32 inLen, byte* out, word32* outLen) } -#endif /* defined(OPENSSL_EXTRA) || defined (SESSION_CERTS) || defined(WOLFSSL_KEY_GEN) || defined(WOLFSSL_CERT_GEN) || defined(HAVE_WEBSERVER) */ +#endif /* defined(WOLFSSL_BASE64_ENCODE) */ #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) || defined(HAVE_FIPS) diff --git a/wolfssl/wolfcrypt/coding.h b/wolfssl/wolfcrypt/coding.h index b5a0ce345..296bc3ca7 100644 --- a/wolfssl/wolfcrypt/coding.h +++ b/wolfssl/wolfcrypt/coding.h @@ -30,11 +30,17 @@ #endif -/* decode needed by wolfSSL */ -WOLFSSL_LOCAL int Base64_Decode(const byte* in, word32 inLen, byte* out, +WOLFSSL_API int Base64_Decode(const byte* in, word32 inLen, byte* out, word32* outLen); -#if defined(OPENSSL_EXTRA) || defined(SESSION_CERTS) || defined(WOLFSSL_KEY_GEN) || defined(WOLFSSL_CERT_GEN) || defined(HAVE_WEBSERVER) +#if defined(OPENSSL_EXTRA) || defined(SESSION_CERTS) || defined(WOLFSSL_KEY_GEN) || defined(WOLFSSL_CERT_GEN) || defined(HAVE_WEBSERVER) + #ifndef WOLFSSL_BASE64_ENCODE + #define WOLFSSL_BASE64_ENCODE + #endif +#endif + + +#ifdef WOLFSSL_BASE64_ENCODE /* encode isn't */ WOLFSSL_API int Base64_Encode(const byte* in, word32 inLen, byte* out,