[openssl-commits] [openssl] OpenSSL_1_1_1-stable update

Matt Caswell matt at openssl.org
Fri Feb 15 10:02:30 UTC 2019


The branch OpenSSL_1_1_1-stable has been updated
       via  1b25dc0cf3674dadab8ff13c8de1679910c047d2 (commit)
      from  9c931841e522943fc226a06947b9959be0d53551 (commit)


- Log -----------------------------------------------------------------
commit 1b25dc0cf3674dadab8ff13c8de1679910c047d2
Author: Matt Caswell <matt at openssl.org>
Date:   Thu Feb 14 12:21:20 2019 +0000

    Use order not degree to calculate a buffer size in ecdsatest
    
    Otherwise this can result in an incorrect calculation of the maximum
    encoded integer length, meaning an insufficient buffer size is allocated.
    
    Thanks to Billy Brumley for helping to track this down.
    
    Fixes #8209
    
    Reviewed-by: Nicola Tuveri <nic.tuv at gmail.com>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Paul Dale <paul.dale at oracle.com>
    (Merged from https://github.com/openssl/openssl/pull/8237)
    
    (cherry picked from commit 9fc8f18f59f4a4c853466dca64a23b8af681bf1c)

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

Summary of changes:
 test/ecdsatest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/ecdsatest.c b/test/ecdsatest.c
index 96939a5..f2250ae 100644
--- a/test/ecdsatest.c
+++ b/test/ecdsatest.c
@@ -223,7 +223,7 @@ static int test_builtin(void)
     const BIGNUM *sig_r, *sig_s;
     BIGNUM *modified_r = NULL, *modified_s = NULL;
     BIGNUM *unmodified_r = NULL, *unmodified_s = NULL;
-    unsigned int sig_len, degree, r_len, s_len, bn_len, buf_len;
+    unsigned int sig_len, order, r_len, s_len, bn_len, buf_len;
     int nid, ret = 0;
 
     /* fill digest values with some random data */
@@ -251,7 +251,7 @@ static int test_builtin(void)
                 || !TEST_true(EC_KEY_set_group(eckey, group)))
             goto builtin_err;
         EC_GROUP_free(group);
-        degree = EC_GROUP_get_degree(EC_KEY_get0_group(eckey));
+        order = EC_GROUP_order_bits(EC_KEY_get0_group(eckey));
 
         TEST_info("testing %s", OBJ_nid2sn(nid));
 
@@ -316,7 +316,7 @@ static int test_builtin(void)
         /* Store the two BIGNUMs in raw_buf. */
         r_len = BN_num_bytes(sig_r);
         s_len = BN_num_bytes(sig_s);
-        bn_len = (degree + 7) / 8;
+        bn_len = (order + 7) / 8;
         if (!TEST_false(r_len > bn_len)
                 || !TEST_false(s_len > bn_len))
             goto builtin_err;


More information about the openssl-commits mailing list