2
0
mirror of https://github.com/mozilla/cipherscan.git synced 2024-11-26 07:53:41 +01:00

verify that the openssl binary is emitting a valid s_client -help.

This catches instances where the wrong openssl binary is selected (for
instance, if uname -s is neither Darwin nor Linux) and serves as a
simple up-front test to make sure that openssl is working before we
proceed further into the script.
This commit is contained in:
Richard Soderberg 2015-09-03 07:02:38 -07:00
parent 9a0e055628
commit 22adaf188a

View File

@ -20,6 +20,10 @@ else
OPENSSLBIN="${REALPATH}/openssl" OPENSSLBIN="${REALPATH}/openssl"
fi fi
OPENSSLBINHELP="$($OPENSSLBIN s_client -help 2>&1)" OPENSSLBINHELP="$($OPENSSLBIN s_client -help 2>&1)"
if ! [[ $OPENSSLBINHELP =~ -connect ]]; then
echo "$OPENSSLBIN s_client doesn't accept the -connect parameter, which is extremely strange; refusing to proceed." 1>&2
exit 1
fi
# cipherscan requires bash4, which doesn't come by default in OSX # cipherscan requires bash4, which doesn't come by default in OSX
if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then