diff options
author | David Benjamin <davidben@google.com> | 2020-01-17 22:53:56 +0100 |
---|---|---|
committer | Tomas Mraz <tmraz@fedoraproject.org> | 2020-01-22 18:11:30 +0100 |
commit | 32be631ca1f2b73c92e4f7f5d23f1c3aee80ec69 (patch) | |
tree | 96311da5899ffe99a38af33e37d95f7426e80840 /crypto/modes | |
parent | Russian Elbrus processors support (diff) | |
download | openssl-32be631ca1f2b73c92e4f7f5d23f1c3aee80ec69.tar.xz openssl-32be631ca1f2b73c92e4f7f5d23f1c3aee80ec69.zip |
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 ee88906d85..5078424eb1 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 c3facaa1ac..70b1757f7a 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 0c4a982d52..8f56d277de 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 9a3a1f4e8d..0b94340d3b 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 70cef3bc0f..fa9822b3c9 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 f61cd82944..404207a92d 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 4eccdc71be..8192831e8b 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 5355a30748..b9a637628f 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 b8b102282f..ac61df6069 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 5372b48704..d3b0ed8684 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 f9d425ce33..3af31abc4f 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 44add7958e..aa3af21af1 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 aa5251df9f..5618410a3d 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 |