summaryrefslogtreecommitdiffstats
path: root/crypto/rc4
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2020-02-17 12:21:27 +1000
committerPauli <paul.dale@oracle.com>2020-02-17 12:21:27 +1000
commit218e740f850f77c9f2720d56886eab166d1a6727 (patch)
treef1691e347bca452b568a9df238f15098d95ba88c /crypto/rc4
parent57225c99ef848f0d0d1a7ab586a61ef71740f1ff (diff)
Do not silently truncate files on perlasm errors
If one of the perlasm xlate drivers crashes, OpenSSL's build will currently swallow the error and silently truncate the output to however far the driver got. This will hopefully fail to build, but better to check such things. Handle this by checking for errors when closing STDOUT (which is a pipe to the xlate driver). This is the OpenSSL 1.1.1 version of https://github.com/openssl/openssl/pull/10883 and https://github.com/openssl/openssl/pull/10930. Reviewed-by: Mark J. Cox <mark@awe.com> Reviewed-by: Paul Dale David Benjamin <davidben@google.com> (Merged from https://github.com/openssl/openssl/pull/10931)
Diffstat (limited to 'crypto/rc4')
-rw-r--r--crypto/rc4/asm/rc4-586.pl2
-rw-r--r--crypto/rc4/asm/rc4-c64xplus.pl2
-rw-r--r--crypto/rc4/asm/rc4-md5-x86_64.pl2
-rw-r--r--crypto/rc4/asm/rc4-parisc.pl2
-rw-r--r--crypto/rc4/asm/rc4-s390x.pl2
-rwxr-xr-xcrypto/rc4/asm/rc4-x86_64.pl2
6 files changed, 6 insertions, 6 deletions
diff --git a/crypto/rc4/asm/rc4-586.pl b/crypto/rc4/asm/rc4-586.pl
index 8c5cf87d05..211f0cd90e 100644
--- a/crypto/rc4/asm/rc4-586.pl
+++ b/crypto/rc4/asm/rc4-586.pl
@@ -423,4 +423,4 @@ $idx="edx";
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/rc4/asm/rc4-c64xplus.pl b/crypto/rc4/asm/rc4-c64xplus.pl
index 1354d18214..c2843aea06 100644
--- a/crypto/rc4/asm/rc4-c64xplus.pl
+++ b/crypto/rc4/asm/rc4-c64xplus.pl
@@ -189,4 +189,4 @@ ___
$output=pop;
open STDOUT,">$output";
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/rc4/asm/rc4-md5-x86_64.pl b/crypto/rc4/asm/rc4-md5-x86_64.pl
index 7b02f09fed..0679c590d5 100644
--- a/crypto/rc4/asm/rc4-md5-x86_64.pl
+++ b/crypto/rc4/asm/rc4-md5-x86_64.pl
@@ -660,4 +660,4 @@ $code =~ s/#rc4#//gm if ($rc4);
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/rc4/asm/rc4-parisc.pl b/crypto/rc4/asm/rc4-parisc.pl
index 4111f339da..947dd4903b 100644
--- a/crypto/rc4/asm/rc4-parisc.pl
+++ b/crypto/rc4/asm/rc4-parisc.pl
@@ -330,4 +330,4 @@ foreach(split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/rc4/asm/rc4-s390x.pl b/crypto/rc4/asm/rc4-s390x.pl
index 984afaab5c..b528d3feec 100644
--- a/crypto/rc4/asm/rc4-s390x.pl
+++ b/crypto/rc4/asm/rc4-s390x.pl
@@ -238,4 +238,4 @@ RC4_options:
___
print $code;
-close STDOUT; # force flush
+close STDOUT or die "error closing STDOUT: $!"; # force flush
diff --git a/crypto/rc4/asm/rc4-x86_64.pl b/crypto/rc4/asm/rc4-x86_64.pl
index 32d842c59f..7af3df46d0 100755
--- a/crypto/rc4/asm/rc4-x86_64.pl
+++ b/crypto/rc4/asm/rc4-x86_64.pl
@@ -698,4 +698,4 @@ $code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";