From 4bfd0443a721fe8dafb07e54bf71f74b023f9f07 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Mon, 23 Aug 2021 10:31:11 +1000 Subject: [PATCH] OpenSSL Extra builds: fixes from nightly builds failing Prototype is required when internal.h is not included and GetCA is not defined. wolfSSL_EVP_CIPHER_CTX_set_iv_length() is called with CBC cipher in api.c. Function is not specificly for GCM, though not strictly needed for CBC. --- wolfcrypt/src/asn.c | 11 +++++------ wolfcrypt/src/evp.c | 5 ++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index f376ae79e..75cef82e2 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -16789,9 +16789,8 @@ int ParseCert(DecodedCert* cert, int type, int verify, void* cm) return ret; } -#if defined(WOLFCRYPT_ONLY) || defined(NO_CERTS) \ - || (!defined(OPENSSL_EXTRA) && !defined(OPENSSL_EXTRA_X509_SMALL) \ - && !defined(GetCA)) +#if !defined(OPENSSL_EXTRA) && !defined(OPENSSL_EXTRA_X509_SMALL) && \ + !defined(GetCA) /* from SSL proper, for locking can't do find here anymore. * brought in from internal.h if built with compat layer. * if defined(GetCA), it's a predefined macro and these prototypes @@ -16808,9 +16807,9 @@ int ParseCert(DecodedCert* cert, int type, int verify, void* cm) } #endif -#endif /* WOLFCRYPT_ONLY || NO_CERTS || (!OPENSSL_EXTRA && !OPENSSL_EXTRA_X509_SMALL && !GetCA) */ +#endif /* !OPENSSL_EXTRA && !OPENSSL_EXTRA_X509_SMALL && !GetCA */ -#if defined(WOLFCRYPT_ONLY) || defined(NO_CERTS) +#if defined(WOLFCRYPT_ONLY) /* dummy functions, not using wolfSSL so don't need actual ones */ Signer* GetCA(void* signers, byte* hash) @@ -16829,7 +16828,7 @@ Signer* GetCAByName(void* signers, byte* hash) } #endif /* NO_SKID */ -#endif /* WOLFCRYPT_ONLY || NO_CERTS */ +#endif /* WOLFCRYPT_ONLY */ #if defined(WOLFSSL_NO_TRUSTED_CERTS_VERIFY) && !defined(NO_SKID) static Signer* GetCABySubjectAndPubKey(DecodedCert* cert, void* cm) diff --git a/wolfcrypt/src/evp.c b/wolfcrypt/src/evp.c index 9f1db41f4..83ebdb595 100644 --- a/wolfcrypt/src/evp.c +++ b/wolfcrypt/src/evp.c @@ -5693,7 +5693,8 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD* type) return WOLFSSL_SUCCESS; } -#if defined(HAVE_AESGCM) + +#ifdef HAVE_WOLFSSL_EVP_CIPHER_CTX_IV /* returns WOLFSSL_SUCCESS on success, otherwise returns WOLFSSL_FAILURE */ int wolfSSL_EVP_CIPHER_CTX_set_iv_length(WOLFSSL_EVP_CIPHER_CTX* ctx, int ivLen) @@ -5706,7 +5707,9 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD* type) return WOLFSSL_SUCCESS; } +#endif +#if defined(HAVE_AESGCM) /* returns WOLFSSL_SUCCESS on success, otherwise returns WOLFSSL_FAILURE */ int wolfSSL_EVP_CIPHER_CTX_set_iv(WOLFSSL_EVP_CIPHER_CTX* ctx, byte* iv, int ivLen)