[openssl] master update

Matt Caswell matt at openssl.org
Wed Mar 27 10:24:48 UTC 2019


The branch master has been updated
       via  a8274ea351988aa754cb9983b27d7059613ee11e (commit)
      from  1f019cd0ac9343c51dfdcef1df9a1859cf8fbe03 (commit)


- Log -----------------------------------------------------------------
commit a8274ea351988aa754cb9983b27d7059613ee11e
Author: Matt Caswell <matt at openssl.org>
Date:   Tue Mar 26 15:25:15 2019 +0000

    Tolerate 0 byte input length for Update functions
    
    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 at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/8587)

-----------------------------------------------------------------------

Summary of changes:
 crypto/evp/digest.c  | 3 +++
 crypto/evp/mac_lib.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c
index d4b4814..7b49725 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 2f46277..39efff0 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);
 }
 


More information about the openssl-commits mailing list