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/sha | |
parent | 3b740f6ec0562a97046277c8246b21163b1a7553 (diff) | |
download | openssl-new-32be631ca1f2b73c92e4f7f5d23f1c3aee80ec69.tar.gz |
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/sha')
40 files changed, 40 insertions, 40 deletions
diff --git a/crypto/sha/asm/keccak1600-armv4.pl b/crypto/sha/asm/keccak1600-armv4.pl index 1ab0e8119a..8a1b1b6eb4 100755 --- a/crypto/sha/asm/keccak1600-armv4.pl +++ b/crypto/sha/asm/keccak1600-armv4.pl @@ -1633,4 +1633,4 @@ foreach (split($/,$code)) { print $_,"\n"; } -close STDOUT; # enforce flush +close STDOUT or die "error closing STDOUT"; # enforce flush diff --git a/crypto/sha/asm/keccak1600-armv8.pl b/crypto/sha/asm/keccak1600-armv8.pl index 515491a9db..c80d135529 100755 --- a/crypto/sha/asm/keccak1600-armv8.pl +++ b/crypto/sha/asm/keccak1600-armv8.pl @@ -873,4 +873,4 @@ foreach(split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/keccak1600-avx2.pl b/crypto/sha/asm/keccak1600-avx2.pl index a56756fb31..5e5e5db2c3 100755 --- a/crypto/sha/asm/keccak1600-avx2.pl +++ b/crypto/sha/asm/keccak1600-avx2.pl @@ -478,4 +478,4 @@ ___ $output=pop and open STDOUT,">$output"; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/keccak1600-avx512.pl b/crypto/sha/asm/keccak1600-avx512.pl index be4a7acec2..52d3f2929e 100755 --- a/crypto/sha/asm/keccak1600-avx512.pl +++ b/crypto/sha/asm/keccak1600-avx512.pl @@ -547,4 +547,4 @@ ___ $output=pop and open STDOUT,">$output"; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/keccak1600-avx512vl.pl b/crypto/sha/asm/keccak1600-avx512vl.pl index 8616050a24..d0254969e9 100755 --- a/crypto/sha/asm/keccak1600-avx512vl.pl +++ b/crypto/sha/asm/keccak1600-avx512vl.pl @@ -388,4 +388,4 @@ ___ $output=pop and open STDOUT,">$output"; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/keccak1600-c64x.pl b/crypto/sha/asm/keccak1600-c64x.pl index 7433c9987e..9238dd5ebb 100755 --- a/crypto/sha/asm/keccak1600-c64x.pl +++ b/crypto/sha/asm/keccak1600-c64x.pl @@ -881,4 +881,4 @@ ___ $output=pop and open STDOUT,">$output"; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/keccak1600-mmx.pl b/crypto/sha/asm/keccak1600-mmx.pl index 8be05a1f58..3976a7b101 100755 --- a/crypto/sha/asm/keccak1600-mmx.pl +++ b/crypto/sha/asm/keccak1600-mmx.pl @@ -436,4 +436,4 @@ sub Rho() { ######### regular Rho step &asm_finish(); -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/keccak1600-ppc64.pl b/crypto/sha/asm/keccak1600-ppc64.pl index 6f5906352d..fb73291c3a 100755 --- a/crypto/sha/asm/keccak1600-ppc64.pl +++ b/crypto/sha/asm/keccak1600-ppc64.pl @@ -759,4 +759,4 @@ ___ $code =~ s/\`([^\`]*)\`/eval $1/gem; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/keccak1600-s390x.pl b/crypto/sha/asm/keccak1600-s390x.pl index 99cbee30b6..5dc970ef55 100755 --- a/crypto/sha/asm/keccak1600-s390x.pl +++ b/crypto/sha/asm/keccak1600-s390x.pl @@ -559,4 +559,4 @@ ___ $code =~ s/(srlg\s+)(%r[0-9]+),/$1$2,$2,/gm; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/keccak1600-x86_64.pl b/crypto/sha/asm/keccak1600-x86_64.pl index aee356adbb..808319cff1 100755 --- a/crypto/sha/asm/keccak1600-x86_64.pl +++ b/crypto/sha/asm/keccak1600-x86_64.pl @@ -608,4 +608,4 @@ foreach (split("\n",$code)) { print $_, "\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/keccak1600p8-ppc.pl b/crypto/sha/asm/keccak1600p8-ppc.pl index 0fdc23f689..c6285af7b8 100755 --- a/crypto/sha/asm/keccak1600p8-ppc.pl +++ b/crypto/sha/asm/keccak1600p8-ppc.pl @@ -851,4 +851,4 @@ foreach (split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha1-586.pl b/crypto/sha/asm/sha1-586.pl index 2c3c7bc905..eed01f308a 100644 --- a/crypto/sha/asm/sha1-586.pl +++ b/crypto/sha/asm/sha1-586.pl @@ -1487,4 +1487,4 @@ sub Xtail_avx() &asm_finish(); -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha1-alpha.pl b/crypto/sha/asm/sha1-alpha.pl index 158c5ea6e7..b4f9388a3c 100644 --- a/crypto/sha/asm/sha1-alpha.pl +++ b/crypto/sha/asm/sha1-alpha.pl @@ -326,4 +326,4 @@ $code.=<<___; ___ $output=pop and open STDOUT,">$output"; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha1-armv4-large.pl b/crypto/sha/asm/sha1-armv4-large.pl index 24fc5bf430..8ed304799d 100644 --- a/crypto/sha/asm/sha1-armv4-large.pl +++ b/crypto/sha/asm/sha1-armv4-large.pl @@ -749,4 +749,4 @@ foreach (split($/,$code)) { print $_,$/; } -close STDOUT; # enforce flush +close STDOUT or die "error closing STDOUT"; # enforce flush diff --git a/crypto/sha/asm/sha1-armv8.pl b/crypto/sha/asm/sha1-armv8.pl index f9f3c5f3cf..cb0e383396 100644 --- a/crypto/sha/asm/sha1-armv8.pl +++ b/crypto/sha/asm/sha1-armv8.pl @@ -357,4 +357,4 @@ foreach(split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha1-c64xplus.pl b/crypto/sha/asm/sha1-c64xplus.pl index 66f15e22fd..4a4772eaab 100644 --- a/crypto/sha/asm/sha1-c64xplus.pl +++ b/crypto/sha/asm/sha1-c64xplus.pl @@ -333,4 +333,4 @@ $code.=<<___; ___ print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha1-mb-x86_64.pl b/crypto/sha/asm/sha1-mb-x86_64.pl index 2da2ffffe5..71aacc569a 100644 --- a/crypto/sha/asm/sha1-mb-x86_64.pl +++ b/crypto/sha/asm/sha1-mb-x86_64.pl @@ -1627,4 +1627,4 @@ foreach (split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha1-mips.pl b/crypto/sha/asm/sha1-mips.pl index 0f23b6b074..4a510c6ace 100644 --- a/crypto/sha/asm/sha1-mips.pl +++ b/crypto/sha/asm/sha1-mips.pl @@ -461,4 +461,4 @@ $code.=<<___; .asciiz "SHA1 for MIPS, CRYPTOGAMS by <appro\@openssl.org>" ___ print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha1-parisc.pl b/crypto/sha/asm/sha1-parisc.pl index 00c85378e2..4f64346306 100644 --- a/crypto/sha/asm/sha1-parisc.pl +++ b/crypto/sha/asm/sha1-parisc.pl @@ -279,4 +279,4 @@ foreach(split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha1-ppc.pl b/crypto/sha/asm/sha1-ppc.pl index f7a75b743e..0bc16c0ad7 100755 --- a/crypto/sha/asm/sha1-ppc.pl +++ b/crypto/sha/asm/sha1-ppc.pl @@ -352,4 +352,4 @@ ___ $code =~ s/\`([^\`]*)\`/eval $1/gem; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha1-s390x.pl b/crypto/sha/asm/sha1-s390x.pl index 091e1c00b3..4de9f384c1 100644 --- a/crypto/sha/asm/sha1-s390x.pl +++ b/crypto/sha/asm/sha1-s390x.pl @@ -248,4 +248,4 @@ ___ $code =~ s/\`([^\`]*)\`/eval $1/gem; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha1-sparcv9.pl b/crypto/sha/asm/sha1-sparcv9.pl index 8ef8b5fee0..585996b13d 100644 --- a/crypto/sha/asm/sha1-sparcv9.pl +++ b/crypto/sha/asm/sha1-sparcv9.pl @@ -430,4 +430,4 @@ foreach (split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha1-sparcv9a.pl b/crypto/sha/asm/sha1-sparcv9a.pl index e0ccea2a98..9c24a48e3d 100644 --- a/crypto/sha/asm/sha1-sparcv9a.pl +++ b/crypto/sha/asm/sha1-sparcv9a.pl @@ -604,4 +604,4 @@ $code =~ s/\b(alignaddr)\s+(%[goli][0-7]),(%[goli][0-7]),(%[goli][0-7])/ &unalignaddr($1,$2,$3,$4) /gem; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha1-thumb.pl b/crypto/sha/asm/sha1-thumb.pl index dbe5754700..b89bd978c3 100644 --- a/crypto/sha/asm/sha1-thumb.pl +++ b/crypto/sha/asm/sha1-thumb.pl @@ -262,4 +262,4 @@ $code.=<<___; ___ print $code; -close STDOUT; # enforce flush +close STDOUT or die "error closing STDOUT"; # enforce flush diff --git a/crypto/sha/asm/sha1-x86_64.pl b/crypto/sha/asm/sha1-x86_64.pl index 315f3d89b2..7ed39165ef 100755 --- a/crypto/sha/asm/sha1-x86_64.pl +++ b/crypto/sha/asm/sha1-x86_64.pl @@ -2131,4 +2131,4 @@ foreach (split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha256-586.pl b/crypto/sha/asm/sha256-586.pl index 33bb8a74e3..962e1e9aae 100644 --- a/crypto/sha/asm/sha256-586.pl +++ b/crypto/sha/asm/sha256-586.pl @@ -1292,4 +1292,4 @@ sub bodyx_00_15 () { # +10% &asm_finish(); -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha256-armv4.pl b/crypto/sha/asm/sha256-armv4.pl index 80c697e00c..f20840d2b9 100644 --- a/crypto/sha/asm/sha256-armv4.pl +++ b/crypto/sha/asm/sha256-armv4.pl @@ -739,4 +739,4 @@ foreach (split($/,$code)) { print $_,"\n"; } -close STDOUT; # enforce flush +close STDOUT or die "error closing STDOUT"; # enforce flush diff --git a/crypto/sha/asm/sha256-c64xplus.pl b/crypto/sha/asm/sha256-c64xplus.pl index 480b49e4d0..8dba0c84e0 100644 --- a/crypto/sha/asm/sha256-c64xplus.pl +++ b/crypto/sha/asm/sha256-c64xplus.pl @@ -316,4 +316,4 @@ K256: ___ print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha256-mb-x86_64.pl b/crypto/sha/asm/sha256-mb-x86_64.pl index 99d786a276..2f939781cc 100644 --- a/crypto/sha/asm/sha256-mb-x86_64.pl +++ b/crypto/sha/asm/sha256-mb-x86_64.pl @@ -1613,4 +1613,4 @@ foreach (split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha512-586.pl b/crypto/sha/asm/sha512-586.pl index c20a673dfc..78cafda6a2 100644 --- a/crypto/sha/asm/sha512-586.pl +++ b/crypto/sha/asm/sha512-586.pl @@ -921,4 +921,4 @@ sub BODY_00_15_ssse3 { # "phase-less" copy of BODY_00_15_sse2 &asm_finish(); -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha512-armv4.pl b/crypto/sha/asm/sha512-armv4.pl index 410dde2cde..7c6ac41b5b 100644 --- a/crypto/sha/asm/sha512-armv4.pl +++ b/crypto/sha/asm/sha512-armv4.pl @@ -677,4 +677,4 @@ while(<SELF>) { close SELF; print $code; -close STDOUT; # enforce flush +close STDOUT or die "error closing STDOUT"; # enforce flush diff --git a/crypto/sha/asm/sha512-armv8.pl b/crypto/sha/asm/sha512-armv8.pl index 2051157cca..228b643c83 100644 --- a/crypto/sha/asm/sha512-armv8.pl +++ b/crypto/sha/asm/sha512-armv8.pl @@ -891,4 +891,4 @@ foreach(split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha512-c64xplus.pl b/crypto/sha/asm/sha512-c64xplus.pl index b7a12544b9..14b6bb5ab6 100644 --- a/crypto/sha/asm/sha512-c64xplus.pl +++ b/crypto/sha/asm/sha512-c64xplus.pl @@ -434,4 +434,4 @@ K512: ___ print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha512-mips.pl b/crypto/sha/asm/sha512-mips.pl index c581bdcb04..5f585eb91d 100644 --- a/crypto/sha/asm/sha512-mips.pl +++ b/crypto/sha/asm/sha512-mips.pl @@ -524,4 +524,4 @@ ___ $code =~ s/\`([^\`]*)\`/eval $1/gem; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha512-parisc.pl b/crypto/sha/asm/sha512-parisc.pl index f406426928..17a304cb80 100755 --- a/crypto/sha/asm/sha512-parisc.pl +++ b/crypto/sha/asm/sha512-parisc.pl @@ -807,4 +807,4 @@ foreach (split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha512-ppc.pl b/crypto/sha/asm/sha512-ppc.pl index 722621ec3f..f5c4138d0c 100755 --- a/crypto/sha/asm/sha512-ppc.pl +++ b/crypto/sha/asm/sha512-ppc.pl @@ -799,4 +799,4 @@ ___ $code =~ s/\`([^\`]*)\`/eval $1/gem; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha512-s390x.pl b/crypto/sha/asm/sha512-s390x.pl index 65cb883166..78d710c30e 100644 --- a/crypto/sha/asm/sha512-s390x.pl +++ b/crypto/sha/asm/sha512-s390x.pl @@ -323,4 +323,4 @@ $code =~ s/\`([^\`]*)\`/eval $1/gem; $code =~ s/(srlg\s+)(%r[0-9]+),/$1$2,$2,/gm; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha512-sparcv9.pl b/crypto/sha/asm/sha512-sparcv9.pl index fca6e863da..11dd8d6117 100644 --- a/crypto/sha/asm/sha512-sparcv9.pl +++ b/crypto/sha/asm/sha512-sparcv9.pl @@ -856,4 +856,4 @@ foreach (split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha512-x86_64.pl b/crypto/sha/asm/sha512-x86_64.pl index 7ecded191c..7c7cb23cd7 100755 --- a/crypto/sha/asm/sha512-x86_64.pl +++ b/crypto/sha/asm/sha512-x86_64.pl @@ -2557,4 +2557,4 @@ foreach (split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT"; diff --git a/crypto/sha/asm/sha512p8-ppc.pl b/crypto/sha/asm/sha512p8-ppc.pl index 9ee3ed7734..ea3d308373 100755 --- a/crypto/sha/asm/sha512p8-ppc.pl +++ b/crypto/sha/asm/sha512p8-ppc.pl @@ -420,4 +420,4 @@ ___ $code =~ s/\`([^\`]*)\`/eval $1/gem; print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT"; |