Merge pull request #5361 from embhorn/zd14491

Fix for build with NO_TLS
pull/5376/head
David Garske 2022-07-20 09:28:23 -07:00 committed by GitHub
commit b46a308544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 10 deletions

View File

@ -6542,7 +6542,7 @@ int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
#ifndef WOLFSSL_AEAD_ONLY
#ifndef NO_OLD_TLS
ssl->hmac = SSL_hmac; /* default to SSLv3 */
#elif !defined(WOLFSSL_NO_TLS12)
#elif !defined(WOLFSSL_NO_TLS12) && !defined(NO_TLS)
#if !defined(WOLFSSL_RENESAS_SCEPROTECT) && \
!defined(WOLFSSL_RENESAS_TSIP_TLS)
ssl->hmac = TLS_hmac;
@ -10207,6 +10207,9 @@ static int BuildFinished(WOLFSSL* ssl, Hashes* hashes, const byte* sender)
if (ssl->options.tls) {
ret = BuildTlsFinished(ssl, hashes, sender);
}
#else
(void)hashes;
(void)sender;
#endif
#ifndef NO_OLD_TLS
if (!ssl->options.tls) {
@ -17307,6 +17310,8 @@ static WC_INLINE int GetRounds(int pLen, int padLen, int t)
return ret;
}
#else
#if !defined(WOLFSSL_NO_TLS12) && !defined(WOLFSSL_AEAD_ONLY)
/* check all length bytes for the pad value, return 0 on success */
static int PadCheck(const byte* a, byte pad, int length)
{
@ -17444,9 +17449,9 @@ int TimingPadVerify(WOLFSSL* ssl, const byte* input, int padLen, int macSz,
return ret;
}
#endif
#endif
#endif /* !WOLFSSL_NO_TLS12 && !WOLFSSL_AEAD_ONLY */
#endif /* WOLSSL_OLD_TIMINGPADVERIFY */
#endif /* WOLFSSL_AEAD_ONLY */
int DoApplicationData(WOLFSSL* ssl, byte* input, word32* inOutIdx, int sniff)
{
@ -18478,6 +18483,7 @@ int ProcessReplyEx(WOLFSSL* ssl, int allowSocketErr)
ret = DECRYPT_ERROR;
#endif /* WOLFSSL_TLS13 */
}
(void)in;
}
#ifdef WOLFSSL_ASYNC_CRYPT
@ -19548,6 +19554,7 @@ int BuildMessage(WOLFSSL* ssl, byte* output, int outSz, const byte* input,
(void)epochOrder;
#ifndef NO_TLS
#ifdef WOLFSSL_NO_TLS12
return BuildTls13Message(ssl, output, outSz, input, inSz, type,
hashOutput, sizeOnly, asyncOkay);
@ -19995,6 +20002,15 @@ exit_buildmsg:
return ret;
#endif /* !WOLFSSL_NO_TLS12 */
#else
(void)outSz;
(void)inSz;
(void)type;
(void)hashOutput;
(void)asyncOkay;
return NOT_COMPILED_IN;
#endif /* NO_TLS */
}
#ifndef WOLFSSL_NO_TLS12

View File

@ -3510,7 +3510,7 @@ int MakeMasterSecret(WOLFSSL* ssl)
#ifndef NO_OLD_TLS
if (ssl->options.tls) return MakeTlsMasterSecret(ssl);
return MakeSslMasterSecret(ssl);
#elif !defined(WOLFSSL_NO_TLS12)
#elif !defined(WOLFSSL_NO_TLS12) && !defined(NO_TLS)
return MakeTlsMasterSecret(ssl);
#else
(void)ssl;

View File

@ -16923,6 +16923,7 @@ WOLFSSL_API int wolfSSL_CTX_get_min_proto_version(WOLFSSL_CTX* ctx)
* returns WOLFSSL_FATAL_ERROR on no match */
static int GetMaxProtoVersion(long options)
{
#ifndef NO_TLS
#ifdef WOLFSSL_TLS13
if (!(options & WOLFSSL_OP_NO_TLSv1_3))
return TLS1_3_VERSION;
@ -16943,7 +16944,9 @@ static int GetMaxProtoVersion(long options)
return SSL3_VERSION;
#endif
#endif
#else
(void)options;
#endif /* NO_TLS */
return WOLFSSL_FATAL_ERROR;
}

View File

@ -64,6 +64,8 @@
#include <wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h>
#endif
#ifndef NO_TLS
#if defined(WOLFSSL_TLS13) && defined(HAVE_SUPPORTED_CURVES)
static int TLSX_KeyShare_IsSupported(int namedGroup);
static void TLSX_KeyShare_FreeAll(KeyShareEntry* list, void* heap);
@ -73,8 +75,6 @@ static void TLSX_KeyShare_FreeAll(KeyShareEntry* list, void* heap);
static int TLSX_PopulateSupportedGroups(WOLFSSL* ssl, TLSX** extensions);
#endif
#ifndef NO_TLS
/* Digest enable checks */
#ifdef NO_OLD_TLS /* TLS 1.2 only */
#if defined(NO_SHA256) && !defined(WOLFSSL_SHA384) && \

View File

@ -11142,6 +11142,8 @@ static int GenerateDNSEntryIPString(DNS_entry* entry, void* heap)
entry->ipString[nameSz] = '\0';
}
(void)heap;
return ret;
}
#endif /* OPENSSL_ALL || WOLFSSL_IP_ALT_NAME */

View File

@ -2396,8 +2396,8 @@ extern void uITRON4_free(void *p) ;
#undef HAVE_GMTIME_R /* don't trust macro with windows */
#endif /* WOLFSSL_MYSQL_COMPATIBLE */
#if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) \
|| defined(HAVE_LIGHTY)
#if (defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) \
|| defined(HAVE_LIGHTY)) && !defined(NO_TLS)
#define OPENSSL_NO_ENGINE
#ifndef OPENSSL_EXTRA
#define OPENSSL_EXTRA