From 7c55288a7ed95e6d96a8da31355e88e242c367a9 Mon Sep 17 00:00:00 2001 From: Julien Vehent Date: Wed, 20 Nov 2013 10:47:59 -0500 Subject: [PATCH] Fix test of all ciphers individually --- CiphersScan.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CiphersScan.sh b/CiphersScan.sh index 1e0dee2..b664d56 100755 --- a/CiphersScan.sh +++ b/CiphersScan.sh @@ -170,17 +170,16 @@ for result in "${results[@]}"; do echo $result|grep -v '(NONE)' done|column -t +# If asked, test every single cipher individually if [ $ALLCIPHERS -gt 0 ]; then echo; echo "All accepted ciphersuites" - for cipher in $($OPENSSLBIN ciphers -v ALL:COMPLEMENTOFALL 2>/dev/null |awk '{print $1}'|sort|uniq); do - osslcommand="timeout $TIMEOUT $OPENSSLBIN s_client -connect $TARGET -cipher $cipher" + for c in $($OPENSSLBIN ciphers -v ALL:COMPLEMENTOFALL 2>/dev/null |awk '{print $1}'|sort|uniq); do + r="fail" + osslcommand="timeout $TIMEOUT $OPENSSLBIN s_client -connect $TARGET -cipher $c" test_cipher_on_target "$osslcommand" - r=$? - if [ $r -eq 0 ]; then - echo -en '\E[40;32m'"OK"; tput sgr0 - else - echo -en '\E[40;31m'"KO"; tput sgr0 + if [ $? -eq 0 ]; then + r="pass" fi - echo " $cipher" + echo "$c $r"|awk '{printf "%-35s %s\n",$1,$2}' done fi