[openssl-commits] [openssl] master update

Rich Salz rsalz at openssl.org
Thu Aug 4 18:27:17 UTC 2016


The branch master has been updated
       via  219116d8667cd208a92323a9b95a20e3c7e3f9eb (commit)
       via  412c8507ee61aeb1fcac4b6e84cd7e6501789124 (commit)
      from  20fc103f782bb0bcd41d211c6423187b02146b9d (commit)


- Log -----------------------------------------------------------------
commit 219116d8667cd208a92323a9b95a20e3c7e3f9eb
Author: Rich Salz <rsalz at openssl.org>
Date:   Wed Aug 3 15:24:57 2016 -0400

    Remove get_hash completely
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/1389)

commit 412c8507ee61aeb1fcac4b6e84cd7e6501789124
Author: Rich Salz <rsalz at openssl.org>
Date:   Wed Aug 3 15:15:20 2016 -0400

    Remove "lockit" from internal error-hash function
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/1389)

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

Summary of changes:
 apps/errstr.c         | 13 +------------
 crypto/err/err.c      | 48 +++++++++---------------------------------------
 include/openssl/err.h |  2 --
 util/libcrypto.num    |  1 -
 4 files changed, 10 insertions(+), 54 deletions(-)

diff --git a/apps/errstr.c b/apps/errstr.c
index ae7acf5..5fda799 100644
--- a/apps/errstr.c
+++ b/apps/errstr.c
@@ -17,16 +17,13 @@
 #include <openssl/ssl.h>
 
 typedef enum OPTION_choice {
-    OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
-    OPT_STATS
+    OPT_ERR = -1, OPT_EOF = 0, OPT_HELP
 } OPTION_CHOICE;
 
 OPTIONS errstr_options[] = {
     {OPT_HELP_STR, 1, '-', "Usage: %s [options] errnum...\n"},
     {OPT_HELP_STR, 1, '-', "  errnum  Error number\n"},
     {"help", OPT_HELP, '-', "Display this summary"},
-    {"stats", OPT_STATS, '-',
-     "Print internal hashtable statistics (long!)"},
     {NULL}
 };
 
@@ -48,14 +45,6 @@ int errstr_main(int argc, char **argv)
             opt_help(errstr_options);
             ret = 0;
             goto end;
-        case OPT_STATS:
-            lh_ERR_STRING_DATA_node_stats_bio(ERR_get_string_table(),
-                                              bio_out);
-            lh_ERR_STRING_DATA_stats_bio(ERR_get_string_table(), bio_out);
-            lh_ERR_STRING_DATA_node_usage_stats_bio(ERR_get_string_table(),
-                                                    bio_out);
-            ret = 0;
-            goto end;
         }
     }
 
diff --git a/crypto/err/err.c b/crypto/err/err.c
index dc721c2..584bb9e 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -125,8 +125,6 @@ static CRYPTO_THREAD_LOCAL err_thread_local;
 static CRYPTO_ONCE err_string_init = CRYPTO_ONCE_STATIC_INIT;
 static CRYPTO_RWLOCK *err_string_lock;
 
