summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/evp/digest.c3
-rw-r--r--crypto/evp/mac_lib.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c
index d4b481443c..7b4972553b 100644
--- a/crypto/evp/digest.c
+++ b/crypto/evp/digest.c
@@ -259,6 +259,9 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
{
+ if (count == 0)
+ return 1;
+
if (ctx->digest == NULL || ctx->digest->prov == NULL)
goto legacy;
diff --git a/crypto/evp/mac_lib.c b/crypto/evp/mac_lib.c
index 2f46277bf0..39efff0842 100644
--- a/crypto/evp/mac_lib.c
+++ b/crypto/evp/mac_lib.c
@@ -82,6 +82,8 @@ int EVP_MAC_init(EVP_MAC_CTX *ctx)
int EVP_MAC_update(EVP_MAC_CTX *ctx, const unsigned char *data, size_t datalen)
{
+ if (datalen == 0)
+ return 1;
return ctx->meth->update(ctx->data, data, datalen);
}