[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Wed Feb 21 11:16:35 UTC 2018


The branch master has been updated
       via  c7a47adca29e1ec761d639dd75336bb36ebf4a9b (commit)
       via  7876dbffcee9a53ac8a75e90c0443c1193edb580 (commit)
      from  6c61b2749634246956f8ec7adc9520e5d22dcbf4 (commit)


- Log -----------------------------------------------------------------
commit c7a47adca29e1ec761d639dd75336bb36ebf4a9b
Author: Matt Caswell <matt at openssl.org>
Date:   Tue Feb 20 14:53:40 2018 +0000

    Fix no-ec build
    
    [extended tests]
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5418)

commit 7876dbffcee9a53ac8a75e90c0443c1193edb580
Author: Matt Caswell <matt at openssl.org>
Date:   Tue Feb 20 14:53:06 2018 +0000

    Fix some undefined behaviour in the Curve448 code
    
    We can't add NULL data into a hash
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5418)

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

Summary of changes:
 crypto/ec/curve448/eddsa.c               | 9 ++++++---
 test/build.info                          | 6 ++++--
 test/recipes/03-test_internal_curve448.t | 3 +++
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/crypto/ec/curve448/eddsa.c b/crypto/ec/curve448/eddsa.c
index 7175715..d318876 100644
--- a/crypto/ec/curve448/eddsa.c
+++ b/crypto/ec/curve448/eddsa.c
@@ -63,7 +63,8 @@ static c448_error_t hash_init_with_dom(EVP_MD_CTX *hashctx, uint8_t prehashed,
     if (!EVP_DigestInit_ex(hashctx, EVP_shake256(), NULL)
             || !EVP_DigestUpdate(hashctx, dom_s, strlen(dom_s))
             || !EVP_DigestUpdate(hashctx, dom, sizeof(dom))
-            || !EVP_DigestUpdate(hashctx, context, context_len))
+            || (context_len > 0
+                && !EVP_DigestUpdate(hashctx, context, context_len)))
         return C448_FAILURE;
 
     return C448_SUCCESS;
@@ -160,7 +161,8 @@ c448_error_t c448_ed448_sign(
                 || !EVP_DigestUpdate(hashctx,
                                      expanded + EDDSA_448_PRIVATE_BYTES,
                                      EDDSA_448_PRIVATE_BYTES)
-                || !EVP_DigestUpdate(hashctx, message, message_len)) {
+                || (message_len > 0
+                    && !EVP_DigestUpdate(hashctx, message, message_len))) {
             OPENSSL_cleanse(expanded, sizeof(expanded));
             goto err;
         }
@@ -200,7 +202,8 @@ c448_error_t c448_ed448_sign(
         if (!hash_init_with_dom(hashctx, prehashed, 0, context, context_len)
                 || !EVP_DigestUpdate(hashctx, nonce_point, sizeof(nonce_point))
                 || !EVP_DigestUpdate(hashctx, pubkey, EDDSA_448_PUBLIC_BYTES)
-                || !EVP_DigestUpdate(hashctx, message, message_len)
+                || (message_len > 0
+                    && !EVP_DigestUpdate(hashctx, message, message_len))
                 || !EVP_DigestFinalXOF(hashctx, challenge, sizeof(challenge)))
             goto err;
 
diff --git a/test/build.info b/test/build.info
index d8ea2f2..38fcf84 100644
--- a/test/build.info
+++ b/test/build.info
@@ -400,8 +400,7 @@ INCLUDE_MAIN___test_libtestutil_OLB = /INCLUDE=MAIN
   # names with the DLL import libraries.
   IF[{- $disabled{shared} || $target{build_scheme}->[1] ne 'windows' -}]
     PROGRAMS_NO_INST=asn1_internal_test modes_internal_test x509_internal_test \
-                     tls13encryptiontest wpackettest ctype_internal_test \
-                     curve448_internal_test
+                     tls13encryptiontest wpackettest ctype_internal_test
     IF[{- !$disabled{poly1305} -}]
       PROGRAMS_NO_INST=poly1305_internal_test
     ENDIF
@@ -414,6 +413,9 @@ INCLUDE_MAIN___test_libtestutil_OLB = /INCLUDE=MAIN
     IF[{- !$disabled{sm4} -}]
       PROGRAMS_NO_INST=sm4_internal_test
     ENDIF
+    IF[{- !$disabled{ec} -}]
+      PROGRAMS_NO_INST=curve448_internal_test
+    ENDIF
 
     SOURCE[poly1305_internal_test]=poly1305_internal_test.c
     INCLUDE[poly1305_internal_test]=.. ../include ../crypto/include
diff --git a/test/recipes/03-test_internal_curve448.t b/test/recipes/03-test_internal_curve448.t
index 1099d9e..44bac02 100644
--- a/test/recipes/03-test_internal_curve448.t
+++ b/test/recipes/03-test_internal_curve448.t
@@ -16,4 +16,7 @@ setup("test_internal_curve448");
 plan skip_all => "This test is unsupported in a shared library build on Windows"
     if $^O eq 'MSWin32' && !disabled("shared");
 
+plan skip_all => "This test is unsupported in a no-ec build"
+    if disabled("ec");
+
 simple_test("test_internal_curve448", "curve448_internal_test");


More information about the openssl-commits mailing list