[openssl-commits] [openssl] OpenSSL_1_0_1-stable update

Richard Levitte levitte at openssl.org
Wed Apr 8 19:48:10 UTC 2015


The branch OpenSSL_1_0_1-stable has been updated
       via  0186f7bf87cbb1f043cbb95bc302c1e950a19462 (commit)
      from  10a612a9e4728f2d082941e25a40c660aa08963b (commit)


- Log -----------------------------------------------------------------
commit 0186f7bf87cbb1f043cbb95bc302c1e950a19462
Author: Richard Levitte <levitte at openssl.org>
Date:   Wed Apr 8 19:26:11 2015 +0200

    Have mkerr.pl treat already existing multiline string defs properly
    
    Since source reformat, we ended up with some error reason string
    definitions that spanned two lines.  That in itself is fine, but we
    sometimes edited them to provide better strings than what could be
    automatically determined from the reason macro, for example:
    
        {ERR_REASON(SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER),
         "Peer haven't sent GOST certificate, required for selected ciphersuite"},
    
    However, mkerr.pl didn't treat those two-line definitions right, and
    they ended up being retranslated to whatever the macro name would
    indicate, for example:
    
        {ERR_REASON(SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER),
         "No gost certificate sent by peer"},
    
    Clearly not what we wanted.  This change fixes this problem.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (cherry picked from commit 2cfdfe0918f03f8323c9523a2beb2b363ae86ca7)

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

Summary of changes:
 util/mkerr.pl | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/util/mkerr.pl b/util/mkerr.pl
index 8d2fdbc..d87c4fd 100644
--- a/util/mkerr.pl
+++ b/util/mkerr.pl
@@ -534,14 +534,21 @@ EOF
 	# First, read any existing reason string definitions:
 	my %err_reason_strings;
 	if (open(IN,"<$cfile")) {
+		my $line = "";
 		while (<IN>) {
-			if (/\b(${lib}_R_\w*)\b.*\"(.*)\"/) {
-				$err_reason_strings{$1} = $2;
-			}
-			if (/\b${lib}_F_(\w*)\b.*\"(.*)\"/) {
-				if (!exists $ftrans{$1} && ($1 ne $2)) {
-					print STDERR "WARNING: Mismatched function string $2\n";
-					$ftrans{$1} = $2;
+			chomp;
+			$_ = $line . $_;
+			$line = "";
+			if (/{ERR_(FUNC|REASON)\(/) {
+				if (/\b(${lib}_R_\w*)\b.*\"(.*)\"/) {
+					$err_reason_strings{$1} = $2;
+				} elsif (/\b${lib}_F_(\w*)\b.*\"(.*)\"/) {
+					if (!exists $ftrans{$1} && ($1 ne $2)) {
+						print STDERR "WARNING: Mismatched function string $2\n";
+						$ftrans{$1} = $2;
+					}
+				} else {
+					$line = $_;
 				}
 			}
 		}


More information about the openssl-commits mailing list