From 90e10a35b546933b6201d6a8bcd1ca2f22d05914 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Thu, 24 Feb 2022 20:48:40 +0000 Subject: [PATCH] Refactor old_faster_hash() Signed-off-by: Richard T Bonhomme --- easytls | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/easytls b/easytls index d40b0d6..3bef6c5 100755 --- a/easytls +++ b/easytls @@ -9073,27 +9073,32 @@ new_faster_hash () old_faster_hash () { # Generate a single hash of all the files via cat - generated_faster_hash="$( - { - set -- - IFS="${new_line}" + old_IFS="$IFS" + IFS="${new_line}" + set -- - # List inline files - for f in ${inline_file_list}; do set -- "$@" "${f}"; done + # List inline files + for f in ${inline_file_list}; do set -- "$@" "${f}"; done - # List tlskey files - for f in ${tlskey_file_list}; do set -- "$@" "${f}"; done + # List tlskey files + for f in ${tlskey_file_list}; do set -- "$@" "${f}"; done - # List utility files - for f in ${util_file_list}; do set -- "$@" "${f}"; done + # List utility files + for f in ${util_file_list}; do set -- "$@" "${f}"; done - # cat the list - "${EASYTLS_CAT}" "$@" || \ - die "generate_master_hash - # cat the list" + # cat the list + # pipe to SSL + cat_list_hash="$( + "${EASYTLS_CAT}" "$@" | ssl_generate_old_master_data_hash + )" || \ + die "generate_master_hash - generated_faster_hash" - } | ssl_generate_old_master_data_hash + # Use hash + generated_faster_hash="${cat_list_hash}" - )" || die "generate_master_hash - generated_faster_hash" + set -- + IFS="${old_IFS}" + unset old_IFS cat_list_hash } # => old_faster_hash () # Save Master hash