diff options
author | David Benjamin <davidben@google.com> | 2020-01-17 16:53:56 -0500 |
---|---|---|
committer | Tomas Mraz <tmraz@fedoraproject.org> | 2020-01-22 18:11:30 +0100 |
commit | 32be631ca1f2b73c92e4f7f5d23f1c3aee80ec69 (patch) | |
tree | 96311da5899ffe99a38af33e37d95f7426e80840 /crypto/modes | |
parent | 3b740f6ec0562a97046277c8246b21163b1a7553 (diff) | |
download | openssl-32be631ca1f2b73c92e4f7f5d23f1c3aee80ec69.zip openssl-32be631ca1f2b73c92e4f7f5d23f1c3aee80ec69.tar.gz openssl-32be631ca1f2b73c92e4f7f5d23f1c3aee80ec69.tar.bz2 |
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/modes')
-rwxr-xr-x | crypto/modes/asm/aes-gcm-armv8_64.pl | 2 | ||||
-rw-r--r-- | crypto/modes/asm/aesni-gcm-x86_64.pl | 2 | ||||
-rw-r--r-- | crypto/modes/asm/ghash-alpha.pl | 2 | ||||
-rw-r--r-- | crypto/modes/asm/ghash-armv4.pl | 2 | ||||
-rw-r--r-- | crypto/modes/asm/ghash-c64xplus.pl | 2 | ||||
-rwxr-xr-x | crypto/modes/asm/ghash-ia64.pl | 2 | ||||
-rw-r--r-- | crypto/modes/asm/ghash-parisc.pl | 2 | ||||
-rw-r--r-- | crypto/modes/asm/ghash-s390x.pl | 2 | ||||
-rw-r--r-- | crypto/modes/asm/ghash-sparcv9.pl | 2 | ||||
-rw-r--r-- | crypto/modes/asm/ghash-x86.pl | 2 | ||||
-rw-r--r-- | crypto/modes/asm/ghash-x86_64.pl | 2 | ||||
-rwxr-xr-x | crypto/modes/asm/ghashp8-ppc.pl | 2 | ||||
-rw-r--r-- | crypto/modes/asm/ghashv8-armx.pl | 2 |
13 files changed, 13 insertions, 13 deletions
diff --git a/crypto/modes/asm/aes-gcm-armv8_64.pl b/crypto/modes/asm/aes-gcm-armv8_64.pl index ee88906..5078424 100755 --- a/crypto/modes/asm/aes-gcm-armv8_64.pl +++ b/crypto/modes/asm/aes-gcm-armv8_64.pl @@ -5719,4 +5719,4 @@ if ($flavour =~ /64/) { ######## 64-bit code } } -close STDOUT; # enforce flush +close STDOUT or die "error closing STDOUT"; # enforce flush diff --git a/crypto/modes/asm/aesni-gcm-x86_64.pl b/crypto/modes/asm/aesni-gcm-x86_64.pl index c3facaa..70b1757 100644 --- a/crypto/modes/asm/aesni-gcm-x86_64.pl +++ b/crypto/modes/asm/aesni-gcm-x86_64.pl @@ -1106,4 +1106,4 @@ $code =~ s/\`([^\`]*)\`/eval($1)/gem; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/modes/asm/ghash-alpha.pl b/crypto/modes/asm/ghash-alpha.pl index 0c4a982..8f56d27 100644 --- a/crypto/modes/asm/ghash-alpha.pl +++ b/crypto/modes/asm/ghash-alpha.pl @@ -463,5 +463,5 @@ rem_4bit: ___ $output=pop and open STDOUT,">$output"; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/modes/asm/ghash-armv4.pl b/crypto/modes/asm/ghash-armv4.pl index 9a3a1f4..0b94340 100644 --- a/crypto/modes/asm/ghash-armv4.pl +++ b/crypto/modes/asm/ghash-armv4.pl @@ -551,4 +551,4 @@ foreach (split("\n",$code)) { print $_,"\n"; } -close STDOUT; # enforce flush +close STDOUT or die "error closing STDOUT"; # enforce flush diff --git a/crypto/modes/asm/ghash-c64xplus.pl b/crypto/modes/asm/ghash-c64xplus.pl index 70cef3b..fa9822b 100644 --- a/crypto/modes/asm/ghash-c64xplus.pl +++ b/crypto/modes/asm/ghash-c64xplus.pl @@ -243,4 +243,4 @@ $code.=<<___; ___ print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/modes/asm/ghash-ia64.pl b/crypto/modes/asm/ghash-ia64.pl index f61cd82..404207a 100755 --- a/crypto/modes/asm/ghash-ia64.pl +++ b/crypto/modes/asm/ghash-ia64.pl @@ -467,4 +467,4 @@ $code =~ s/mux1(\s+)\S+\@rev/nop.i$1 0x0/gm if ($big_endian); $code =~ s/\`([^\`]*)\`/eval $1/gem; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/modes/asm/ghash-parisc.pl b/crypto/modes/asm/ghash-parisc.pl index 4eccdc7..8192831 100644 --- a/crypto/modes/asm/ghash-parisc.pl +++ b/crypto/modes/asm/ghash-parisc.pl @@ -748,4 +748,4 @@ foreach (split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/modes/asm/ghash-s390x.pl b/crypto/modes/asm/ghash-s390x.pl index 5355a30..b9a6376 100644 --- a/crypto/modes/asm/ghash-s390x.pl +++ b/crypto/modes/asm/ghash-s390x.pl @@ -261,4 +261,4 @@ ___ $code =~ s/\`([^\`]*)\`/eval $1/gem; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/modes/asm/ghash-sparcv9.pl b/crypto/modes/asm/ghash-sparcv9.pl index b8b1022..ac61df6 100644 --- a/crypto/modes/asm/ghash-sparcv9.pl +++ b/crypto/modes/asm/ghash-sparcv9.pl @@ -577,4 +577,4 @@ foreach (split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/modes/asm/ghash-x86.pl b/crypto/modes/asm/ghash-x86.pl index 5372b48..d3b0ed8 100644 --- a/crypto/modes/asm/ghash-x86.pl +++ b/crypto/modes/asm/ghash-x86.pl @@ -1377,7 +1377,7 @@ my ($Xhi,$Xi)=@_; &asciz("GHASH for x86, CRYPTOGAMS by <appro\@openssl.org>"); &asm_finish(); -close STDOUT; +close STDOUT or die "error closing STDOUT"; # A question was risen about choice of vanilla MMX. Or rather why wasn't # SSE2 chosen instead? In addition to the fact that MMX runs on legacy diff --git a/crypto/modes/asm/ghash-x86_64.pl b/crypto/modes/asm/ghash-x86_64.pl index f9d425c..3af31ab 100644 --- a/crypto/modes/asm/ghash-x86_64.pl +++ b/crypto/modes/asm/ghash-x86_64.pl @@ -1817,4 +1817,4 @@ $code =~ s/\`([^\`]*)\`/eval($1)/gem; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/modes/asm/ghashp8-ppc.pl b/crypto/modes/asm/ghashp8-ppc.pl index 44add79..aa3af21 100755 --- a/crypto/modes/asm/ghashp8-ppc.pl +++ b/crypto/modes/asm/ghashp8-ppc.pl @@ -671,4 +671,4 @@ foreach (split("\n",$code)) { print $_,"\n"; } -close STDOUT; # enforce flush +close STDOUT or die "error closing STDOUT"; # enforce flush diff --git a/crypto/modes/asm/ghashv8-armx.pl b/crypto/modes/asm/ghashv8-armx.pl index aa5251d..5618410 100644 --- a/crypto/modes/asm/ghashv8-armx.pl +++ b/crypto/modes/asm/ghashv8-armx.pl @@ -794,4 +794,4 @@ if ($flavour =~ /64/) { ######## 64-bit code } } -close STDOUT; # enforce flush +close STDOUT or die "error closing STDOUT"; # enforce flush |