From 7a4106e839b8c3033259d66697893765fc468393 Mon Sep 17 00:00:00 2001 From: Thomas Sanders Date: Fri, 10 Jul 2015 17:57:48 +0100 Subject: [PATCH] Fix list-reversal (and comment) Use "tac" (which reverses things) rather than "sort -r" (which will reverse a list only if it was sorted already). Signed-off-by: Thomas Sanders --- testssl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index ca5d9cd..f5d301c 100755 --- a/testssl.sh +++ b/testssl.sh @@ -1439,7 +1439,7 @@ server_preference() { ret=6 else cipher1=$(grep -wa Cipher $TMPFILE | egrep -avw "New|is" | sed -e 's/^ \+Cipher \+://' -e 's/ //g') - list2=$(echo $list1 | tr ':' '\n' | sort -r | tr '\n' ':') # pr_reverse the list + list2=$(echo -n $list1':' | tac -s':' | sed -e 's/:$//') # reverse the list $OPENSSL s_client $STARTTLS -cipher $list2 -connect $NODEIP:$PORT $PROXY $SNI /dev/null >$TMPFILE cipher2=$(grep -wa Cipher $TMPFILE | egrep -avw "New|is" | sed -e 's/^ \+Cipher \+://' -e 's/ //g')