gcm128.c: fix AAD-only case with AAD length not divisible by 16.
authorDr. Stephen Henson <steve@openssl.org>
Sun, 14 Oct 2012 12:29:25 +0000 (12:29 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 14 Oct 2012 12:29:25 +0000 (12:29 +0000)
PR: 2859
Submitted by: John Foley
(backport from HEAD)

crypto/modes/gcm128.c

index 8dfeae5ed50dd7f3e910ef42aa0786d375cdc5be..a52ffb1d22bd88855ab728d68ea0f9d7c194f2bd 100644 (file)
@@ -1403,7 +1403,7 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag,
        void (*gcm_gmult_p)(u64 Xi[2],const u128 Htable[16])    = ctx->gmult;
 #endif
 
-       if (ctx->mres)
+       if (ctx->mres || ctx->ares)
                GCM_MUL(ctx,Xi);
 
        if (is_endian.little) {