-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] line wrapping for grade cap #2567
Comments
(continuation from above comment) It does actually seem like it wraps, if I make my terminal smaller; though the array sorting makes it behave incorrectly
diff --git a/testssl.sh b/testssl.sh
index 4068440..fd991a3 100755
--- a/testssl.sh
+++ b/testssl.sh
@@ -7691,6 +7691,7 @@ determine_trust() {
fi
fileout "${jsonID}${json_postfix}" "CRITICAL" "failed $code. $addtl_warning"
set_grade_cap "T" "Issues with the chain of trust $code"
+ set_grade_cap "T" "$(out_row_aligned_max_width 'STARTTLS encryption is not mandatory for clients. STARTTLS can only be secured clientside' ' ' $TERM_WIDTH)"
else
# alt least one ok and other(s) not ==> display the culprit store(s)
if "$some_ok"; then
|
Now we're on the same page. 😃 But the wrapped part of the line is not where it should be, that's also what I experienced. |
hmm, it is definitely the sorting that breaks it:
diff --git a/testssl.sh b/testssl.sh
index 4068440..f17663b 100755
--- a/testssl.sh
+++ b/testssl.sh
@@ -7691,6 +7691,7 @@ determine_trust() {
fi
fileout "${jsonID}${json_postfix}" "CRITICAL" "failed $code. $addtl_warning"
set_grade_cap "T" "Issues with the chain of trust $code"
+ set_grade_cap "T" "$(out_row_aligned_max_width 'STARTTLS encryption is not mandatory for clients. STARTTLS can only be secured clientside' ' ' $TERM_WIDTH)"
else
# alt least one ok and other(s) not ==> display the culprit store(s)
if "$some_ok"; then
@@ -23125,7 +23126,7 @@ run_rating() {
fi
# Pretty print - again, it's just nicer to read
- for reason in "${sorted_reasons[@]}"; do
+ for reason in "${GRADE_CAP_REASONS[@]}"; do
if [[ $reason_nr -eq 0 ]]; then
pr_bold " Grade cap reasons "; outln "$reason"
else Though I have no good off-the-top-of-my-head fixes. We use IFS=$'\n' sorted_reasons=($(sort -ru <<<"${GRADE_CAP_REASONS[*]}")) So we can't also keep multiline "reasons" with |
Tanks for the explanation. Guess better would be then in the for-loop to use |
proper line wrapping, see #2564 (comment)
The text was updated successfully, but these errors were encountered: