[openssl-commits] [openssl] master update

Dr. Stephen Henson steve at openssl.org
Wed Apr 13 14:44:45 UTC 2016


The branch master has been updated
       via  37d0764d5bead83318badbdb7c357f59e7894897 (commit)
       via  a535fe12f625f30e5e6b27d588403fe25a3ffcf3 (commit)
      from  7e74eaa661e05f27a503b3ff3fecc8c94e9e781e (commit)


- Log -----------------------------------------------------------------
commit 37d0764d5bead83318badbdb7c357f59e7894897
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Wed Apr 13 15:08:27 2016 +0100

    make update
    
    Reviewed-by: Matt Caswell <matt at openssl.org>

commit a535fe12f625f30e5e6b27d588403fe25a3ffcf3
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Wed Apr 13 12:11:59 2016 +0100

    Remove check_defer()
    
    The check_defer() function was used to ensure that EVP_cleanup() was always
    called before OBJ_cleanup(). The new cleanup code ensures this so it is
    no longer needed.
    
    Remove obj_cleanup() call in OID config module: it is not needed
    any more either.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>

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

Summary of changes:
 crypto/asn1/asn_moid.c    |  1 -
 crypto/evp/names.c        |  7 -------
 crypto/init.c             |  4 +++-
 crypto/objects/obj_dat.c  | 16 ----------------
 include/openssl/objects.h |  3 ---
 util/libcrypto.num        |  2 +-
 6 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/crypto/asn1/asn_moid.c b/crypto/asn1/asn_moid.c
index bebf82a..a5c8601 100644
--- a/crypto/asn1/asn_moid.c
+++ b/crypto/asn1/asn_moid.c
@@ -93,7 +93,6 @@ static int oid_module_init(CONF_IMODULE *md, const CONF *cnf)
 
 static void oid_module_finish(CONF_IMODULE *md)
 {
-    obj_cleanup_int();
 }
 
 void ASN1_add_oid_module(void)
diff --git a/crypto/evp/names.c b/crypto/evp/names.c
index 501bfee..2e8281a 100644
--- a/crypto/evp/names.c
+++ b/crypto/evp/names.c
@@ -73,7 +73,6 @@ int EVP_add_cipher(const EVP_CIPHER *c)
                      (const char *)c);
     if (r == 0)
         return (0);
-    check_defer(c->nid);
     r = OBJ_NAME_add(OBJ_nid2ln(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
                      (const char *)c);
     return (r);
@@ -88,7 +87,6 @@ int EVP_add_digest(const EVP_MD *md)
     r = OBJ_NAME_add(name, OBJ_NAME_TYPE_MD_METH, (const char *)md);
     if (r == 0)
         return (0);
-    check_defer(md->type);
     r = OBJ_NAME_add(OBJ_nid2ln(md->type), OBJ_NAME_TYPE_MD_METH,
                      (const char *)md);
     if (r == 0)
@@ -99,7 +97,6 @@ int EVP_add_digest(const EVP_MD *md)
                          OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
         if (r == 0)
             return (0);
-        check_defer(md->pkey_type);
         r = OBJ_NAME_add(OBJ_nid2ln(md->pkey_type),
                          OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
     }
@@ -140,10 +137,6 @@ void evp_cleanup_int(void)
     OBJ_NAME_cleanup(-1);
 
     EVP_PBE_cleanup();
-    if (obj_cleanup_defer == 2) {
-        obj_cleanup_defer = 0;
-        obj_cleanup_int();
-    }
     OBJ_sigid_free();
 }
 
diff --git a/crypto/init.c b/crypto/init.c
index 21dc36d..f44e3a8 100644
--- a/crypto/init.c
+++ b/crypto/init.c
@@ -474,12 +474,14 @@ void OPENSSL_cleanup(void)
 #endif
     /*
      * Note that cleanup order is important:
-     * - rand_cleanup_int could call an ENINGE's RAND cleanup function so
+     * - rand_cleanup_int could call an ENGINE's RAND cleanup function so
      * must be called before engine_cleanup_int()
      * - ENGINEs use CRYPTO_EX_DATA and therefore, must be cleaned up
      * before the ex data handlers are wiped in CRYPTO_cleanup_all_ex_data().
      * - conf_modules_free_int() can end up in ENGINE code so must be called
      * before engine_cleanup_int()
+     * - ENGINEs and additional EVP algorithms might use added OIDs names so
+     * obj_cleanup_int() must be called last
      */
     rand_cleanup_int();
     conf_modules_free_int();
diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c
index 24e684a..6baf2f0 100644
--- a/crypto/objects/obj_dat.c
+++ b/crypto/objects/obj_dat.c
@@ -198,24 +198,8 @@ static void cleanup3_doall(ADDED_OBJ *a)
     OPENSSL_free(a);
 }
 
-/*
- * The purpose of obj_cleanup_defer is to avoid int_evp_cleanup() attempting
- * to use freed up OIDs. If necessary the actual freeing up of OIDs is delayed.
- */
-int obj_cleanup_defer = 0;
-
-void check_defer(int nid)
-{
-    if (!obj_cleanup_defer && nid >= NUM_NID)
-        obj_cleanup_defer = 1;
-}
-
 void obj_cleanup_int(void)
 {
-    if (obj_cleanup_defer) {
-        obj_cleanup_defer = 2;
-        return;
-    }
     if (added == NULL)
         return;
     lh_ADDED_OBJ_set_down_load(added, 0);
diff --git a/include/openssl/objects.h b/include/openssl/objects.h
index 79e1d3d..f8c2f05 100644
--- a/include/openssl/objects.h
+++ b/include/openssl/objects.h
@@ -1116,9 +1116,6 @@ int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid);
 int OBJ_add_sigid(int signid, int dig_id, int pkey_id);
 void OBJ_sigid_free(void);
 
-extern int obj_cleanup_defer;
-void check_defer(int nid);
-
 /* BEGIN ERROR CODES */
 /*
  * The following lines are auto generated by the script mkerr.pl. Any changes
diff --git a/util/libcrypto.num b/util/libcrypto.num
index ded56ee..2bdfeb6 100644
--- a/util/libcrypto.num
+++ b/util/libcrypto.num
@@ -2955,7 +2955,7 @@ PEM_write_bio_PrivateKey                2855	1_1_0	EXIST::FUNCTION:
 ASN1_UTCTIME_check                      2856	1_1_0	EXIST::FUNCTION:
 ACCESS_DESCRIPTION_it                   2857	1_1_0	EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE:
 ACCESS_DESCRIPTION_it                   2857	1_1_0	EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:
-check_defer                             2858	1_1_0	EXIST::FUNCTION:
+check_defer                             2858	1_1_0	NOEXIST::FUNCTION:
 TS_MSG_IMPRINT_get_msg                  2859	1_1_0	EXIST::FUNCTION:TS
 PKCS8_add_keyusage                      2860	1_1_0	EXIST::FUNCTION:
 X509_EXTENSION_dup                      2861	1_1_0	EXIST::FUNCTION:


More information about the openssl-commits mailing list