util/mkerr.pl: make it not depend on the function code

The output C code was made to use ERR_func_error_string() to see if a
string table was already loaded or not.  Since this function returns
NULL always, this check became useless.

Change it to use ERR_reason_error_string() instead, as there's no
reason to believe we will get rid of reason strings, ever.

To top it off, we rebuild all affected C sources.

Fixes #9756

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9756)
This commit is contained in:
Richard Levitte 2019-09-04 21:45:56 +02:00
parent 6beb8b39ba
commit 0cd1b144f9
37 changed files with 37 additions and 37 deletions

View File

@ -201,7 +201,7 @@ static const ERR_STRING_DATA ASN1_str_reasons[] = {
int ERR_load_ASN1_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(ASN1_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(ASN1_str_reasons[0].error) == NULL)
ERR_load_strings_const(ASN1_str_reasons);
#endif
return 1;

View File

@ -29,7 +29,7 @@ static const ERR_STRING_DATA ASYNC_str_reasons[] = {
int ERR_load_ASYNC_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(ASYNC_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(ASYNC_str_reasons[0].error) == NULL)
ERR_load_strings_const(ASYNC_str_reasons);
#endif
return 1;

View File

@ -76,7 +76,7 @@ static const ERR_STRING_DATA BIO_str_reasons[] = {
int ERR_load_BIO_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(BIO_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(BIO_str_reasons[0].error) == NULL)
ERR_load_strings_const(BIO_str_reasons);
#endif
return 1;

View File

@ -47,7 +47,7 @@ static const ERR_STRING_DATA BN_str_reasons[] = {
int ERR_load_BN_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(BN_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(BN_str_reasons[0].error) == NULL)
ERR_load_strings_const(BN_str_reasons);
#endif
return 1;

View File

@ -22,7 +22,7 @@ static const ERR_STRING_DATA BUF_str_reasons[] = {
int ERR_load_BUF_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(BUF_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(BUF_str_reasons[0].error) == NULL)
ERR_load_strings_const(BUF_str_reasons);
#endif
return 1;

View File

@ -22,7 +22,7 @@ static const ERR_STRING_DATA CMP_str_reasons[] = {
int ERR_load_CMP_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(CMP_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(CMP_str_reasons[0].error) == NULL)
ERR_load_strings_const(CMP_str_reasons);
#endif
return 1;

View File

@ -146,7 +146,7 @@ static const ERR_STRING_DATA CMS_str_reasons[] = {
int ERR_load_CMS_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(CMS_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(CMS_str_reasons[0].error) == NULL)
ERR_load_strings_const(CMS_str_reasons);
#endif
return 1;

View File

@ -28,7 +28,7 @@ static const ERR_STRING_DATA COMP_str_reasons[] = {
int ERR_load_COMP_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(COMP_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(COMP_str_reasons[0].error) == NULL)
ERR_load_strings_const(COMP_str_reasons);
#endif
return 1;

View File

@ -58,7 +58,7 @@ static const ERR_STRING_DATA CONF_str_reasons[] = {
int ERR_load_CONF_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(CONF_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(CONF_str_reasons[0].error) == NULL)
ERR_load_strings_const(CONF_str_reasons);
#endif
return 1;

View File

@ -52,7 +52,7 @@ static const ERR_STRING_DATA CRYPTO_str_reasons[] = {
int ERR_load_CRYPTO_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(CRYPTO_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(CRYPTO_str_reasons[0].error) == NULL)
ERR_load_strings_const(CRYPTO_str_reasons);
#endif
return 1;

View File

@ -54,7 +54,7 @@ static const ERR_STRING_DATA CRMF_str_reasons[] = {
int ERR_load_CRMF_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(CRMF_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(CRMF_str_reasons[0].error) == NULL)
ERR_load_strings_const(CRMF_str_reasons);
#endif
return 1;

View File

@ -48,7 +48,7 @@ static const ERR_STRING_DATA CT_str_reasons[] = {
int ERR_load_CT_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(CT_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(CT_str_reasons[0].error) == NULL)
ERR_load_strings_const(CT_str_reasons);
#endif
return 1;

View File

@ -60,7 +60,7 @@ static const ERR_STRING_DATA DH_str_reasons[] = {
int ERR_load_DH_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(DH_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(DH_str_reasons[0].error) == NULL)
ERR_load_strings_const(DH_str_reasons);
#endif
return 1;

View File

@ -39,7 +39,7 @@ static const ERR_STRING_DATA DSA_str_reasons[] = {
int ERR_load_DSA_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(DSA_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(DSA_str_reasons[0].error) == NULL)
ERR_load_strings_const(DSA_str_reasons);
#endif
return 1;

View File

@ -49,7 +49,7 @@ static const ERR_STRING_DATA DSO_str_reasons[] = {
int ERR_load_DSO_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(DSO_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(DSO_str_reasons[0].error) == NULL)
ERR_load_strings_const(DSO_str_reasons);
#endif
return 1;

View File

@ -112,7 +112,7 @@ static const ERR_STRING_DATA EC_str_reasons[] = {
int ERR_load_EC_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(EC_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(EC_str_reasons[0].error) == NULL)
ERR_load_strings_const(EC_str_reasons);
#endif
return 1;

View File

@ -81,7 +81,7 @@ static const ERR_STRING_DATA ENGINE_str_reasons[] = {
int ERR_load_ENGINE_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(ENGINE_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(ENGINE_str_reasons[0].error) == NULL)
ERR_load_strings_const(ENGINE_str_reasons);
#endif
return 1;

View File

@ -28,7 +28,7 @@ static const ERR_STRING_DATA ESS_str_reasons[] = {
int ERR_load_ESS_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(ESS_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(ESS_str_reasons[0].error) == NULL)
ERR_load_strings_const(ESS_str_reasons);
#endif
return 1;

View File

@ -161,7 +161,7 @@ static const ERR_STRING_DATA EVP_str_reasons[] = {
int ERR_load_EVP_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(EVP_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(EVP_str_reasons[0].error) == NULL)
ERR_load_strings_const(EVP_str_reasons);
#endif
return 1;

View File

@ -24,7 +24,7 @@ static const ERR_STRING_DATA OBJ_str_reasons[] = {
int ERR_load_OBJ_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(OBJ_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(OBJ_str_reasons[0].error) == NULL)
ERR_load_strings_const(OBJ_str_reasons);
#endif
return 1;

View File

@ -65,7 +65,7 @@ static const ERR_STRING_DATA OCSP_str_reasons[] = {
int ERR_load_OCSP_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(OCSP_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(OCSP_str_reasons[0].error) == NULL)
ERR_load_strings_const(OCSP_str_reasons);
#endif
return 1;

View File

@ -60,7 +60,7 @@ static const ERR_STRING_DATA PEM_str_reasons[] = {
int ERR_load_PEM_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(PEM_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(PEM_str_reasons[0].error) == NULL)
ERR_load_strings_const(PEM_str_reasons);
#endif
return 1;

View File

@ -56,7 +56,7 @@ static const ERR_STRING_DATA PKCS12_str_reasons[] = {
int ERR_load_PKCS12_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(PKCS12_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(PKCS12_str_reasons[0].error) == NULL)
ERR_load_strings_const(PKCS12_str_reasons);
#endif
return 1;

View File

@ -90,7 +90,7 @@ static const ERR_STRING_DATA PKCS7_str_reasons[] = {
int ERR_load_PKCS7_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(PKCS7_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(PKCS7_str_reasons[0].error) == NULL)
ERR_load_strings_const(PKCS7_str_reasons);
#endif
return 1;

View File

@ -39,7 +39,7 @@ static const ERR_STRING_DATA PROP_str_reasons[] = {
int ERR_load_PROP_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(PROP_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(PROP_str_reasons[0].error) == NULL)
ERR_load_strings_const(PROP_str_reasons);
#endif
return 1;

View File

@ -89,7 +89,7 @@ static const ERR_STRING_DATA RAND_str_reasons[] = {
int ERR_load_RAND_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(RAND_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(RAND_str_reasons[0].error) == NULL)
ERR_load_strings_const(RAND_str_reasons);
#endif
return 1;

View File

@ -155,7 +155,7 @@ static const ERR_STRING_DATA RSA_str_reasons[] = {
int ERR_load_RSA_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(RSA_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(RSA_str_reasons[0].error) == NULL)
ERR_load_strings_const(RSA_str_reasons);
#endif
return 1;

View File

@ -36,7 +36,7 @@ static const ERR_STRING_DATA SM2_str_reasons[] = {
int ERR_load_SM2_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(SM2_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(SM2_str_reasons[0].error) == NULL)
ERR_load_strings_const(SM2_str_reasons);
#endif
return 1;

View File

@ -62,7 +62,7 @@ static const ERR_STRING_DATA OSSL_STORE_str_reasons[] = {
int ERR_load_OSSL_STORE_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(OSSL_STORE_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(OSSL_STORE_str_reasons[0].error) == NULL)
ERR_load_strings_const(OSSL_STORE_str_reasons);
#endif
return 1;

View File

@ -78,7 +78,7 @@ static const ERR_STRING_DATA TS_str_reasons[] = {
int ERR_load_TS_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(TS_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(TS_str_reasons[0].error) == NULL)
ERR_load_strings_const(TS_str_reasons);
#endif
return 1;

View File

@ -39,7 +39,7 @@ static const ERR_STRING_DATA UI_str_reasons[] = {
int ERR_load_UI_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(UI_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(UI_str_reasons[0].error) == NULL)
ERR_load_strings_const(UI_str_reasons);
#endif
return 1;

View File

@ -134,7 +134,7 @@ static const ERR_STRING_DATA X509V3_str_reasons[] = {
int ERR_load_X509V3_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(X509V3_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(X509V3_str_reasons[0].error) == NULL)
ERR_load_strings_const(X509V3_str_reasons);
#endif
return 1;

View File

@ -77,7 +77,7 @@ static const ERR_STRING_DATA X509_str_reasons[] = {
int ERR_load_X509_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(X509_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(X509_str_reasons[0].error) == NULL)
ERR_load_strings_const(X509_str_reasons);
#endif
return 1;

View File

@ -142,8 +142,8 @@ int ERR_load_RSA_strings(void);
# define RSA_R_KEY_PRIME_NUM_INVALID 165
# define RSA_R_KEY_SIZE_TOO_SMALL 120
# define RSA_R_LAST_OCTET_INVALID 134
# define RSA_R_MISSING_PRIVATE_KEY 179
# define RSA_R_MGF1_DIGEST_NOT_ALLOWED 152
# define RSA_R_MISSING_PRIVATE_KEY 179
# define RSA_R_MODULUS_TOO_LARGE 105
# define RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R 168
# define RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D 169

View File

@ -91,7 +91,7 @@ static const ERR_STRING_DATA PROV_str_reasons[] = {
int ERR_load_PROV_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(PROV_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(PROV_str_reasons[0].error) == NULL)
ERR_load_strings_const(PROV_str_reasons);
#endif
return 1;

View File

@ -552,7 +552,7 @@ static const ERR_STRING_DATA SSL_str_reasons[] = {
int ERR_load_SSL_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(SSL_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(SSL_str_reasons[0].error) == NULL)
ERR_load_strings_const(SSL_str_reasons);
#endif
return 1;

View File

@ -607,7 +607,7 @@ EOF
int ERR_load_${lib}_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(${lib}_str_reasons[0].error) == NULL)
if (ERR_reason_error_string(${lib}_str_reasons[0].error) == NULL)
ERR_load_strings_const(${lib}_str_reasons);
#endif
return 1;