We treat that as automatic success. Other EVP_*Update functions already do
this (e.g. EVP_EncryptUpdate, EVP_DecryptUpdate etc). EVP_EncodeUpdate is
a bit of an anomoly. That treats 0 byte input length as an error.
Fixes #8576
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8587)
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;
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);
}