From 59fc2b0fc21f0c90a328edb7b2755c242adfb27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bodo=20M=C3=B6ller?= Date: Sun, 5 Mar 2000 00:19:36 +0000 Subject: [PATCH] Preserve reason strings in automatically build tables. --- CHANGES | 6 ++++++ crypto/asn1/asn1_err.c | 3 ++- crypto/bio/bio_err.c | 3 ++- crypto/bn/bn_err.c | 3 ++- crypto/buffer/buf_err.c | 3 ++- crypto/comp/comp_err.c | 3 ++- crypto/conf/conf_err.c | 3 ++- crypto/cpt_err.c | 3 ++- crypto/dh/dh_err.c | 3 ++- crypto/dsa/dsa_err.c | 3 ++- crypto/evp/evp_err.c | 3 ++- crypto/objects/obj_err.c | 3 ++- crypto/pem/pem_err.c | 3 ++- crypto/pkcs12/pk12err.c | 3 ++- crypto/pkcs7/pkcs7err.c | 3 ++- crypto/rand/rand_err.c | 3 ++- crypto/rsa/rsa_err.c | 3 ++- crypto/x509/x509_err.c | 3 ++- crypto/x509v3/v3err.c | 3 ++- rsaref/rsar_err.c | 3 ++- ssl/ssl_err.c | 3 ++- util/mkerr.pl | 26 +++++++++++++++++++++----- 22 files changed, 67 insertions(+), 25 deletions(-) diff --git a/CHANGES b/CHANGES index 295e037db4..aa752fd973 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,12 @@ Changes between 0.9.5 and 0.9.6 [XX XXX 2000] + *) In util/mkerr.pl (which implements 'make errors'), preserve + reason strings from the previous version of the .c file, as + the default to have only downcase letters (and digits) in + automatically generated reasons codes is not always appropriate. + [Bodo Moeller] + *) In ERR_load_ERR_strings(), build an ERR_LIB_SYS error reason table using strerror. Previously, ERR_reason_error_string() returned library names as reason strings for SYSerr; but SYSerr is a special diff --git a/crypto/asn1/asn1_err.c b/crypto/asn1/asn1_err.c index b183814242..cecd555c88 100644 --- a/crypto/asn1/asn1_err.c +++ b/crypto/asn1/asn1_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/bio/bio_err.c b/crypto/bio/bio_err.c index b5f07de5a0..f38e7b9178 100644 --- a/crypto/bio/bio_err.c +++ b/crypto/bio/bio_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/bn/bn_err.c b/crypto/bn/bn_err.c index f3b9497dca..988270bcf4 100644 --- a/crypto/bn/bn_err.c +++ b/crypto/bn/bn_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/buffer/buf_err.c b/crypto/buffer/buf_err.c index 7f9fd1f6c3..2f971a5f38 100644 --- a/crypto/buffer/buf_err.c +++ b/crypto/buffer/buf_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/comp/comp_err.c b/crypto/comp/comp_err.c index 77a3f7070c..c10282a73c 100644 --- a/crypto/comp/comp_err.c +++ b/crypto/comp/comp_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/conf/conf_err.c b/crypto/conf/conf_err.c index eb4b3cfc70..5c1ca59090 100644 --- a/crypto/conf/conf_err.c +++ b/crypto/conf/conf_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/cpt_err.c b/crypto/cpt_err.c index c2a2dd4af6..dadd8d8d92 100644 --- a/crypto/cpt_err.c +++ b/crypto/cpt_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/dh/dh_err.c b/crypto/dh/dh_err.c index 0348bd24a2..ff2d1684c2 100644 --- a/crypto/dh/dh_err.c +++ b/crypto/dh/dh_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/dsa/dsa_err.c b/crypto/dsa/dsa_err.c index 38e4af968c..2b3ab3a9ad 100644 --- a/crypto/dsa/dsa_err.c +++ b/crypto/dsa/dsa_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/evp/evp_err.c b/crypto/evp/evp_err.c index 97953a0fc1..fc149cbb1a 100644 --- a/crypto/evp/evp_err.c +++ b/crypto/evp/evp_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/objects/obj_err.c b/crypto/objects/obj_err.c index cef401db27..7aec0ed47a 100644 --- a/crypto/objects/obj_err.c +++ b/crypto/objects/obj_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/pem/pem_err.c b/crypto/pem/pem_err.c index 642129da20..8b1789b11c 100644 --- a/crypto/pem/pem_err.c +++ b/crypto/pem/pem_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/pkcs12/pk12err.c b/crypto/pkcs12/pk12err.c index 9d8de10e1e..12db54f49e 100644 --- a/crypto/pkcs12/pk12err.c +++ b/crypto/pkcs12/pk12err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/pkcs7/pkcs7err.c b/crypto/pkcs7/pkcs7err.c index 813a8af9ed..8ded8913db 100644 --- a/crypto/pkcs7/pkcs7err.c +++ b/crypto/pkcs7/pkcs7err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/rand/rand_err.c b/crypto/rand/rand_err.c index e6a7e56dca..1af0aa0b8a 100644 --- a/crypto/rand/rand_err.c +++ b/crypto/rand/rand_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/rsa/rsa_err.c b/crypto/rsa/rsa_err.c index 5cfbea2b03..1cde7c0da4 100644 --- a/crypto/rsa/rsa_err.c +++ b/crypto/rsa/rsa_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/x509/x509_err.c b/crypto/x509/x509_err.c index fdedbdac34..848add56e9 100644 --- a/crypto/x509/x509_err.c +++ b/crypto/x509/x509_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/crypto/x509v3/v3err.c b/crypto/x509v3/v3err.c index b7d4e350c4..aa4a605dc4 100644 --- a/crypto/x509v3/v3err.c +++ b/crypto/x509v3/v3err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/rsaref/rsar_err.c b/rsaref/rsar_err.c index d2eb3a2b01..5e7871f803 100644 --- a/rsaref/rsar_err.c +++ b/rsaref/rsar_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c index 5618e34a30..1ffee87522 100644 --- a/ssl/ssl_err.c +++ b/ssl/ssl_err.c @@ -54,7 +54,8 @@ */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include diff --git a/util/mkerr.pl b/util/mkerr.pl index ebc059ef22..8e18f3c2df 100644 --- a/util/mkerr.pl +++ b/util/mkerr.pl @@ -284,6 +284,17 @@ EOF # Rewrite the C source file containing the error details. + # First, read any existing reason string definitions: + my %err_reason_strings; + if (open(IN,"<$cfile")) { + while () { + if (/\b(${lib}_R_\w*)\b.*\"(.*)\"/) { + $err_reason_strings{$1} = $2; + } + } + close(IN); + } + my $hincf; if($static) { $hfile =~ /([^\/]+)$/; @@ -352,7 +363,8 @@ EOF */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file. + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. */ #include @@ -385,9 +397,13 @@ EOF foreach $i (@reasons) { my $rn; my $nspc = 0; - $i =~ /^${lib}_R_(\S+)$/; - $rn = $1; - $rn =~ tr/_[A-Z]/ [a-z]/; + if (exists $err_reason_strings{$i}) { + $rn = $err_reason_strings{$i}; + } else { + $i =~ /^${lib}_R_(\S+)$/; + $rn = $1; + $rn =~ tr/_[A-Z]/ [a-z]/; + } $nspc = 40 - length($i) unless length($i) > 40; $nspc = " " x $nspc; print OUT "{${i}${nspc},\"$rn\"},\n"; @@ -465,7 +481,7 @@ EOF } close OUT; - + undef %err_reason_strings; } if($debug && defined(%notrans)) { -- GitLab