summaryrefslogtreecommitdiffstats
path: root/crypto/poly1305
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/poly1305
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/poly1305')
-rwxr-xr-xcrypto/poly1305/asm/poly1305-armv4.pl2
-rwxr-xr-xcrypto/poly1305/asm/poly1305-armv8.pl2
-rwxr-xr-xcrypto/poly1305/asm/poly1305-mips.pl2
-rwxr-xr-xcrypto/poly1305/asm/poly1305-ppc.pl2
-rwxr-xr-xcrypto/poly1305/asm/poly1305-ppcfp.pl2
-rwxr-xr-xcrypto/poly1305/asm/poly1305-s390x.pl2
-rwxr-xr-xcrypto/poly1305/asm/poly1305-sparcv9.pl2
-rwxr-xr-xcrypto/poly1305/asm/poly1305-x86.pl2
-rwxr-xr-xcrypto/poly1305/asm/poly1305-x86_64.pl2
9 files changed, 9 insertions, 9 deletions
diff --git a/crypto/poly1305/asm/poly1305-armv4.pl b/crypto/poly1305/asm/poly1305-armv4.pl
index 5cdb6be059..659d77dff0 100755
--- a/crypto/poly1305/asm/poly1305-armv4.pl
+++ b/crypto/poly1305/asm/poly1305-armv4.pl
@@ -1250,4 +1250,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/poly1305/asm/poly1305-armv8.pl b/crypto/poly1305/asm/poly1305-armv8.pl
index 6c6c9bb05b..0a3c34cc7d 100755
--- a/crypto/poly1305/asm/poly1305-armv8.pl
+++ b/crypto/poly1305/asm/poly1305-armv8.pl
@@ -943,4 +943,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-mips.pl b/crypto/poly1305/asm/poly1305-mips.pl
index 28b6772ee5..73a710a16f 100755
--- a/crypto/poly1305/asm/poly1305-mips.pl
+++ b/crypto/poly1305/asm/poly1305-mips.pl
@@ -433,5 +433,5 @@ ___
$output=pop and open STDOUT,">$output";
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-ppc.pl b/crypto/poly1305/asm/poly1305-ppc.pl
index 0c6d015d58..c077e0c307 100755
--- a/crypto/poly1305/asm/poly1305-ppc.pl
+++ b/crypto/poly1305/asm/poly1305-ppc.pl
@@ -642,4 +642,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-ppcfp.pl b/crypto/poly1305/asm/poly1305-ppcfp.pl
index 09f8185848..9dc352171a 100755
--- a/crypto/poly1305/asm/poly1305-ppcfp.pl
+++ b/crypto/poly1305/asm/poly1305-ppcfp.pl
@@ -736,4 +736,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-s390x.pl b/crypto/poly1305/asm/poly1305-s390x.pl
index 82d757d9a1..31a58fdb69 100755
--- a/crypto/poly1305/asm/poly1305-s390x.pl
+++ b/crypto/poly1305/asm/poly1305-s390x.pl
@@ -224,4 +224,4 @@ $code =~ s/\`([^\`]*)\`/eval $1/gem;
$code =~ s/\b(srlg\s+)(%r[0-9]+\s*,)\s*([0-9]+)/$1$2$2$3/gm;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-sparcv9.pl b/crypto/poly1305/asm/poly1305-sparcv9.pl
index 0bdd048925..db96af645f 100755
--- a/crypto/poly1305/asm/poly1305-sparcv9.pl
+++ b/crypto/poly1305/asm/poly1305-sparcv9.pl
@@ -1117,4 +1117,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-x86.pl b/crypto/poly1305/asm/poly1305-x86.pl
index 3e0e7883be..a02823361b 100755
--- a/crypto/poly1305/asm/poly1305-x86.pl
+++ b/crypto/poly1305/asm/poly1305-x86.pl
@@ -1812,4 +1812,4 @@ sub vlazy_reduction {
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-x86_64.pl b/crypto/poly1305/asm/poly1305-x86_64.pl
index c3b7ce3658..4aa71783ee 100755
--- a/crypto/poly1305/asm/poly1305-x86_64.pl
+++ b/crypto/poly1305/asm/poly1305-x86_64.pl
@@ -4180,4 +4180,4 @@ foreach (split('\n',$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";