2
0
mirror of https://github.com/mozilla/cipherscan.git synced 2024-11-04 15:03:41 +01:00

Replace unnecessary test of command; if $? with if command.

This commit is contained in:
Richard Soderberg 2015-09-05 02:17:49 -07:00
parent fc71ed7204
commit 9e3154389e

View File

@ -651,10 +651,8 @@ get_cipher_pref() {
sslcommand+=" -status $SCLIENTARGS -connect $TARGET -cipher $ciphersuite"
verbose "Connecting to '$TARGET' with ciphersuite '$ciphersuite'"
test_cipher_on_target "$sslcommand"
local success=$?
# If the connection succeeded with the current cipher, benchmark and store
if [[ $success -eq 0 ]]; then
if test_cipher_on_target "$sslcommand"; then
cipherspref=("${cipherspref[@]}" "$result")
ciphercertificates=("${ciphercertificates[@]}" "$certificates")
pciph=($result)
@ -1510,8 +1508,7 @@ if [[ -n $ALLCIPHERS ]]; then
for c in $($OPENSSLBIN ciphers -v ALL:COMPLEMENTOFALL 2>/dev/null |awk '{print $1}'|sort -u); do
r="fail"
osslcommand="$TIMEOUTBIN $TIMEOUT $OPENSSLBIN s_client $SCLIENTARGS -connect $TARGET -cipher $c"
test_cipher_on_target "$osslcommand"
if [[ $? -eq 0 ]]; then
if test_cipher_on_target "$osslcommand"; then
r="pass"
fi
echo "$c $r"|awk '{printf "%-35s %s\n",$1,$2}'