Skip to content

Commit ee7a21e

Browse files
authored
Merge pull request #1698 from drwetter/mitigate_javastore4rating
Don't penalize rating for CAs which aren't in the Java store
2 parents 186dcfa + 4653613 commit ee7a21e

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Don't use external pwd anymore
1717
* STARTTLS: XMPP server support
1818
* Rating (SSL Labs, not complete)
19+
* Don't penalize missing trust in rating when CA not in Java store
1920
* Added support for certificates with EdDSA signatures and pubilc keys
2021

2122
### Features implemented / improvements in 3.0

testssl.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7221,10 +7221,9 @@ determine_trust() {
72217221
# we did to stdout the warning above already, so we could stay here with OK:
72227222
fileout "${jsonID}${json_postfix}" "OK" "passed. $addtl_warning"
72237223
else
7224-
# at least one failed
72257224
pr_svrty_critical "NOT ok"
72267225
if ! "$some_ok"; then
7227-
# all failed (we assume with the same issue), we're displaying the reason
7226+
# ALL failed (we assume with the same issue), we're displaying the reason
72287227
out " "
72297228
code="$(verify_retcode_helper "${verify_retcode[1]}")"
72307229
if [[ "$code" =~ "pls report" ]]; then
@@ -7235,15 +7234,13 @@ determine_trust() {
72357234
fileout "${jsonID}${json_postfix}" "CRITICAL" "failed $code. $addtl_warning"
72367235
set_grade_cap "T" "Issues with the chain of trust $code"
72377236
else
7238-
# is one ok and the others not ==> display the culprit store
7237+
# alt least one ok and other(s) not ==> display the culprit store(s)
72397238
if "$some_ok"; then
72407239
pr_svrty_critical ":"
7241-
for ((i=1;i<=num_ca_bundles;i++)); do
7240+
for (( i=1; i<=num_ca_bundles; i++ )); do
72427241
if ${trust[i]}; then
72437242
ok_was="${certificate_file[i]} $ok_was"
72447243
else
7245-
#code="$(verify_retcode_helper ${verify_retcode[i]})"
7246-
#notok_was="${certificate_file[i]} $notok_was"
72477244
pr_svrty_high " ${certificate_file[i]} "
72487245
code="$(verify_retcode_helper "${verify_retcode[i]}")"
72497246
if [[ "$code" =~ "pls report" ]]; then
@@ -7252,11 +7249,13 @@ determine_trust() {
72527249
out "$code"
72537250
fi
72547251
notok_was="${certificate_file[i]} $code $notok_was"
7255-
set_grade_cap "T" "Issues with chain of trust $code"
7252+
if ! [[ ${certificate_file[i]} =~ Java ]]; then
7253+
# Exemption for Java AND rating, as this store doesn't seem to be as complete.
7254+
# We won't penelize this but we still need to raise a red flag. See #1648
7255+
set_grade_cap "T" "Issues with chain of trust $code"
7256+
fi
72567257
fi
72577258
done
7258-
#pr_svrty_high "$notok_was "
7259-
#outln "$code"
72607259
outln
72617260
# lf + green ones
72627261
[[ "$DEBUG" -eq 0 ]] && tm_out "$spaces"
@@ -7269,7 +7268,6 @@ determine_trust() {
72697268
outln
72707269
return 0
72717270
}
7272-
72737271
# not handled: Root CA supplied ("contains anchor" in SSLlabs terminology)
72747272

72757273
tls_time() {

0 commit comments

Comments
 (0)