From 6767646e548da9f6578fa0954c843aa267f227c8 Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Tue, 20 Oct 2020 19:11:35 +0900 Subject: [PATCH] set tag for zero len case --- wolfcrypt/src/evp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wolfcrypt/src/evp.c b/wolfcrypt/src/evp.c index fb859d41a..8477434e7 100644 --- a/wolfcrypt/src/evp.c +++ b/wolfcrypt/src/evp.c @@ -624,9 +624,6 @@ WOLFSSL_API int wolfSSL_EVP_CipherUpdate(WOLFSSL_EVP_CIPHER_CTX *ctx, } *outl = 0; - if (inl == 0) { - return WOLFSSL_SUCCESS; - } #if !defined(NO_AES) && defined(HAVE_AESGCM) switch (ctx->cipherType) { @@ -645,7 +642,10 @@ WOLFSSL_API int wolfSSL_EVP_CipherUpdate(WOLFSSL_EVP_CIPHER_CTX *ctx, return WOLFSSL_FAILURE; } - + /* if(inl == 0)wolfSSL_EVP_CipherUpdate_GCM to get tag */ + if (inl == 0) { + return WOLFSSL_SUCCESS; + } if (ctx->bufUsed > 0) { /* concatenate them if there is anything */ fill = fillBuff(ctx, in, inl); inl -= fill;