[openssl] master update

Dr. Paul Dale pauli at openssl.org
Thu Dec 23 01:53:07 UTC 2021


The branch master has been updated
       via  7c78bd4be810ddceb8f13585a921946cc98f5fbd (commit)
      from  a595e3286ae9f033c56452967b3add2145f9085f (commit)


- Log -----------------------------------------------------------------
commit 7c78bd4be810ddceb8f13585a921946cc98f5fbd
Author: Kan <chenxinpingc2306 at 163.com>
Date:   Fri Dec 17 00:35:32 2021 +0800

    Add static check in BN_hex2bn
    
    Fixes #17298
    
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17299)

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

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

diff --git a/crypto/bn/bn_conv.c b/crypto/bn/bn_conv.c
index 6757f3d0aa..75054f5d6a 100644
--- a/crypto/bn/bn_conv.c
+++ b/crypto/bn/bn_conv.c
@@ -154,6 +154,10 @@ int BN_hex2bn(BIGNUM **bn, const char *a)
             return 0;
     } else {
         ret = *bn;
+        if (BN_get_flags(ret, BN_FLG_STATIC_DATA)) {
+            ERR_raise(ERR_LIB_BN, ERR_R_PASSED_INVALID_ARGUMENT);
+            return 0;
+        }
         BN_zero(ret);
     }
 


More information about the openssl-commits mailing list