From e894340a6462a5675819f44e6df1d4b74018fac1 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 4 Oct 2021 17:10:28 -0500 Subject: [PATCH] tls13.c: mac2hash(): accommodate scenario where all hashes are gated out of the build (peer review). --- src/tls13.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tls13.c b/src/tls13.c index 4d8444c2e..5d7ad4bf1 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -332,7 +332,7 @@ static int DeriveKey(WOLFSSL* ssl, byte* output, int outputLen, */ static WC_INLINE int mac2hash(int mac) { - int hash = WC_HASH_TYPE_NONE; + int hash; switch (mac) { #ifndef NO_SHA256 case sha256_mac: @@ -351,6 +351,8 @@ static WC_INLINE int mac2hash(int mac) hash = WC_SHA512; break; #endif + default: + hash = WC_HASH_TYPE_NONE; } return hash; }