]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
fix SSSE3 SHA384 to work more than once
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 1 Sep 2021 13:48:27 +0000 (15:48 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 7 Sep 2021 13:54:27 +0000 (15:54 +0200)
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 <mlichvar@redhat.com>
lib/accelerated/x86/sha-x86-ssse3.c

index 8ea4e54aee7634362b7385379a93352c33776f77..1d442e97e7c018afa47b9eb584594ad9d5ac6094 100644 (file)
@@ -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;