Don't require tag before ciphertext in AESGCM mode
This commit is contained in:
parent
487a0df700
commit
96f7fafa24
@ -969,8 +969,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)
|
||||
@ -1012,6 +1010,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user