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:
parent
818bf29b02
commit
d7bddb7cc9
11
cipherscan
11
cipherscan
@ -251,6 +251,10 @@ test_cipher_on_target() {
|
|||||||
ratelimit
|
ratelimit
|
||||||
debug echo \"Q\" \| $cmnd $tls_version
|
debug echo \"Q\" \| $cmnd $tls_version
|
||||||
local tmp=$(echo "Q" | $cmnd $tls_version 1>/dev/stdout 2>/dev/null)
|
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"
|
parse_openssl_output <<<"$tmp"
|
||||||
verbose "selected cipher is '$current_cipher'"
|
verbose "selected cipher is '$current_cipher'"
|
||||||
@ -403,7 +407,6 @@ bench_cipher() {
|
|||||||
# Connect to the target and retrieve the chosen cipher
|
# Connect to the target and retrieve the chosen cipher
|
||||||
# recursively until the connection fails
|
# recursively until the connection fails
|
||||||
get_cipher_pref() {
|
get_cipher_pref() {
|
||||||
[ "$OUTPUTFORMAT" == "terminal" ] && [ $DEBUG -lt 1 ] && echo -n '.'
|
|
||||||
local ciphersuite="$1"
|
local ciphersuite="$1"
|
||||||
|
|
||||||
local sslcommand="$TIMEOUTBIN $TIMEOUT $OPENSSLBIN s_client"
|
local sslcommand="$TIMEOUTBIN $TIMEOUT $OPENSSLBIN s_client"
|
||||||
@ -419,6 +422,7 @@ get_cipher_pref() {
|
|||||||
local success=$?
|
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 [ $success -eq 0 ]; then
|
||||||
|
[ "$OUTPUTFORMAT" == "terminal" ] && [ $DEBUG -lt 1 ] && echo -n '.'
|
||||||
cipherspref=("${cipherspref[@]}" "$result")
|
cipherspref=("${cipherspref[@]}" "$result")
|
||||||
ciphercertificates=("${ciphercertificates[@]}" "$certificates")
|
ciphercertificates=("${ciphercertificates[@]}" "$certificates")
|
||||||
pciph=($result)
|
pciph=($result)
|
||||||
@ -698,9 +702,14 @@ debug "sclientargs: $SCLIENTARGS"
|
|||||||
cipherspref=();
|
cipherspref=();
|
||||||
ciphercertificates=()
|
ciphercertificates=()
|
||||||
results=()
|
results=()
|
||||||
|
couldconnect=false
|
||||||
|
|
||||||
# Call to the recursive loop that retrieves the cipher preferences
|
# Call to the recursive loop that retrieves the cipher preferences
|
||||||
get_cipher_pref $CIPHERSUITE
|
get_cipher_pref $CIPHERSUITE
|
||||||
|
if ! $couldconnect; then
|
||||||
|
echo "Could not connect to $TARGET"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
test_serverside_ordering
|
test_serverside_ordering
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user