Skip to content

Commit

Permalink
Fix nested NO_TLS.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Dec 10, 2024
1 parent dfd7aa8 commit 74760b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
22 changes: 7 additions & 15 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -11904,14 +11904,9 @@ static int BuildFinished(WOLFSSL* ssl, Hashes* hashes, const byte* sender)
if (ssl == NULL)
return BAD_FUNC_ARG;

#ifndef NO_TLS
if (ssl->options.tls) {
ret = BuildTlsFinished(ssl, hashes, sender);
}
#else
(void)hashes;
(void)sender;
#endif
#ifndef NO_OLD_TLS
if (!ssl->options.tls) {
ret = BuildMD5(ssl, hashes, sender);
Expand Down Expand Up @@ -22903,8 +22898,8 @@ int BuildMessage(WOLFSSL* ssl, byte* output, int outSz, const byte* input,
int inSz, int type, int hashOutput, int sizeOnly, int asyncOkay,
int epochOrder)
{
#ifndef WOLFSSL_NO_TLS12
int ret;
#if !defined(NO_TLS) && !defined(WOLFSSL_NO_TLS12)
BuildMsgArgs* args;
BuildMsgArgs lcl_args;
#endif
Expand All @@ -22924,12 +22919,12 @@ int BuildMessage(WOLFSSL* ssl, byte* output, int outSz, const byte* input,

(void)epochOrder;

#ifndef NO_TLS
#if defined(WOLFSSL_NO_TLS12) && defined(WOLFSSL_TLS13)
/* TLS v1.3 only */
return BuildTls13Message(ssl, output, outSz, input, inSz, type,
hashOutput, sizeOnly, asyncOkay);
#else

/* TLS v1.2 or v1.3 */
#ifdef WOLFSSL_TLS13
if (ssl->options.tls1_3) {
return BuildTls13Message(ssl, output, outSz, input, inSz, type,
Expand Down Expand Up @@ -23450,19 +23445,16 @@ int BuildMessage(WOLFSSL* ssl, byte* output, int outSz, const byte* input,

/* Final cleanup */
FreeBuildMsgArgs(ssl, args);
#endif /* !WOLFSSL_NO_TLS12 */
#endif /* !WOLFSSL_NO_TLS12 || WOLFSSL_TLS13 */
#endif /* !NO_TLS */

#if defined(NO_TLS) || (defined(WOLFSSL_NO_TLS12) && !defined(WOLFSSL_TLS13))
return ret;
#else
(void)outSz;
(void)inSz;
(void)type;
(void)hashOutput;
(void)asyncOkay;
ret = NOT_COMPILED_IN;
return NOT_COMPILED_IN;
#endif /* !WOLFSSL_NO_TLS12 */
#endif
return ret;
}

#ifndef WOLFSSL_NO_TLS12
Expand Down
4 changes: 2 additions & 2 deletions src/keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include <wolfssl/wolfcrypt/settings.h>

#ifndef WOLFCRYPT_ONLY
#if !defined(WOLFCRYPT_ONLY) && !defined(NO_TLS)

#include <wolfssl/internal.h>
#include <wolfssl/error-ssl.h>
Expand Down Expand Up @@ -4109,4 +4109,4 @@ int MakeMasterSecret(WOLFSSL* ssl)
#endif
}

#endif /* WOLFCRYPT_ONLY */
#endif /* !WOLFCRYPT_ONLY && !NO_TLS */

0 comments on commit 74760b4

Please sign in to comment.