[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

matthias.st.pierre at ncp-e.com matthias.st.pierre at ncp-e.com
Sat May 19 23:23:45 UTC 2018


The branch OpenSSL_1_1_0-stable has been updated
       via  2392eb77d237684a32b1290fc9e3d0e2f3b08554 (commit)
      from  4e07941373ac17086ab4e601950c4ca148e8bb31 (commit)


- Log -----------------------------------------------------------------
commit 2392eb77d237684a32b1290fc9e3d0e2f3b08554
Author: Bernd Edlinger <bernd.edlinger at hotmail.de>
Date:   Thu Mar 29 11:27:29 2018 +0200

    Fix a possible crash in BN_from_montgomery_word
    
    Thanks to Darovskikh Andrei for for reporting this issue.
    
    Fixes: #5785
    Fixes: #6302
    
    Cherry-picked from f91e026e3832 (without test/bntest.c)
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
    (Merged from https://github.com/openssl/openssl/pull/6310)

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

Summary of changes:
 crypto/bn/bn_mont.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c
index c0c1746..dad3d07 100644
--- a/crypto/bn/bn_mont.c
+++ b/crypto/bn/bn_mont.c
@@ -95,6 +95,8 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
 
     /* clear the top words of T */
     i = max - r->top;
+    if (i < 0)
+        return 0;
     if (i)
         memset(&rp[r->top], 0, sizeof(*rp) * i);
 


More information about the openssl-commits mailing list