From 932b8084f40f4ed254010d939f05533ac5d5b2e2 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Tue, 22 Feb 2022 04:40:31 +0000 Subject: [PATCH] Enable selectively disabling low-level file and data hash functions Use $request_fixed_hash to cause the final OpenSSL function to return a fixed hash and not hash either files or data. Signed-off-by: Richard T Bonhomme --- easytls | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/easytls b/easytls index cde780c..6d69111 100755 --- a/easytls +++ b/easytls @@ -1892,16 +1892,17 @@ openssl_generate_empty_hash () # OpenSSL hash file openssl_generate_file_hash () { - #[ -n "${request_fixed_hash}" ] && \ - # "${EASYTLS_PRINTF}" '%s\n' "${fixed_hash}" && return 0 + [ -n "${request_fixed_hash}" ] && \ + "${EASYTLS_PRINTF}" '%s\n' "${fixed_hash}" && return 0 + "${EASYRSA_OPENSSL}" dgst -"${EASYTLS_HASH_ALGO}" -r "${1}" || return 1 } # => openssl_generate_file_hash () # OpenSSL hash data openssl_generate_data_hash () { - #[ -n "${request_fixed_hash}" ] && \ - # "${EASYTLS_PRINTF}" '%s\n' "${fixed_hash}" && return 0 + [ -n "${request_fixed_hash}" ] && \ + "${EASYTLS_PRINTF}" '%s\n' "${fixed_hash}" && return 0 "${EASYRSA_OPENSSL}" dgst -"${EASYTLS_HASH_ALGO}" -r || return 1 } # => openssl_generate_data_hash ()