-/* Predeclarations of the "err_defaults" functions */
-static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit);
 static ERR_STRING_DATA *int_err_get_item(const ERR_STRING_DATA *);
 
 /*
@@ -155,33 +153,13 @@ static int err_string_data_cmp(const ERR_STRING_DATA *a,
     return (int)(a->error - b->error);
 }
 
-static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit)
-{
-    LHASH_OF(ERR_STRING_DATA) *ret = NULL;
-
-    if (lockit)
-        CRYPTO_THREAD_write_lock(err_string_lock);
-    if (!int_error_hash && create) {
-        int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
-                                                err_string_data_cmp);
-    }
-    if (int_error_hash != NULL)
-        ret = int_error_hash;
-    if (lockit)
-        CRYPTO_THREAD_unlock(err_string_lock);
-
-    return ret;
-}
-
 static ERR_STRING_DATA *int_err_get_item(const ERR_STRING_DATA *d)
 {
     ERR_STRING_DATA *p = NULL;
-    LHASH_OF(ERR_STRING_DATA) *hash;
 
     CRYPTO_THREAD_read_lock(err_string_lock);
-    hash = get_hash(0, 0);
-    if (hash)
-        p = lh_ERR_STRING_DATA_retrieve(hash, d);
+    if (int_error_hash != NULL)
+        p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
     CRYPTO_THREAD_unlock(err_string_lock);
 
     return p;
@@ -300,15 +278,15 @@ int ERR_load_ERR_strings(void)
 
 static void err_load_strings(int lib, ERR_STRING_DATA *str)
 {
-    LHASH_OF(ERR_STRING_DATA) *hash;
-
     CRYPTO_THREAD_write_lock(err_string_lock);
-    hash = get_hash(1, 0);
-    if (hash) {
+    if (int_error_hash == NULL)
+        int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
+                                                err_string_data_cmp);
+    if (int_error_hash != NULL) {
         for (; str->error; str++) {
             if (lib)
                 str->error |= ERR_PACK(lib, 0, 0);
-            (void)lh_ERR_STRING_DATA_insert(hash, str);
+            (void)lh_ERR_STRING_DATA_insert(int_error_hash, str);
         }
     }
     CRYPTO_THREAD_unlock(err_string_lock);
@@ -324,18 +302,15 @@ int ERR_load_strings(int lib, ERR_STRING_DATA *str)
 
 int ERR_unload_strings(int lib, ERR_STRING_DATA *str)
 {
-    LHASH_OF(ERR_STRING_DATA) *hash;
-
     if (!RUN_ONCE(&err_string_init, do_err_strings_init))
         return 0;
 
     CRYPTO_THREAD_write_lock(err_string_lock);
-    hash = get_hash(0, 0);
-    if (hash) {
+    if (int_error_hash != NULL) {
         for (; str->error; str++) {
             if (lib)
                 str->error |= ERR_PACK(lib, 0, 0);
-            (void)lh_ERR_STRING_DATA_delete(hash, str);
+            (void)lh_ERR_STRING_DATA_delete(int_error_hash, str);
         }
     }
     CRYPTO_THREAD_unlock(err_string_lock);
@@ -582,11 +557,6 @@ char *ERR_error_string(unsigned long e, char *ret)
     return ret;
 }
 
-LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void)
-{
-    return get_hash(0, 1);
-}
-
 const char *ERR_lib_error_string(unsigned long e)
 {
     ERR_STRING_DATA d, *p;
diff --git a/include/openssl/err.h b/include/openssl/err.h
index d98c9cd..fdffd66 100644
--- a/include/openssl/err.h
+++ b/include/openssl/err.h
@@ -245,8 +245,6 @@ DEPRECATEDIN_1_1_0(void ERR_remove_thread_state(void *))
 DEPRECATEDIN_1_0_0(void ERR_remove_state(unsigned long pid))
 ERR_STATE *ERR_get_state(void);
 
-LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void);
-
 int ERR_get_next_error_library(void);
 
 int ERR_set_mark(void);
diff --git a/util/libcrypto.num b/util/libcrypto.num
index 0954a48..e4c16b1 100644
--- a/util/libcrypto.num
+++ b/util/libcrypto.num
@@ -1800,7 +1800,6 @@ EVP_PKEY_meth_get_verify_recover        1785	1_1_0	EXIST::FUNCTION:
 NAME_CONSTRAINTS_check                  1786	1_1_0	EXIST::FUNCTION:
 X509_CERT_AUX_it                        1787	1_1_0	EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE:
 X509_CERT_AUX_it                        1787	1_1_0	EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:
-ERR_get_string_table                    1788	1_1_0	EXIST::FUNCTION:
 X509_get_X509_PUBKEY                    1789	1_1_0	EXIST::FUNCTION:
 TXT_DB_create_index                     1790	1_1_0	EXIST::FUNCTION:
 RAND_set_rand_engine                    1791	1_1_0	EXIST::FUNCTION:ENGINE


More information about the openssl-commits mailing list