diff options
author | David Benjamin <davidben@google.com> | 2020-02-17 12:21:27 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2020-02-17 12:21:27 +1000 |
commit | 218e740f850f77c9f2720d56886eab166d1a6727 (patch) | |
tree | f1691e347bca452b568a9df238f15098d95ba88c /crypto/des | |
parent | 57225c99ef848f0d0d1a7ab586a61ef71740f1ff (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/des')
-rw-r--r-- | crypto/des/asm/crypt586.pl | 2 | ||||
-rw-r--r-- | crypto/des/asm/des-586.pl | 2 | ||||
-rw-r--r-- | crypto/des/asm/dest4-sparcv9.pl | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/crypto/des/asm/crypt586.pl b/crypto/des/asm/crypt586.pl index a02d180631..3bd6b8a7f8 100644 --- a/crypto/des/asm/crypt586.pl +++ b/crypto/des/asm/crypt586.pl @@ -25,7 +25,7 @@ $R="esi"; &fcrypt_body("fcrypt_body"); &asm_finish(); -close STDOUT; +close STDOUT or die "error closing STDOUT: $!"; sub fcrypt_body { diff --git a/crypto/des/asm/des-586.pl b/crypto/des/asm/des-586.pl index 2bcc54ef2f..49cf6bd173 100644 --- a/crypto/des/asm/des-586.pl +++ b/crypto/des/asm/des-586.pl @@ -47,7 +47,7 @@ $small_footprint=1 if (grep(/\-DOPENSSL_SMALL_FOOTPRINT/,@ARGV)); &asm_finish(); -close STDOUT; +close STDOUT or die "error closing STDOUT: $!"; sub DES_encrypt_internal() { diff --git a/crypto/des/asm/dest4-sparcv9.pl b/crypto/des/asm/dest4-sparcv9.pl index fe1fdc7025..a67af1def6 100644 --- a/crypto/des/asm/dest4-sparcv9.pl +++ b/crypto/des/asm/dest4-sparcv9.pl @@ -624,4 +624,4 @@ ___ &emit_assembler(); -close STDOUT; +close STDOUT or die "error closing STDOUT: $!"; |