summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2012-10-16 22:46:32 +0000
committerDr. Stephen Henson <steve@openssl.org>2012-10-16 22:46:32 +0000
commit9a6aff50ff70f19a10bbe1281f99bc5eb192efc7 (patch)
tree79e93fe1a651bc14447cb9ab18150400855b103e /crypto/evp
parentc7d16ac8daebc9bf90faa063c8624e8a454bdd6f (diff)
Don't require tag before ciphertext in AESGCM mode
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/e_aes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c
index 11d728bbc2..763b90729e 100644
--- a/crypto/evp/e_aes.c
+++ b/crypto/evp/e_aes.c
@@ -973,8 +973,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)
@@ -1016,6 +1014,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;