FIX #74 for sed BSD: doesn't like inline \n

headline for BEAST was missing
This commit is contained in:
Dirk 2015-03-15 16:10:14 +01:00
parent 655944bd4d
commit 68695bbad3

View File

@ -2267,6 +2267,7 @@ beast(){
local higher_proto_supported="" local higher_proto_supported=""
local -i ret=0 local -i ret=0
local spaces=" " local spaces=" "
local cr=$'\n'
pr_bold " BEAST"; out " (CVE-2011-3389) " pr_bold " BEAST"; out " (CVE-2011-3389) "
@ -2290,7 +2291,7 @@ beast(){
if [ -z "$detected_cbc_cipher" ]; then if [ -z "$detected_cbc_cipher" ]; then
pr_litegreenln "no CBC ciphers for $(echo $proto | tr '[a-z]' '[A-Z]') (OK)" pr_litegreenln "no CBC ciphers for $(echo $proto | tr '[a-z]' '[A-Z]') (OK)"
else else
detected_cbc_cipher=$(echo "$detected_cbc_cipher" | sed -e 's/ /\n '"${spaces}"'/9' -e 's/ /\n '"${spaces}"'/6' -e 's/ /\n '"${spaces}"'/3') detected_cbc_cipher=$(echo "$detected_cbc_cipher" | sed -e "s/ /\\${cr} ${spaces}/9" -e "s/ /\\${cr} ${spaces}/6" -e "s/ /\\${cr} ${spaces}/3")
[ $ret -eq 1 ] && out "$spaces" [ $ret -eq 1 ] && out "$spaces"
out "$(echo $proto | tr '[a-z]' '[A-Z]'):"; pr_brownln "$detected_cbc_cipher" out "$(echo $proto | tr '[a-z]' '[A-Z]'):"; pr_brownln "$detected_cbc_cipher"
ret=1 ret=1
@ -2934,6 +2935,7 @@ case "$1" in
-A|--beast) -A|--beast)
maketempf maketempf
parse_hn_port "$2" parse_hn_port "$2"
outln; pr_blue "--> Testing for BEAST vulnerability"; outln "\n"
beast beast
exit $? ;; exit $? ;;
-H|--header|--headers) -H|--header|--headers)
@ -2993,6 +2995,6 @@ case "$1" in
exit $ret ;; exit $ret ;;
esac esac
# $Id: testssl.sh,v 1.206 2015/03/15 13:41:33 dirkw Exp $ # $Id: testssl.sh,v 1.207 2015/03/15 15:10:13 dirkw Exp $
# vim:ts=5:sw=5 # vim:ts=5:sw=5