diff --git a/cipherscan b/cipherscan index 16d2818..defbf60 100755 --- a/cipherscan +++ b/cipherscan @@ -19,6 +19,7 @@ if [[ "$(uname -s)" == "Darwin" ]]; then else OPENSSLBIN="${REALPATH}/openssl" fi +OPENSSLBINHELP="$($OPENSSLBIN s_client -help 2>&1)" # cipherscan requires bash4, which doesn't come by default in OSX if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then @@ -295,18 +296,8 @@ c_hash() { done } -crude_grep() { - while read line; do - if [[ $line =~ $1 ]]; then - return 0 - fi - done - return 1 -} - check_option_support() { - $OPENSSLBIN s_client -help 2>&1 | crude_grep "$1" - return $? + [[ $OPENSSLBINHELP =~ "$1" ]] } parse_openssl_output() {