Skip to content

Commit

Permalink
Enable selectively disabling low-level file and data hash functions
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
TinCanTech committed Feb 22, 2022
1 parent e93457a commit 932b808
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions easytls
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand Down

1 comment on commit 932b808

@TinCanTech
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.