From acdfeb4b3f0c64ad20f28513618e9903bfb81426 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 1 Sep 2021 15:48:27 +0200 Subject: fix SSSE3 SHA384 to work more than once The output function called sha512_digest() instead of sha384_digest(), which caused the hash context to be reinitialized for SHA512 instead of SHA384 and all following digests using the hash handle were wrong. Signed-off-by: Miroslav Lichvar --- lib/accelerated/x86/sha-x86-ssse3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/accelerated/x86/sha-x86-ssse3.c b/lib/accelerated/x86/sha-x86-ssse3.c index 8ea4e54aee..1d442e97e7 100644 --- a/lib/accelerated/x86/sha-x86-ssse3.c +++ b/lib/accelerated/x86/sha-x86-ssse3.c @@ -260,7 +260,7 @@ static int _ctx_init(gnutls_digest_algorithm_t algo, case GNUTLS_DIG_SHA384: sha384_init(&ctx->ctx.sha384); ctx->update = (update_func) x86_sha512_update; - ctx->digest = (digest_func) sha512_digest; + ctx->digest = (digest_func) sha384_digest; ctx->init = (init_func) sha384_init; ctx->ctx_ptr = &ctx->ctx.sha384; ctx->length = SHA384_DIGEST_SIZE; -- cgit v1.2.1