From 417ff1b0f2a09b85b5db085e5bb10b2f57ec4d2e Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Fri, 30 Oct 2020 16:13:37 +0900 Subject: [PATCH] set tag for zero len case --- wolfcrypt/src/evp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/evp.c b/wolfcrypt/src/evp.c index 363149e61..e84ccf3f9 100644 --- a/wolfcrypt/src/evp.c +++ b/wolfcrypt/src/evp.c @@ -770,8 +770,8 @@ int wolfSSL_EVP_CipherFinal(WOLFSSL_EVP_CIPHER_CTX *ctx, case AES_128_GCM_TYPE: case AES_192_GCM_TYPE: case AES_256_GCM_TYPE: - if (ctx->gcmBuffer && - ctx->gcmBufferLen > 0) { + if ((ctx->gcmBuffer && ctx->gcmBufferLen > 0) + || (ctx->gcmBuffer == NULL && ctx->gcmBufferLen == 0)) { ret = 0; if (ctx->gcmAuthIn) { /* authenticated, non-confidential data*/