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

Show message when no connection could be made

No need to show results in that case
The progress dot only shows for each succesful connection
This commit is contained in:
Peter Mosmans 2014-11-14 11:24:39 +11:00
parent 818bf29b02
commit d7bddb7cc9

View File

@ -251,6 +251,10 @@ test_cipher_on_target() {
ratelimit
debug echo \"Q\" \| $cmnd $tls_version
local tmp=$(echo "Q" | $cmnd $tls_version 1>/dev/stdout 2>/dev/null)
if ! [ -z "$tmp" ] ; then
verbose "response received from server"
couldconnect=true
fi
parse_openssl_output <<<"$tmp"
verbose "selected cipher is '$current_cipher'"
@ -403,7 +407,6 @@ bench_cipher() {
# Connect to the target and retrieve the chosen cipher
# recursively until the connection fails
get_cipher_pref() {
[ "$OUTPUTFORMAT" == "terminal" ] && [ $DEBUG -lt 1 ] && echo -n '.'
local ciphersuite="$1"
local sslcommand="$TIMEOUTBIN $TIMEOUT $OPENSSLBIN s_client"
@ -419,6 +422,7 @@ get_cipher_pref() {
local success=$?
# If the connection succeeded with the current cipher, benchmark and store
if [ $success -eq 0 ]; then
[ "$OUTPUTFORMAT" == "terminal" ] && [ $DEBUG -lt 1 ] && echo -n '.'
cipherspref=("${cipherspref[@]}" "$result")
ciphercertificates=("${ciphercertificates[@]}" "$certificates")
pciph=($result)
@ -698,9 +702,14 @@ debug "sclientargs: $SCLIENTARGS"
cipherspref=();
ciphercertificates=()
results=()
couldconnect=false
# Call to the recursive loop that retrieves the cipher preferences
get_cipher_pref $CIPHERSUITE
if ! $couldconnect; then
echo "Could not connect to $TARGET"
exit 1
fi
test_serverside_ordering