From e1600e3f6250bcefa859032f506929aa6ea99151 Mon Sep 17 00:00:00 2001 From: David Cooper Date: Wed, 8 Dec 2021 14:13:10 -0500 Subject: [PATCH] Fix JSON section headers This commit fixes two issues with the headers in the structured JSON output. First, if run_cipher_match() is performed the header this is used is "pretest" rather than "singleCipher". Second, the headers for "serverPreferences" and "fs" are swapped. --- testssl.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testssl.sh b/testssl.sh index 9b9c0f8..241d177 100755 --- a/testssl.sh +++ b/testssl.sh @@ -1154,8 +1154,8 @@ fileout_json_section() { 2) echo -e ",\n \"protocols\" : [" ;; 3) echo -e ",\n \"grease\" : [" ;; 4) echo -e ",\n \"ciphers\" : [" ;; - 5) echo -e ",\n \"fs\" : [" ;; - 6) echo -e ",\n \"serverPreferences\" : [" ;; + 5) echo -e ",\n \"serverPreferences\" : [" ;; + 6) echo -e ",\n \"fs\" : [" ;; 7) echo -e ",\n \"serverDefaults\" : [" ;; 8) echo -e ",\n \"headerResponse\" : [" ;; 9) echo -e ",\n \"vulnerabilities\" : [" ;; @@ -23062,6 +23062,7 @@ lets_roll() { fi if "$do_cipher_match"; then # we will have an invalid JSON with no if statement + ((section_number++)) fileout_section_header $section_number false run_cipher_match ${single_cipher} stopwatch run_cipher_match