Skip to content

Commit 08fe890

Browse files
committed
- two fixes from #40 reported by @salt-lick
1 parent 19fc021 commit 08fe890

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

testssl.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ applicationbanner() {
617617
else
618618
#cat $TMPFILE | sed 's/^.*:/:/' | sed -e :a -e '$!N;s/\n:/ \n\ +/;ta' -e 'P;D' | sed 's/://g'
619619
#sed 's/^/ /g' $TMPFILE | tr -t '\n\r' ' ' | sed "s/\([0-9]\)/$pr_red\1$off/g"
620-
emphasize_stuff_in_headers "$(sed 's/^/ /g' $TMPFILE | tr -t '\n\r' ' ')"
620+
emphasize_stuff_in_headers "$(sed 's/^/ /g' $TMPFILE | tr '\n\r' ' ')"
621621
#i=0
622622
#cat $TMPFILE | sed 's/^/ /' | while read line; do
623623
# out "$line"
@@ -1217,15 +1217,15 @@ cipher_pref_check() {
12171217
$OPENSSL s_client $STARTTLS -"$p" -connect $NODEIP:$PORT $SNI </dev/null 2>/dev/null >$TMPFILE
12181218
if [ $? -eq 0 ]; then
12191219
tested_cipher=""
1220-
proto=$(grep -aw "Protocol" $TMPFILE | sed -e 's/^ \+Protocol \+://' -e 's/ //g')
1221-
cipher=$(grep -aw "Cipher" $TMPFILE | egrep -avw "New|is" | sed -e 's/^ \+Cipher \+://' -e 's/ //g')
1220+
proto=$(grep -aw "Protocol" $TMPFILE | sed -e 's/^.*Protocol.*://' -e 's/ //g')
1221+
cipher=$(grep -aw "Cipher" $TMPFILE | egrep -avw "New|is" | sed -e 's/^.*Cipher.*://' -e 's/ //g')
12221222
outln
12231223
printf " %-10s %s " "$proto:" "$cipher"
12241224
tested_cipher="-"$cipher
12251225
while true; do
12261226
$OPENSSL s_client $STARTTLS -"$p" -cipher "ALL:$tested_cipher" -connect $NODEIP:$PORT $SNI </dev/null 2>/dev/null >$TMPFILE
12271227
[ $? -ne 0 ] && break
1228-
cipher=$(grep -aw "Cipher" $TMPFILE | egrep -avw "New|is" | sed -e 's/^ \+Cipher \+://' -e 's/ //g')
1228+
cipher=$(grep -aw "Cipher" $TMPFILE | egrep -avw "New|is" | sed -e 's/^.*Cipher.*://' -e 's/ //g')
12291229
out "$cipher "
12301230
tested_cipher="$tested_cipher:-$cipher"
12311231
done
@@ -1238,13 +1238,13 @@ cipher_pref_check() {
12381238
protos=$($OPENSSL s_client -host $NODE -port $PORT -nextprotoneg \"\" </dev/null 2>/dev/null | grep -a "^Protocols " | sed -e 's/^Protocols.*server: //' -e 's/,//g')
12391239
for p in $protos; do
12401240
$OPENSSL s_client -host $NODE -port $PORT -nextprotoneg "$p" </dev/null 2>/dev/null >$TMPFILE
1241-
cipher=$(grep -aw "Cipher" $TMPFILE | egrep -avw "New|is" | sed -e 's/^ \+Cipher \+://' -e 's/ //g')
1241+
cipher=$(grep -aw "Cipher" $TMPFILE | egrep -avw "New|is" | sed -e 's/^.*Cipher.*://' -e 's/ //g')
12421242
printf "\n %-10s %s " "$p:" "$cipher"
12431243
tested_cipher="-"$cipher
12441244
while true; do
12451245
$OPENSSL s_client -cipher "ALL:$tested_cipher" -host $NODE -port $PORT -nextprotoneg "$p" </dev/null 2>/dev/null >$TMPFILE
12461246
[ $? -ne 0 ] && break
1247-
cipher=$(grep -aw "Cipher" $TMPFILE | egrep -avw "New|is" | sed -e 's/^ \+Cipher \+://' -e 's/ //g')
1247+
cipher=$(grep -aw "Cipher" $TMPFILE | egrep -avw "New|is" | sed -e 's/^.*Cipher.*://' -e 's/ //g')
12481248
out "$cipher "
12491249
tested_cipher="$tested_cipher:-$cipher"
12501250
done

0 commit comments

Comments
 (0)