diff --git a/testssl.sh b/testssl.sh index 00981bd..b98d7db 100755 --- a/testssl.sh +++ b/testssl.sh @@ -100,14 +100,11 @@ SNEAKY=${SNEAKY:-false} # is the referer and useragent we leave behind just u QUIET=${QUIET:-false} # don't output the banner. By doing this yiu acknowledge usage term appearing in the banner SSL_NATIVE=${SSL_NATIVE:-false} # we do per default bash sockets where possible "true": switch back to "openssl native" ASSUMING_HTTP=${ASSUMING_HTTP:-false} # in seldom cases (WAF, old servers, grumpy SSL) service detection fails. "True" enforces HTTP checks -DEBUG=${DEBUG:-0} # if 1 the temp files won't be erased. 2: list more what's going on (formerly: eq VERBOSE=1), - # 3: slight hexdumps + other info, 4: send bytes via sockets, 5: received, 6: whole 9 yards - # FIXME: still to be filled with (more) sense or following to be included: -VERBERR=${VERBERR:-false} # true means to be more verbose (handshake errors to be displayed so that one can tell better - # whether handshake succeeded or not. While testing individual ciphers you also need to have SHOW_EACH_C=1 - #FIXME: only a few functions support this +DEBUG=${DEBUG:-0} # 1.: the temp files won't be erased. + # 2: list more what's going on (formerly: eq VERBOSE=1, VERBERR=true), lists some errors of connections + # 3: slight hexdumps + other info, + # 4: display bytes sent via sockets, 5: display bytes received via sockets, 6: whole 9 yards WIDE=${WIDE:-false} # whether to display for some options the cipher or the table with hexcode/KX,Enc,strength etc. - HEADER_MAXSLEEP=${HEADER_MAXSLEEP:-5} # we wait this long before killing the process to retrieve a service banner / http header readonly MAX_WAITSOCK=10 # waiting at max 10 seconds for socket reply readonly CCS_MAX_WAITSOCK=5 # for the two CCS payload (each) @@ -359,8 +356,8 @@ debugme() { } hex2dec() { - /usr/bin/printf -- "%d" 0x"$1" - #echo $((16#$1)) + #/usr/bin/printf -- "%d" 0x"$1" + echo $((16#$1)) } dec2hex() { @@ -1313,8 +1310,9 @@ run_prototest_openssl() { $OPENSSL s_client -state $1 $STARTTLS -connect $NODEIP:$PORT $PROXY $sni &>$TMPFILE need to read the error - $VERBERR && egrep "error|failure" $TMPFILE | egrep -av "unable to get local|verify error" +# FIXME: here FreeBSD9/openssl 0.9.8 returns always 0 --> need to read the error but for now we DO NOT SUPPORT this platform. +# that's where the binaries are for! + [[ $DEBUG -eq 2 ]] && egrep "error|failure" $TMPFILE | egrep -av "unable to get local|verify error" if ! locally_supported "$1" "$2" ; then ret=7 @@ -1764,9 +1762,9 @@ run_server_defaults() { ret=7 done # this loop is needed for IIS/6 if [ $ret -eq 7 ]; then - # "-status" kills GOST only servers, so we do another test without it and see whether that works then: + # "-status" above doesn't work for GOST only servers, so we do another test without it and see whether that works then: if ! $OPENSSL s_client $STARTTLS -connect $NODEIP:$PORT $PROXY $SNI -$proto -tlsextdebug >$ERRFILE >$TMPFILE; then - pr_magentaln "$OPENSSL returned an error around line $LINENO". + pr_magentaln "Strange, no SSL/TLS protocol seems to be supported (error around line $((LINENO - 6)))" tmpfile_handle tlsextdebug+status.txt return 7 # this is ugly, I know else @@ -3087,8 +3085,7 @@ run_crime() { # fi # fi # fi - $VERBERR && outln "$STR" - #echo +# [[ $DEBUG -eq 2 ]] outln "$STR" tmpfile_handle $FUNCNAME.txt return $ret } @@ -3166,7 +3163,7 @@ run_ssl_poodle() { debugme echo $cbc_ciphers $OPENSSL s_client -ssl3 $STARTTLS -cipher $cbc_ciphers -connect $NODEIP:$PORT $PROXY $SNI &>$TMPFILE $TMPFILE $TMPFILE