From 87f378efb59bcb7d26d368b19848a83b38ae340f Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Tue, 17 Jul 2018 08:16:46 +1000 Subject: [PATCH] Remove special case SHA-384 copy code SHA-384 implementation has a GetHash API and TLS code uses it. --- src/internal.c | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/src/internal.c b/src/internal.c index 67edb86d4..a053ae0c4 100644 --- a/src/internal.c +++ b/src/internal.c @@ -7050,30 +7050,10 @@ static int BuildSHA(WOLFSSL* ssl, Hashes* hashes, const byte* sender) static int BuildFinished(WOLFSSL* ssl, Hashes* hashes, const byte* sender) { int ret = 0; -#ifdef WOLFSSL_SHA384 -#ifdef WOLFSSL_SMALL_STACK - wc_Sha384* sha384; -#else - wc_Sha384 sha384[1]; -#endif /* WOLFSSL_SMALL_STACK */ -#endif /* WOLFSSL_SHA384 */ if (ssl == NULL) return BAD_FUNC_ARG; -#ifdef WOLFSSL_SHA384 -#ifdef WOLFSSL_SMALL_STACK - sha384 = (wc_Sha384*)XMALLOC(sizeof(wc_Sha384), ssl->heap, DYNAMIC_TYPE_HASHCTX); - if (sha384 == NULL) - return MEMORY_E; -#endif /* WOLFSSL_SMALL_STACK */ -#endif /* WOLFSSL_SHA384 */ - - /* store current states, building requires get_digest which resets state */ -#ifdef WOLFSSL_SHA384 - sha384[0] = ssl->hsHashes->hashSha384; -#endif - #ifndef NO_TLS if (ssl->options.tls) { ret = BuildTlsFinished(ssl, hashes, sender); @@ -7088,19 +7068,6 @@ static int BuildFinished(WOLFSSL* ssl, Hashes* hashes, const byte* sender) } #endif - /* restore */ - if (IsAtLeastTLSv1_2(ssl)) { - #ifdef WOLFSSL_SHA384 - ssl->hsHashes->hashSha384 = sha384[0]; - #endif - } - -#ifdef WOLFSSL_SHA384 -#ifdef WOLFSSL_SMALL_STACK - XFREE(sha384, ssl->heap, DYNAMIC_TYPE_HASHCTX); -#endif -#endif - return ret; }