From: Dr. Stephen Henson Date: Tue, 16 Oct 2012 22:46:08 +0000 (+0000) Subject: Don't require tag before ciphertext in AESGCM mode X-Git-Tag: OpenSSL-fips-2_0_5~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7e98d95f56aac520a5fcb0aaf708bac13cbb7523;p=oweals%2Fopenssl.git Don't require tag before ciphertext in AESGCM mode (cherry picked from commit 964eaad78ccdc6c4537664924e6082b08cc1c8ee) --- diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c index 71f9e037d5..45e85047f1 100644 --- a/crypto/evp/e_aes.c +++ b/crypto/evp/e_aes.c @@ -956,8 +956,6 @@ static int aes_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, if (!gctx->iv_set) return -1; - if (!ctx->encrypt && gctx->taglen < 0) - return -1; if (in) { if (out == NULL) @@ -999,6 +997,8 @@ static int aes_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, { if (!ctx->encrypt) { + if (gctx->taglen < 0) + return -1; if (CRYPTO_gcm128_finish(&gctx->gcm, ctx->buf, gctx->taglen) != 0) return -1;