2
0
mirror of https://github.com/mozilla/cipherscan.git synced 2024-11-26 07:53:41 +01:00

Added simple debug function

This commit is contained in:
Pepi Zawodsky 2014-02-08 18:37:30 +01:00
parent 0d93b5d37e
commit 0282ae9209

View File

@ -10,7 +10,7 @@ BENCHMARKITER=30
OPENSSLBIN="$(dirname $0)/openssl" OPENSSLBIN="$(dirname $0)/openssl"
TIMEOUT=10 TIMEOUT=10
CIPHERSUITE="ALL:COMPLEMENTOFALL" CIPHERSUITE="ALL:COMPLEMENTOFALL"
DEBUG=0
VERBOSE=0 VERBOSE=0
ALLCIPHERS=0 ALLCIPHERS=0
OUTPUTFORMAT="terminal" OUTPUTFORMAT="terminal"
@ -37,6 +37,7 @@ Use one of the options below:
-a | --allciphers Test all known ciphers individually at the end. -a | --allciphers Test all known ciphers individually at the end.
-b | --benchmark Activate benchmark mode. -b | --benchmark Activate benchmark mode.
-d | --debug Output ALL the information.
-h | --help Shows this help text. -h | --help Shows this help text.
-j | --json Output results in JSON format. -j | --json Output results in JSON format.
-o | --openssl path/to/your/openssl binary you want to use. -o | --openssl path/to/your/openssl binary you want to use.
@ -51,11 +52,16 @@ EXAMPLES: $0 -starttls xmpp jabber.ccc.de:5222
verbose() { verbose() {
if [ $VERBOSE != 0 ];then if [ $VERBOSE != 0 ]; then
echo $@ echo $@
fi fi
} }
debug(){
if [ $DEBUG == 1 ]; then
echo Debug: "$@"
fi
}
# Connect to a target host with the selected ciphersuite # Connect to a target host with the selected ciphersuite
test_cipher_on_target() { test_cipher_on_target() {
@ -226,6 +232,10 @@ do
DOBENCHMARK=1 DOBENCHMARK=1
shift shift
;; ;;
-d | --debug)
DEBUG=1
shift
;;
--) # End of all options --) # End of all options
shift shift
break break
@ -270,15 +280,15 @@ if [ "$HOST" = "$PORT" ]; then
PORT=443 PORT=443
fi fi
# echo host: $HOST debug "host: $HOST"
# echo port: $PORT debug "Port: $PORT"
TARGET=$HOST:$PORT TARGET=$HOST:$PORT
# echo target: $TARGET debug "target: $TARGET"
SCLIENTARGS=$(sed -e s,${TEMPTARGET},,<<<"${@}") SCLIENTARGS=$(sed -e s,${TEMPTARGET},,<<<"${@}")
# echo sclientargs: $SCLIENTARGS debug "sclientargs: $SCLIENTARGS"
cipherspref=(); cipherspref=();