]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/evp/digest.c
Tolerate 0 byte input length for Update functions
[thirdparty/openssl.git] / crypto / evp / digest.c
index d4b481443c1e0fd20371a6af25f484edba710298..7b4972553b92b618ce5b6727858759e2acbee766 100644 (file)
@@ -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;