Check for errors allocating the error strings. Reviewed-by: Richard Levitte <levitte@openssl.org> GH: #1330
diff --git a/crypto/asn1/asn1_err.c b/crypto/asn1/asn1_err.c index a363fdb..97c3dec 100644 --- a/crypto/asn1/asn1_err.c +++ b/crypto/asn1/asn1_err.c
@@ -32,6 +32,7 @@ {ERR_FUNC(ASN1_F_ASN1_D2I_READ_BIO), "asn1_d2i_read_bio"}, {ERR_FUNC(ASN1_F_ASN1_DIGEST), "ASN1_digest"}, {ERR_FUNC(ASN1_F_ASN1_DO_ADB), "asn1_do_adb"}, + {ERR_FUNC(ASN1_F_ASN1_DO_LOCK), "asn1_do_lock"}, {ERR_FUNC(ASN1_F_ASN1_DUP), "ASN1_dup"}, {ERR_FUNC(ASN1_F_ASN1_EX_C2I), "asn1_ex_c2i"}, {ERR_FUNC(ASN1_F_ASN1_FIND_END), "asn1_find_end"}, @@ -253,7 +254,7 @@ #endif -void ERR_load_ASN1_strings(void) +int ERR_load_ASN1_strings(void) { #ifndef OPENSSL_NO_ERR @@ -262,4 +263,5 @@ ERR_load_strings(0, ASN1_str_reasons); } #endif + return 1; }
diff --git a/crypto/async/async_err.c b/crypto/async/async_err.c index 13c41cd..ae97e96 100644 --- a/crypto/async/async_err.c +++ b/crypto/async/async_err.c
@@ -38,7 +38,7 @@ #endif -void ERR_load_ASYNC_strings(void) +int ERR_load_ASYNC_strings(void) { #ifndef OPENSSL_NO_ERR @@ -47,4 +47,5 @@ ERR_load_strings(0, ASYNC_str_reasons); } #endif + return 1; }
diff --git a/crypto/bio/bio_err.c b/crypto/bio/bio_err.c index 7553182..d032ded 100644 --- a/crypto/bio/bio_err.c +++ b/crypto/bio/bio_err.c
@@ -112,7 +112,7 @@ #endif -void ERR_load_BIO_strings(void) +int ERR_load_BIO_strings(void) { #ifndef OPENSSL_NO_ERR @@ -121,4 +121,5 @@ ERR_load_strings(0, BIO_str_reasons); } #endif + return 1; }
diff --git a/crypto/bn/bn_err.c b/crypto/bn/bn_err.c index a71b265..5fe9db9 100644 --- a/crypto/bn/bn_err.c +++ b/crypto/bn/bn_err.c
@@ -94,7 +94,7 @@ #endif -void ERR_load_BN_strings(void) +int ERR_load_BN_strings(void) { #ifndef OPENSSL_NO_ERR @@ -103,4 +103,5 @@ ERR_load_strings(0, BN_str_reasons); } #endif + return 1; }
diff --git a/crypto/buffer/buf_err.c b/crypto/buffer/buf_err.c index b7679ae..a6a2ab8 100644 --- a/crypto/buffer/buf_err.c +++ b/crypto/buffer/buf_err.c
@@ -31,7 +31,7 @@ #endif -void ERR_load_BUF_strings(void) +int ERR_load_BUF_strings(void) { #ifndef OPENSSL_NO_ERR @@ -40,4 +40,5 @@ ERR_load_strings(0, BUF_str_reasons); } #endif + return 1; }
diff --git a/crypto/cms/cms_err.c b/crypto/cms/cms_err.c index cfda019..c6df1b5 100644 --- a/crypto/cms/cms_err.c +++ b/crypto/cms/cms_err.c
@@ -245,7 +245,7 @@ #endif -void ERR_load_CMS_strings(void) +int ERR_load_CMS_strings(void) { #ifndef OPENSSL_NO_ERR @@ -254,4 +254,5 @@ ERR_load_strings(0, CMS_str_reasons); } #endif + return 1; }
diff --git a/crypto/comp/comp_err.c b/crypto/comp/comp_err.c index 0233e94..8e2e695 100644 --- a/crypto/comp/comp_err.c +++ b/crypto/comp/comp_err.c
@@ -35,7 +35,7 @@ #endif -void ERR_load_COMP_strings(void) +int ERR_load_COMP_strings(void) { #ifndef OPENSSL_NO_ERR @@ -44,4 +44,5 @@ ERR_load_strings(0, COMP_str_reasons); } #endif + return 1; }
diff --git a/crypto/conf/conf_err.c b/crypto/conf/conf_err.c index 31bb15c..b583c05 100644 --- a/crypto/conf/conf_err.c +++ b/crypto/conf/conf_err.c
@@ -66,7 +66,7 @@ #endif -void ERR_load_CONF_strings(void) +int ERR_load_CONF_strings(void) { #ifndef OPENSSL_NO_ERR @@ -75,4 +75,5 @@ ERR_load_strings(0, CONF_str_reasons); } #endif + return 1; }
diff --git a/crypto/cpt_err.c b/crypto/cpt_err.c index 3c6e8d5..c28dcf1 100644 --- a/crypto/cpt_err.c +++ b/crypto/cpt_err.c
@@ -42,7 +42,7 @@ #endif -void ERR_load_CRYPTO_strings(void) +int ERR_load_CRYPTO_strings(void) { #ifndef OPENSSL_NO_ERR @@ -51,4 +51,5 @@ ERR_load_strings(0, CRYPTO_str_reasons); } #endif + return 1; }
diff --git a/crypto/ct/ct_err.c b/crypto/ct/ct_err.c index 8581dbb..dbf0bd2 100644 --- a/crypto/ct/ct_err.c +++ b/crypto/ct/ct_err.c
@@ -25,6 +25,8 @@ {ERR_FUNC(CT_F_CTLOG_NEW_NULL), "CTLOG_new_null"}, {ERR_FUNC(CT_F_CTLOG_STORE_LOAD_CTX_NEW), "ctlog_store_load_ctx_new"}, {ERR_FUNC(CT_F_CTLOG_STORE_LOAD_FILE), "CTLOG_STORE_load_file"}, + {ERR_FUNC(CT_F_CTLOG_STORE_LOAD_LOG), "ctlog_store_load_log"}, + {ERR_FUNC(CT_F_CTLOG_STORE_NEW), "CTLOG_STORE_new"}, {ERR_FUNC(CT_F_CT_BASE64_DECODE), "ct_base64_decode"}, {ERR_FUNC(CT_F_CT_POLICY_EVAL_CTX_NEW), "CT_POLICY_EVAL_CTX_new"}, {ERR_FUNC(CT_F_CT_V1_LOG_ID_FROM_PKEY), "ct_v1_log_id_from_pkey"}, @@ -73,7 +75,7 @@ #endif -void ERR_load_CT_strings(void) +int ERR_load_CT_strings(void) { #ifndef OPENSSL_NO_ERR @@ -82,4 +84,5 @@ ERR_load_strings(0, CT_str_reasons); } #endif + return 1; }
diff --git a/crypto/dh/dh_err.c b/crypto/dh/dh_err.c index a5348b1..4e21f28 100644 --- a/crypto/dh/dh_err.c +++ b/crypto/dh/dh_err.c
@@ -60,7 +60,7 @@ #endif -void ERR_load_DH_strings(void) +int ERR_load_DH_strings(void) { #ifndef OPENSSL_NO_ERR @@ -69,4 +69,5 @@ ERR_load_strings(0, DH_str_reasons); } #endif + return 1; }
diff --git a/crypto/dsa/dsa_err.c b/crypto/dsa/dsa_err.c index 028f79f..6de49ee 100644 --- a/crypto/dsa/dsa_err.c +++ b/crypto/dsa/dsa_err.c
@@ -61,7 +61,7 @@ #endif -void ERR_load_DSA_strings(void) +int ERR_load_DSA_strings(void) { #ifndef OPENSSL_NO_ERR @@ -70,4 +70,5 @@ ERR_load_strings(0, DSA_str_reasons); } #endif + return 1; }
diff --git a/crypto/dso/dso_err.c b/crypto/dso/dso_err.c index 870c80b..a180580 100644 --- a/crypto/dso/dso_err.c +++ b/crypto/dso/dso_err.c
@@ -78,7 +78,7 @@ #endif -void ERR_load_DSO_strings(void) +int ERR_load_DSO_strings(void) { #ifndef OPENSSL_NO_ERR @@ -87,4 +87,5 @@ ERR_load_strings(0, DSO_str_reasons); } #endif + return 1; }
diff --git a/crypto/ec/ec_err.c b/crypto/ec/ec_err.c index 25dea23..39e8343 100644 --- a/crypto/ec/ec_err.c +++ b/crypto/ec/ec_err.c
@@ -271,7 +271,7 @@ #endif -void ERR_load_EC_strings(void) +int ERR_load_EC_strings(void) { #ifndef OPENSSL_NO_ERR @@ -280,4 +280,5 @@ ERR_load_strings(0, EC_str_reasons); } #endif + return 1; }
diff --git a/crypto/engine/eng_err.c b/crypto/engine/eng_err.c index 5eb8771..5e9d16f 100644 --- a/crypto/engine/eng_err.c +++ b/crypto/engine/eng_err.c
@@ -110,7 +110,7 @@ #endif -void ERR_load_ENGINE_strings(void) +int ERR_load_ENGINE_strings(void) { #ifndef OPENSSL_NO_ERR @@ -119,4 +119,5 @@ ERR_load_strings(0, ENGINE_str_reasons); } #endif + return 1; }
diff --git a/crypto/err/err.c b/crypto/err/err.c index ad1ccd1..dc721c2 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c
@@ -283,10 +283,11 @@ err_string_lock = NULL; } -void ERR_load_ERR_strings(void) +int ERR_load_ERR_strings(void) { #ifndef OPENSSL_NO_ERR - RUN_ONCE(&err_string_init, do_err_strings_init); + if (!RUN_ONCE(&err_string_init, do_err_strings_init)) + return 0; err_load_strings(0, ERR_str_libraries); err_load_strings(0, ERR_str_reasons); @@ -294,6 +295,7 @@ build_SYS_str_reasons(); err_load_strings(ERR_LIB_SYS, SYS_str_reasons); #endif + return 1; } static void err_load_strings(int lib, ERR_STRING_DATA *str) @@ -312,10 +314,12 @@ CRYPTO_THREAD_unlock(err_string_lock); } -void ERR_load_strings(int lib, ERR_STRING_DATA *str) +int ERR_load_strings(int lib, ERR_STRING_DATA *str) { - ERR_load_ERR_strings(); + if (ERR_load_ERR_strings() == 0) + return 0; err_load_strings(lib, str); + return 1; } int ERR_unload_strings(int lib, ERR_STRING_DATA *str)
diff --git a/crypto/err/err_all.c b/crypto/err/err_all.c index f617dd1..3b1304f 100644 --- a/crypto/err/err_all.c +++ b/crypto/err/err_all.c
@@ -40,66 +40,70 @@ #include <openssl/async.h> #include <openssl/kdf.h> -void err_load_crypto_strings_int(void) +int err_load_crypto_strings_int(void) { + if ( #ifdef OPENSSL_FIPS - FIPS_set_error_callbacks(ERR_put_error, ERR_add_error_vdata); + FIPS_set_error_callbacks(ERR_put_error, ERR_add_error_vdata) == 0 || #endif #ifndef OPENSSL_NO_ERR - ERR_load_ERR_strings(); /* include error strings for SYSerr */ - ERR_load_BN_strings(); + ERR_load_ERR_strings() == 0 || /* include error strings for SYSerr */ + ERR_load_BN_strings() == 0 || # ifndef OPENSSL_NO_RSA - ERR_load_RSA_strings(); + ERR_load_RSA_strings() == 0 || # endif # ifndef OPENSSL_NO_DH - ERR_load_DH_strings(); + ERR_load_DH_strings() == 0 || # endif - ERR_load_EVP_strings(); - ERR_load_BUF_strings(); - ERR_load_OBJ_strings(); - ERR_load_PEM_strings(); + ERR_load_EVP_strings() == 0 || + ERR_load_BUF_strings() == 0 || + ERR_load_OBJ_strings() == 0 || + ERR_load_PEM_strings() == 0 || # ifndef OPENSSL_NO_DSA - ERR_load_DSA_strings(); + ERR_load_DSA_strings() == 0 || # endif - ERR_load_X509_strings(); - ERR_load_ASN1_strings(); - ERR_load_CONF_strings(); - ERR_load_CRYPTO_strings(); + ERR_load_X509_strings() == 0 || + ERR_load_ASN1_strings() == 0 || + ERR_load_CONF_strings() == 0 || + ERR_load_CRYPTO_strings() == 0 || # ifndef OPENSSL_NO_COMP - ERR_load_COMP_strings(); + ERR_load_COMP_strings() == 0 || # endif # ifndef OPENSSL_NO_EC - ERR_load_EC_strings(); + ERR_load_EC_strings() == 0 || # endif - /* skip ERR_load_SSL_strings() because it is not in this library */ - ERR_load_BIO_strings(); - ERR_load_PKCS7_strings(); - ERR_load_X509V3_strings(); - ERR_load_PKCS12_strings(); - ERR_load_RAND_strings(); - ERR_load_DSO_strings(); + /* skip ERR_load_SSL_strings() because it is not in this library */ + ERR_load_BIO_strings() == 0 || + ERR_load_PKCS7_strings() == 0 || + ERR_load_X509V3_strings() == 0 || + ERR_load_PKCS12_strings() == 0 || + ERR_load_RAND_strings() == 0 || + ERR_load_DSO_strings() == 0 || # ifndef OPENSSL_NO_TS - ERR_load_TS_strings(); + ERR_load_TS_strings() == 0 || # endif # ifndef OPENSSL_NO_ENGINE - ERR_load_ENGINE_strings(); + ERR_load_ENGINE_strings() == 0 || # endif # ifndef OPENSSL_NO_OCSP - ERR_load_OCSP_strings(); + ERR_load_OCSP_strings() == 0 || # endif #ifndef OPENSSL_NO_UI - ERR_load_UI_strings(); + ERR_load_UI_strings() == 0 || #endif # ifdef OPENSSL_FIPS - ERR_load_FIPS_strings(); + ERR_load_FIPS_strings() == 0 || # endif # ifndef OPENSSL_NO_CMS - ERR_load_CMS_strings(); + ERR_load_CMS_strings() == 0 || # endif # ifndef OPENSSL_NO_CT - ERR_load_CT_strings(); + ERR_load_CT_strings() == 0 || # endif - ERR_load_ASYNC_strings(); + ERR_load_ASYNC_strings() == 0 || #endif - ERR_load_KDF_strings(); + ERR_load_KDF_strings() == 0) + return 0; + + return 1; }
diff --git a/crypto/evp/evp_err.c b/crypto/evp/evp_err.c index 50277ff..bde5e31 100644 --- a/crypto/evp/evp_err.c +++ b/crypto/evp/evp_err.c
@@ -57,10 +57,10 @@ {ERR_FUNC(EVP_F_EVP_PKEY_ENCRYPT), "EVP_PKEY_encrypt"}, {ERR_FUNC(EVP_F_EVP_PKEY_ENCRYPT_INIT), "EVP_PKEY_encrypt_init"}, {ERR_FUNC(EVP_F_EVP_PKEY_ENCRYPT_OLD), "EVP_PKEY_encrypt_old"}, - {ERR_FUNC(EVP_F_EVP_PKEY_GET0_HMAC), "EVP_PKEY_get0_hmac"}, {ERR_FUNC(EVP_F_EVP_PKEY_GET0_DH), "EVP_PKEY_get0_DH"}, {ERR_FUNC(EVP_F_EVP_PKEY_GET0_DSA), "EVP_PKEY_get0_DSA"}, {ERR_FUNC(EVP_F_EVP_PKEY_GET0_EC_KEY), "EVP_PKEY_get0_EC_KEY"}, + {ERR_FUNC(EVP_F_EVP_PKEY_GET0_HMAC), "EVP_PKEY_get0_hmac"}, {ERR_FUNC(EVP_F_EVP_PKEY_GET0_RSA), "EVP_PKEY_get0_RSA"}, {ERR_FUNC(EVP_F_EVP_PKEY_KEYGEN), "EVP_PKEY_keygen"}, {ERR_FUNC(EVP_F_EVP_PKEY_KEYGEN_INIT), "EVP_PKEY_keygen_init"}, @@ -159,7 +159,7 @@ #endif -void ERR_load_EVP_strings(void) +int ERR_load_EVP_strings(void) { #ifndef OPENSSL_NO_ERR @@ -168,4 +168,5 @@ ERR_load_strings(0, EVP_str_reasons); } #endif + return 1; }
diff --git a/crypto/include/internal/err_int.h b/crypto/include/internal/err_int.h index 749a8db..7fec3ed 100644 --- a/crypto/include/internal/err_int.h +++ b/crypto/include/internal/err_int.h
@@ -10,7 +10,7 @@ #ifndef INTERNAL_ERR_INT_H # define INTERNAL_ERR_INT_H -void err_load_crypto_strings_int(void); +int err_load_crypto_strings_int(void); void err_cleanup(void); void err_delete_thread_state(void);
diff --git a/crypto/init.c b/crypto/init.c index ace11da..332567e 100644 --- a/crypto/init.c +++ b/crypto/init.c
@@ -92,6 +92,7 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_load_crypto_strings) { + int ret = 1; /* * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time * pulling in all the error strings during static linking @@ -101,10 +102,10 @@ fprintf(stderr, "OPENSSL_INIT: ossl_init_load_crypto_strings: " "err_load_crypto_strings_int()\n"); # endif - err_load_crypto_strings_int(); + ret = err_load_crypto_strings_int(); #endif load_crypto_strings_inited = 1; - return 1; + return ret; } static CRYPTO_ONCE add_all_ciphers = CRYPTO_ONCE_STATIC_INIT;
diff --git a/crypto/kdf/kdf_err.c b/crypto/kdf/kdf_err.c index 6707a52..d7d71b3 100644 --- a/crypto/kdf/kdf_err.c +++ b/crypto/kdf/kdf_err.c
@@ -33,7 +33,7 @@ #endif -void ERR_load_KDF_strings(void) +int ERR_load_KDF_strings(void) { #ifndef OPENSSL_NO_ERR @@ -42,4 +42,5 @@ ERR_load_strings(0, KDF_str_reasons); } #endif + return 1; }
diff --git a/crypto/objects/obj_err.c b/crypto/objects/obj_err.c index 2dd80be..4677b67 100644 --- a/crypto/objects/obj_err.c +++ b/crypto/objects/obj_err.c
@@ -37,7 +37,7 @@ #endif -void ERR_load_OBJ_strings(void) +int ERR_load_OBJ_strings(void) { #ifndef OPENSSL_NO_ERR @@ -46,4 +46,5 @@ ERR_load_strings(0, OBJ_str_reasons); } #endif + return 1; }
diff --git a/crypto/ocsp/ocsp_err.c b/crypto/ocsp/ocsp_err.c index 59bcf85..a2d96e9 100644 --- a/crypto/ocsp/ocsp_err.c +++ b/crypto/ocsp/ocsp_err.c
@@ -78,7 +78,7 @@ #endif -void ERR_load_OCSP_strings(void) +int ERR_load_OCSP_strings(void) { #ifndef OPENSSL_NO_ERR @@ -87,4 +87,5 @@ ERR_load_strings(0, OCSP_str_reasons); } #endif + return 1; }
diff --git a/crypto/pem/pem_err.c b/crypto/pem/pem_err.c index 7a42535..f36d893 100644 --- a/crypto/pem/pem_err.c +++ b/crypto/pem/pem_err.c
@@ -102,7 +102,7 @@ #endif -void ERR_load_PEM_strings(void) +int ERR_load_PEM_strings(void) { #ifndef OPENSSL_NO_ERR @@ -111,4 +111,5 @@ ERR_load_strings(0, PEM_str_reasons); } #endif + return 1; }
diff --git a/crypto/pkcs12/pk12err.c b/crypto/pkcs12/pk12err.c index 36053f1..f15a695 100644 --- a/crypto/pkcs12/pk12err.c +++ b/crypto/pkcs12/pk12err.c
@@ -81,7 +81,7 @@ #endif -void ERR_load_PKCS12_strings(void) +int ERR_load_PKCS12_strings(void) { #ifndef OPENSSL_NO_ERR @@ -90,4 +90,5 @@ ERR_load_strings(0, PKCS12_str_reasons); } #endif + return 1; }
diff --git a/crypto/pkcs7/pkcs7err.c b/crypto/pkcs7/pkcs7err.c index bcb479d..d5baa9b 100644 --- a/crypto/pkcs7/pkcs7err.c +++ b/crypto/pkcs7/pkcs7err.c
@@ -118,7 +118,7 @@ #endif -void ERR_load_PKCS7_strings(void) +int ERR_load_PKCS7_strings(void) { #ifndef OPENSSL_NO_ERR @@ -127,4 +127,5 @@ ERR_load_strings(0, PKCS7_str_reasons); } #endif + return 1; }
diff --git a/crypto/rand/rand_err.c b/crypto/rand/rand_err.c index c58e7ee..5543126 100644 --- a/crypto/rand/rand_err.c +++ b/crypto/rand/rand_err.c
@@ -30,7 +30,7 @@ #endif -void ERR_load_RAND_strings(void) +int ERR_load_RAND_strings(void) { #ifndef OPENSSL_NO_ERR @@ -39,4 +39,5 @@ ERR_load_strings(0, RAND_str_reasons); } #endif + return 1; }
diff --git a/crypto/rsa/rsa_err.c b/crypto/rsa/rsa_err.c index 0bde045..210709e 100644 --- a/crypto/rsa/rsa_err.c +++ b/crypto/rsa/rsa_err.c
@@ -170,7 +170,7 @@ #endif -void ERR_load_RSA_strings(void) +int ERR_load_RSA_strings(void) { #ifndef OPENSSL_NO_ERR @@ -179,4 +179,5 @@ ERR_load_strings(0, RSA_str_reasons); } #endif + return 1; }
diff --git a/crypto/ts/ts_err.c b/crypto/ts/ts_err.c index 08217f7..a6d73a1 100644 --- a/crypto/ts/ts_err.c +++ b/crypto/ts/ts_err.c
@@ -131,7 +131,7 @@ #endif -void ERR_load_TS_strings(void) +int ERR_load_TS_strings(void) { #ifndef OPENSSL_NO_ERR @@ -140,4 +140,5 @@ ERR_load_strings(0, TS_str_reasons); } #endif + return 1; }
diff --git a/crypto/ui/ui_err.c b/crypto/ui/ui_err.c index 03cd2bc..ef03815 100644 --- a/crypto/ui/ui_err.c +++ b/crypto/ui/ui_err.c
@@ -48,7 +48,7 @@ #endif -void ERR_load_UI_strings(void) +int ERR_load_UI_strings(void) { #ifndef OPENSSL_NO_ERR @@ -57,4 +57,5 @@ ERR_load_strings(0, UI_str_reasons); } #endif + return 1; }
diff --git a/crypto/x509/x509_err.c b/crypto/x509/x509_err.c index 13f5a24..3f4b8ef 100644 --- a/crypto/x509/x509_err.c +++ b/crypto/x509/x509_err.c
@@ -129,7 +129,7 @@ #endif -void ERR_load_X509_strings(void) +int ERR_load_X509_strings(void) { #ifndef OPENSSL_NO_ERR @@ -138,4 +138,5 @@ ERR_load_strings(0, X509_str_reasons); } #endif + return 1; }
diff --git a/crypto/x509v3/v3err.c b/crypto/x509v3/v3err.c index 1f838bc..5d79c8c 100644 --- a/crypto/x509v3/v3err.c +++ b/crypto/x509v3/v3err.c
@@ -174,7 +174,7 @@ #endif -void ERR_load_X509V3_strings(void) +int ERR_load_X509V3_strings(void) { #ifndef OPENSSL_NO_ERR @@ -183,4 +183,5 @@ ERR_load_strings(0, X509V3_str_reasons); } #endif + return 1; }
diff --git a/include/internal/dso.h b/include/internal/dso.h index d371fbe..970beeb 100644 --- a/include/internal/dso.h +++ b/include/internal/dso.h
@@ -153,7 +153,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_DSO_strings(void); +int ERR_load_DSO_strings(void); /* Error codes for the DSO functions. */
diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h index 6994abf..e313109 100644 --- a/include/openssl/asn1.h +++ b/include/openssl/asn1.h
@@ -875,7 +875,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_ASN1_strings(void); +int ERR_load_ASN1_strings(void); /* Error codes for the ASN1 functions. */
diff --git a/include/openssl/async.h b/include/openssl/async.h index ca51bb3..5b2e496 100644 --- a/include/openssl/async.h +++ b/include/openssl/async.h
@@ -74,7 +74,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_ASYNC_strings(void); +int ERR_load_ASYNC_strings(void); /* Error codes for the ASYNC functions. */
diff --git a/include/openssl/bio.h b/include/openssl/bio.h index d486d07..ed50139 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h
@@ -763,7 +763,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_BIO_strings(void); +int ERR_load_BIO_strings(void); /* Error codes for the BIO functions. */
diff --git a/include/openssl/bn.h b/include/openssl/bn.h index c4fca99..1e3c24a 100644 --- a/include/openssl/bn.h +++ b/include/openssl/bn.h
@@ -488,7 +488,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_BN_strings(void); +int ERR_load_BN_strings(void); /* Error codes for the BN functions. */
diff --git a/include/openssl/buffer.h b/include/openssl/buffer.h index e2e1e5d..91f0e07 100644 --- a/include/openssl/buffer.h +++ b/include/openssl/buffer.h
@@ -59,7 +59,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_BUF_strings(void); +int ERR_load_BUF_strings(void); /* Error codes for the BUF functions. */
diff --git a/include/openssl/cms.h b/include/openssl/cms.h index b1252ac..dbc27e5 100644 --- a/include/openssl/cms.h +++ b/include/openssl/cms.h
@@ -335,7 +335,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_CMS_strings(void); +int ERR_load_CMS_strings(void); /* Error codes for the CMS functions. */
diff --git a/include/openssl/comp.h b/include/openssl/comp.h index 520d709..260ff1e 100644 --- a/include/openssl/comp.h +++ b/include/openssl/comp.h
@@ -50,7 +50,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_COMP_strings(void); +int ERR_load_COMP_strings(void); /* Error codes for the COMP functions. */
diff --git a/include/openssl/conf.h b/include/openssl/conf.h index 147d27b..462e3c9 100644 --- a/include/openssl/conf.h +++ b/include/openssl/conf.h
@@ -168,7 +168,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_CONF_strings(void); +int ERR_load_CONF_strings(void); /* Error codes for the CONF functions. */
diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h index cbd05a8..18b9c1b 100644 --- a/include/openssl/crypto.h +++ b/include/openssl/crypto.h
@@ -436,7 +436,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_CRYPTO_strings(void); +int ERR_load_CRYPTO_strings(void); /* Error codes for the CRYPTO functions. */
diff --git a/include/openssl/ct.h b/include/openssl/ct.h index be7a953..3b011cc 100644 --- a/include/openssl/ct.h +++ b/include/openssl/ct.h
@@ -481,7 +481,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_CT_strings(void); +int ERR_load_CT_strings(void); /* Error codes for the CT functions. */
diff --git a/include/openssl/dh.h b/include/openssl/dh.h index a574e18..ae309e7 100644 --- a/include/openssl/dh.h +++ b/include/openssl/dh.h
@@ -296,7 +296,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_DH_strings(void); +int ERR_load_DH_strings(void); /* Error codes for the DH functions. */
diff --git a/include/openssl/dsa.h b/include/openssl/dsa.h index 11ddd39..cbc60e1 100644 --- a/include/openssl/dsa.h +++ b/include/openssl/dsa.h
@@ -233,7 +233,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_DSA_strings(void); +int ERR_load_DSA_strings(void); /* Error codes for the DSA functions. */
diff --git a/include/openssl/ec.h b/include/openssl/ec.h index 03942ed..ebeb3e9 100644 --- a/include/openssl/ec.h +++ b/include/openssl/ec.h
@@ -1360,7 +1360,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_EC_strings(void); +int ERR_load_EC_strings(void); /* Error codes for the EC functions. */
diff --git a/include/openssl/engine.h b/include/openssl/engine.h index 21c6961..c0bedf6 100644 --- a/include/openssl/engine.h +++ b/include/openssl/engine.h
@@ -755,7 +755,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_ENGINE_strings(void); +int ERR_load_ENGINE_strings(void); /* Error codes for the ENGINE functions. */
diff --git a/include/openssl/err.h b/include/openssl/err.h index 60ffc49..d98c9cd 100644 --- a/include/openssl/err.h +++ b/include/openssl/err.h
@@ -231,9 +231,9 @@ void ERR_print_errors(BIO *bp); void ERR_add_error_data(int num, ...); void ERR_add_error_vdata(int num, va_list args); -void ERR_load_strings(int lib, ERR_STRING_DATA str[]); +int ERR_load_strings(int lib, ERR_STRING_DATA str[]); int ERR_unload_strings(int lib, ERR_STRING_DATA str[]); -void ERR_load_ERR_strings(void); +int ERR_load_ERR_strings(void); #if OPENSSL_API_COMPAT < 0x10100000L # define ERR_load_crypto_strings() \
diff --git a/include/openssl/evp.h b/include/openssl/evp.h index 997f1e2..9996603 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h
@@ -1440,7 +1440,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_EVP_strings(void); +int ERR_load_EVP_strings(void); /* Error codes for the EVP functions. */
diff --git a/include/openssl/kdf.h b/include/openssl/kdf.h index 3078b56..9f87f78 100644 --- a/include/openssl/kdf.h +++ b/include/openssl/kdf.h
@@ -56,7 +56,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_KDF_strings(void); +int ERR_load_KDF_strings(void); /* Error codes for the KDF functions. */
diff --git a/include/openssl/objects.h b/include/openssl/objects.h index 4d3de7c..09d614f 100644 --- a/include/openssl/objects.h +++ b/include/openssl/objects.h
@@ -1074,7 +1074,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_OBJ_strings(void); +int ERR_load_OBJ_strings(void); /* Error codes for the OBJ functions. */
diff --git a/include/openssl/ocsp.h b/include/openssl/ocsp.h index c74495a..a468a52 100644 --- a/include/openssl/ocsp.h +++ b/include/openssl/ocsp.h
@@ -352,7 +352,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_OCSP_strings(void); +int ERR_load_OCSP_strings(void); /* Error codes for the OCSP functions. */
diff --git a/include/openssl/pem.h b/include/openssl/pem.h index 6dd76ee..2375d63 100644 --- a/include/openssl/pem.h +++ b/include/openssl/pem.h
@@ -419,7 +419,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_PEM_strings(void); +int ERR_load_PEM_strings(void); /* Error codes for the PEM functions. */
diff --git a/include/openssl/pem2.h b/include/openssl/pem2.h index 9cb7472..cfe73f1 100644 --- a/include/openssl/pem2.h +++ b/include/openssl/pem2.h
@@ -12,7 +12,7 @@ #endif #ifndef HEADER_PEM_H -void ERR_load_PEM_strings(void); +int ERR_load_PEM_strings(void); #endif #ifdef __cplusplus
diff --git a/include/openssl/pkcs12.h b/include/openssl/pkcs12.h index 4c49fb2..a1e9d1d 100644 --- a/include/openssl/pkcs12.h +++ b/include/openssl/pkcs12.h
@@ -212,7 +212,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_PKCS12_strings(void); +int ERR_load_PKCS12_strings(void); /* Error codes for the PKCS12 functions. */
diff --git a/include/openssl/pkcs7.h b/include/openssl/pkcs7.h index 328a4f6..691f722 100644 --- a/include/openssl/pkcs7.h +++ b/include/openssl/pkcs7.h
@@ -318,7 +318,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_PKCS7_strings(void); +int ERR_load_PKCS7_strings(void); /* Error codes for the PKCS7 functions. */
diff --git a/include/openssl/rand.h b/include/openssl/rand.h index 8dab1a0..d521ae1 100644 --- a/include/openssl/rand.h +++ b/include/openssl/rand.h
@@ -73,7 +73,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_RAND_strings(void); +int ERR_load_RAND_strings(void); /* Error codes for the RAND functions. */
diff --git a/include/openssl/rsa.h b/include/openssl/rsa.h index b9d14e4..9721218 100644 --- a/include/openssl/rsa.h +++ b/include/openssl/rsa.h
@@ -456,7 +456,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_RSA_strings(void); +int ERR_load_RSA_strings(void); /* Error codes for the RSA functions. */
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 3a6cd4c..1533daa 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h
@@ -2036,7 +2036,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_SSL_strings(void); +int ERR_load_SSL_strings(void); /* Error codes for the SSL functions. */
diff --git a/include/openssl/ts.h b/include/openssl/ts.h index 3e31b2f..25ad137 100644 --- a/include/openssl/ts.h +++ b/include/openssl/ts.h
@@ -156,8 +156,6 @@ const unsigned char **pp, long length); ESS_SIGNING_CERT *ESS_SIGNING_CERT_dup(ESS_SIGNING_CERT *a); -void ERR_load_TS_strings(void); - int TS_REQ_set_version(TS_REQ *a, long version); long TS_REQ_get_version(const TS_REQ *a); @@ -532,7 +530,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_TS_strings(void); +int ERR_load_TS_strings(void); /* Error codes for the TS functions. */
diff --git a/include/openssl/ui.h b/include/openssl/ui.h index dcebb6e..26f4f04 100644 --- a/include/openssl/ui.h +++ b/include/openssl/ui.h
@@ -334,7 +334,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_UI_strings(void); +int ERR_load_UI_strings(void); /* Error codes for the UI functions. */
diff --git a/include/openssl/x509.h b/include/openssl/x509.h index 2f7444d..581d830 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h
@@ -995,7 +995,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_X509_strings(void); +int ERR_load_X509_strings(void); /* Error codes for the X509 functions. */
diff --git a/include/openssl/x509v3.h b/include/openssl/x509v3.h index e6053c5..89be5f9 100644 --- a/include/openssl/x509v3.h +++ b/include/openssl/x509v3.h
@@ -863,7 +863,7 @@ * made after this point may be overwritten when the script is next run. */ -void ERR_load_X509V3_strings(void); +int ERR_load_X509V3_strings(void); /* Error codes for the X509V3 functions. */
diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c index aed91e3..f573633 100644 --- a/ssl/ssl_err.c +++ b/ssl/ssl_err.c
@@ -661,7 +661,7 @@ #endif -void ERR_load_SSL_strings(void) +int ERR_load_SSL_strings(void) { #ifndef OPENSSL_NO_ERR @@ -670,4 +670,5 @@ ERR_load_strings(0, SSL_str_reasons); } #endif + return 1; }
diff --git a/util/mkerr.pl b/util/mkerr.pl index 7d07978..79c8cfc 100644 --- a/util/mkerr.pl +++ b/util/mkerr.pl
@@ -457,12 +457,12 @@ EOF if($static) { print OUT <<"EOF"; -${staticloader}void ERR_load_${lib}_strings(void); +${staticloader}int ERR_load_${lib}_strings(void); EOF } else { print OUT <<"EOF"; -${staticloader}void ERR_load_${lib}_strings(void); +${staticloader}int ERR_load_${lib}_strings(void); ${staticloader}void ERR_unload_${lib}_strings(void); ${staticloader}void ERR_${lib}_error(int function, int reason, char *file, int line); # define ${lib}err(f,r) ERR_${lib}_error((f),(r),OPENSSL_FILE,OPENSSL_LINE) @@ -652,7 +652,7 @@ #endif -${staticloader}void ERR_load_${lib}_strings(void) +${staticloader}int ERR_load_${lib}_strings(void) { #ifndef OPENSSL_NO_ERR @@ -661,6 +661,7 @@ ERR_load_strings($load_errcode, ${lib}_str_reasons); } #endif + return 1; } EOF } else { @@ -680,7 +681,7 @@ static int ${lib}_lib_error_code = 0; static int ${lib}_error_init = 1; -${staticloader}void ERR_load_${lib}_strings(void) +${staticloader}int ERR_load_${lib}_strings(void) { if (${lib}_lib_error_code == 0) ${lib}_lib_error_code = ERR_get_next_error_library(); @@ -697,6 +698,7 @@ ERR_load_strings(0, ${lib}_lib_name); #endif } + return 1; } ${staticloader}void ERR_unload_${lib}_strings(void)