summaryrefslogtreecommitdiffstats
path: root/crypto/aes
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2020-01-17 16:53:56 -0500
committerTomas Mraz <tmraz@fedoraproject.org>2020-01-22 18:11:30 +0100
commit32be631ca1f2b73c92e4f7f5d23f1c3aee80ec69 (patch)
tree96311da5899ffe99a38af33e37d95f7426e80840 /crypto/aes
parent3b740f6ec0562a97046277c8246b21163b1a7553 (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). Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10883)
Diffstat (limited to 'crypto/aes')
-rwxr-xr-xcrypto/aes/asm/aes-586.pl2
-rw-r--r--crypto/aes/asm/aes-armv4.pl2
-rw-r--r--crypto/aes/asm/aes-c64xplus.pl2
-rw-r--r--crypto/aes/asm/aes-mips.pl2
-rw-r--r--crypto/aes/asm/aes-parisc.pl2
-rw-r--r--crypto/aes/asm/aes-ppc.pl2
-rw-r--r--crypto/aes/asm/aes-s390x.pl2
-rwxr-xr-xcrypto/aes/asm/aes-sparcv9.pl2
-rwxr-xr-xcrypto/aes/asm/aes-x86_64.pl2
-rw-r--r--crypto/aes/asm/aesfx-sparcv9.pl2
-rw-r--r--crypto/aes/asm/aesni-mb-x86_64.pl2
-rw-r--r--crypto/aes/asm/aesni-sha1-x86_64.pl2
-rw-r--r--crypto/aes/asm/aesni-sha256-x86_64.pl2
-rw-r--r--crypto/aes/asm/aesni-x86.pl2
-rw-r--r--crypto/aes/asm/aesni-x86_64.pl2
-rwxr-xr-xcrypto/aes/asm/aesp8-ppc.pl2
-rw-r--r--crypto/aes/asm/aest4-sparcv9.pl2
-rwxr-xr-xcrypto/aes/asm/aesv8-armx.pl2
-rw-r--r--crypto/aes/asm/bsaes-armv7.pl2
-rw-r--r--crypto/aes/asm/bsaes-x86_64.pl2
-rwxr-xr-xcrypto/aes/asm/vpaes-armv8.pl2
-rw-r--r--crypto/aes/asm/vpaes-ppc.pl2
-rw-r--r--crypto/aes/asm/vpaes-x86.pl2
-rw-r--r--crypto/aes/asm/vpaes-x86_64.pl2
24 files changed, 24 insertions, 24 deletions
diff --git a/crypto/aes/asm/aes-586.pl b/crypto/aes/asm/aes-586.pl
index 1fe8245f39..401469eed7 100755
--- a/crypto/aes/asm/aes-586.pl
+++ b/crypto/aes/asm/aes-586.pl
@@ -2995,4 +2995,4 @@ sub deckey()
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aes-armv4.pl b/crypto/aes/asm/aes-armv4.pl
index 9367f1f33b..2461535012 100644
--- a/crypto/aes/asm/aes-armv4.pl
+++ b/crypto/aes/asm/aes-armv4.pl
@@ -1245,4 +1245,4 @@ while(<SELF>) {
close SELF;
print $code;
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT"; # enforce flush
diff --git a/crypto/aes/asm/aes-c64xplus.pl b/crypto/aes/asm/aes-c64xplus.pl
index d290afc0af..4a9b41af76 100644
--- a/crypto/aes/asm/aes-c64xplus.pl
+++ b/crypto/aes/asm/aes-c64xplus.pl
@@ -1378,4 +1378,4 @@ AES_Td4:
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aes-mips.pl b/crypto/aes/asm/aes-mips.pl
index c64933e93c..73ed988526 100644
--- a/crypto/aes/asm/aes-mips.pl
+++ b/crypto/aes/asm/aes-mips.pl
@@ -2203,4 +2203,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aes-parisc.pl b/crypto/aes/asm/aes-parisc.pl
index 96ba998656..761c234733 100644
--- a/crypto/aes/asm/aes-parisc.pl
+++ b/crypto/aes/asm/aes-parisc.pl
@@ -1038,4 +1038,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aes-ppc.pl b/crypto/aes/asm/aes-ppc.pl
index b235b00b83..219bd69d6f 100644
--- a/crypto/aes/asm/aes-ppc.pl
+++ b/crypto/aes/asm/aes-ppc.pl
@@ -1460,4 +1460,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aes-s390x.pl b/crypto/aes/asm/aes-s390x.pl
index 1affce3fd2..a4982554d2 100644
--- a/crypto/aes/asm/aes-s390x.pl
+++ b/crypto/aes/asm/aes-s390x.pl
@@ -2281,4 +2281,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT; # force flush
+close STDOUT or die "error closing STDOUT"; # force flush
diff --git a/crypto/aes/asm/aes-sparcv9.pl b/crypto/aes/asm/aes-sparcv9.pl
index f80638639d..f57a9a3fea 100755
--- a/crypto/aes/asm/aes-sparcv9.pl
+++ b/crypto/aes/asm/aes-sparcv9.pl
@@ -1188,4 +1188,4 @@ ___
$code =~ s/fmovs.*$//gm;
print $code;
-close STDOUT; # ensure flush
+close STDOUT or die "error closing STDOUT"; # ensure flush
diff --git a/crypto/aes/asm/aes-x86_64.pl b/crypto/aes/asm/aes-x86_64.pl
index a657e36247..813817ed46 100755
--- a/crypto/aes/asm/aes-x86_64.pl
+++ b/crypto/aes/asm/aes-x86_64.pl
@@ -2919,4 +2919,4 @@ $code =~ s/\`([^\`]*)\`/eval($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aesfx-sparcv9.pl b/crypto/aes/asm/aesfx-sparcv9.pl
index c59970d5cf..2512dffa6b 100644
--- a/crypto/aes/asm/aesfx-sparcv9.pl
+++ b/crypto/aes/asm/aesfx-sparcv9.pl
@@ -1266,4 +1266,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aesni-mb-x86_64.pl b/crypto/aes/asm/aesni-mb-x86_64.pl
index e531137e8d..eb852cc663 100644
--- a/crypto/aes/asm/aesni-mb-x86_64.pl
+++ b/crypto/aes/asm/aesni-mb-x86_64.pl
@@ -1473,4 +1473,4 @@ $code =~ s/\`([^\`]*)\`/eval($1)/gem;
$code =~ s/\b(aes.*%xmm[0-9]+).*$/aesni($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aesni-sha1-x86_64.pl b/crypto/aes/asm/aesni-sha1-x86_64.pl
index 6bf295565b..4a881f8e10 100644
--- a/crypto/aes/asm/aesni-sha1-x86_64.pl
+++ b/crypto/aes/asm/aesni-sha1-x86_64.pl
@@ -2145,4 +2145,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aesni-sha256-x86_64.pl b/crypto/aes/asm/aesni-sha256-x86_64.pl
index 8f230855c3..58ef8ad2ed 100644
--- a/crypto/aes/asm/aesni-sha256-x86_64.pl
+++ b/crypto/aes/asm/aesni-sha256-x86_64.pl
@@ -1801,4 +1801,4 @@ sub rex {
$code =~ s/\`([^\`]*)\`/eval $1/gem;
$code =~ s/\b(sha256[^\s]*)\s+(.*)/sha256op38($1,$2)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aesni-x86.pl b/crypto/aes/asm/aesni-x86.pl
index 2d04fd6ef9..1c714531ea 100644
--- a/crypto/aes/asm/aesni-x86.pl
+++ b/crypto/aes/asm/aesni-x86.pl
@@ -3410,4 +3410,4 @@ my ($l_,$block,$i1,$i3,$i5) = ($rounds_,$key_,$rounds,$len,$out);
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aesni-x86_64.pl b/crypto/aes/asm/aesni-x86_64.pl
index 2c164d4565..ce65427f7e 100644
--- a/crypto/aes/asm/aesni-x86_64.pl
+++ b/crypto/aes/asm/aesni-x86_64.pl
@@ -5156,4 +5156,4 @@ $code =~ s/\bmovbe\s+%eax,\s*([0-9]+)\(%rsp\)/movbe($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aesp8-ppc.pl b/crypto/aes/asm/aesp8-ppc.pl
index 97734b4b1d..9408bf0a54 100755
--- a/crypto/aes/asm/aesp8-ppc.pl
+++ b/crypto/aes/asm/aesp8-ppc.pl
@@ -3808,4 +3808,4 @@ foreach(split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aest4-sparcv9.pl b/crypto/aes/asm/aest4-sparcv9.pl
index d34a7ef02a..c9a2ff69d3 100644
--- a/crypto/aes/asm/aest4-sparcv9.pl
+++ b/crypto/aes/asm/aest4-sparcv9.pl
@@ -925,4 +925,4 @@ ___
&emit_assembler();
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/aesv8-armx.pl b/crypto/aes/asm/aesv8-armx.pl
index d0ae34bc48..f89bba5cfa 100755
--- a/crypto/aes/asm/aesv8-armx.pl
+++ b/crypto/aes/asm/aesv8-armx.pl
@@ -2237,4 +2237,4 @@ if ($flavour =~ /64/) { ######## 64-bit code
}
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/bsaes-armv7.pl b/crypto/aes/asm/bsaes-armv7.pl
index b917dbf1e5..601b6b3942 100644
--- a/crypto/aes/asm/bsaes-armv7.pl
+++ b/crypto/aes/asm/bsaes-armv7.pl
@@ -2491,4 +2491,4 @@ close SELF;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/bsaes-x86_64.pl b/crypto/aes/asm/bsaes-x86_64.pl
index 1f9f261ca4..b75d95ffab 100644
--- a/crypto/aes/asm/bsaes-x86_64.pl
+++ b/crypto/aes/asm/bsaes-x86_64.pl
@@ -3238,4 +3238,4 @@ $code =~ s/\`([^\`]*)\`/eval($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/vpaes-armv8.pl b/crypto/aes/asm/vpaes-armv8.pl
index 4bf4630e3d..2dba92dd24 100755
--- a/crypto/aes/asm/vpaes-armv8.pl
+++ b/crypto/aes/asm/vpaes-armv8.pl
@@ -1278,4 +1278,4 @@ ___
} }
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/vpaes-ppc.pl b/crypto/aes/asm/vpaes-ppc.pl
index 1b839e8cae..74f4d9af28 100644
--- a/crypto/aes/asm/vpaes-ppc.pl
+++ b/crypto/aes/asm/vpaes-ppc.pl
@@ -1595,4 +1595,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/vpaes-x86.pl b/crypto/aes/asm/vpaes-x86.pl
index c1417a8f74..a737f2db76 100644
--- a/crypto/aes/asm/vpaes-x86.pl
+++ b/crypto/aes/asm/vpaes-x86.pl
@@ -911,4 +911,4 @@ $k_dsbo=0x2c0; # decryption sbox final output
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT";
diff --git a/crypto/aes/asm/vpaes-x86_64.pl b/crypto/aes/asm/vpaes-x86_64.pl
index 51ff5df4d3..5c1dc9f9ea 100644
--- a/crypto/aes/asm/vpaes-x86_64.pl
+++ b/crypto/aes/asm/vpaes-x86_64.pl
@@ -1240,4 +1240,4 @@ $code =~ s/\`([^\`]*)\`/eval($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT";