Merge pull request #1690 from SparkiDev/tls_sha384_copy

Remove special case SHA-384 copy code
pull/1701/head
toddouska 2018-07-18 09:37:50 -07:00 committed by GitHub
commit 227e7cc8c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 33 deletions

View File

@ -7056,30 +7056,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);
@ -7094,19 +7074,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;
}