2
0
mirror of https://github.com/mozilla/cipherscan.git synced 2024-11-26 07:53: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" sslcommand+=" -status $SCLIENTARGS -connect $TARGET -cipher $ciphersuite"
verbose "Connecting to '$TARGET' with ciphersuite '$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 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") cipherspref=("${cipherspref[@]}" "$result")
ciphercertificates=("${ciphercertificates[@]}" "$certificates") ciphercertificates=("${ciphercertificates[@]}" "$certificates")
pciph=($result) 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 for c in $($OPENSSLBIN ciphers -v ALL:COMPLEMENTOFALL 2>/dev/null |awk '{print $1}'|sort -u); do
r="fail" r="fail"
osslcommand="$TIMEOUTBIN $TIMEOUT $OPENSSLBIN s_client $SCLIENTARGS -connect $TARGET -cipher $c" osslcommand="$TIMEOUTBIN $TIMEOUT $OPENSSLBIN s_client $SCLIENTARGS -connect $TARGET -cipher $c"
test_cipher_on_target "$osslcommand" if test_cipher_on_target "$osslcommand"; then
if [[ $? -eq 0 ]]; then
r="pass" r="pass"
fi fi
echo "$c $r"|awk '{printf "%-35s %s\n",$1,$2}' echo "$c $r"|awk '{printf "%-35s %s\n",$1,$2}'