diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2012-10-16 22:46:08 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2012-10-16 22:46:08 +0000 |
commit | 964eaad78ccdc6c4537664924e6082b08cc1c8ee (patch) | |
tree | 7af620b37dccff3c05b80fb0f02e206bdb7caa43 /crypto/evp/e_aes.c | |
parent | 3bc522a246b34197362a4c34b517aa4c67c26f9a (diff) | |
download | openssl-964eaad78ccdc6c4537664924e6082b08cc1c8ee.tar.gz |
Don't require tag before ciphertext in AESGCM mode
Diffstat (limited to 'crypto/evp/e_aes.c')
-rw-r--r-- | crypto/evp/e_aes.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c index 46ffd99e2a..783ef2f7d5 100644 --- a/crypto/evp/e_aes.c +++ b/crypto/evp/e_aes.c @@ -1343,8 +1343,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) @@ -1386,6 +1384,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; |