This repository was archived by the owner on May 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,14 +136,16 @@ run_safety_checks() {
136136
137137# unset the cipher variable if it is not supported by openssl
138138validate_cipher () {
139- # Support for OpenSSL versions after and before 1.1.0
140- local list_cipher_commands= " openssl list-cipher-commands"
141- if [[ $( $list_cipher_commands 2> /dev/null ) ]] ; then
142- local supported= $( openssl list-cipher-commands | grep --line-regexp " $cipher " )
139+ local list_cipher_commands
140+ if openssl list-cipher-commands & > /dev/null ; then
141+ # OpenSSL < v1.1.0
142+ list_cipher_commands= ' openssl list-cipher-commands'
143143 else
144- list_cipher_commands= " openssl list -cipher-commands "
145- local supported= $( openssl list -cipher-commands | tr -s ' ' ' \n ' | grep --line-regexp " $cipher " )
144+ # OpenSSL >= v1.1.0
145+ list_cipher_commands= ' openssl list -cipher-commands'
146146 fi
147+
148+ local supported=$( $list_cipher_commands | tr -s ' ' ' \n' | grep --line-regexp " $cipher " )
147149 if [[ ! $supported ]]; then
148150 if [[ $interactive ]]; then
149151 printf ' "%s" is not a valid cipher; choose one of the following:\n\n' " $cipher "
You can’t perform that action at this time.
0 commit comments