Skip to content

Commit

Permalink
Fix #944 - Show all detected TLS versions for mail test (ref #512)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsasha committed Apr 18, 2023
1 parent fb24185 commit 234c6d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions checks/categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -1647,11 +1647,11 @@ def result_phase_out(self, tech_data):
self.verdict = "detail mail tls version verdict phase-out"
self.tech_data = tech_data

def result_good(self):
def result_good(self, tech_data):
self.was_tested()
self._status(STATUS_SUCCESS)
self.verdict = "detail mail tls version verdict good"
self.tech_data = ""
self.tech_data = tech_data

def result_bad(self, tech_data):
self.was_tested()
Expand Down
8 changes: 6 additions & 2 deletions checks/tasks/tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,8 @@ def save_results(model, results, addr, domain, category):
model.cipher_order = result.get("cipher_order")
model.cipher_order_score = result.get("cipher_order_score")
model.cipher_order_violation = result.get("cipher_order_violation")
model.protocols_good = result.get("prots_good")
model.protocols_sufficient = result.get("prots_sufficient")
model.protocols_bad = result.get("prots_bad")
model.protocols_phase_out = result.get("prots_phase_out")
model.protocols_score = result.get("prots_score")
Expand Down Expand Up @@ -972,13 +974,15 @@ def annotate_and_combine_all(good_items, sufficient_items, bad_items, phaseout_i
else:
category.subtests["tls_cipher_order"].result_good()

protocols_all = annotate_and_combine(dttls.protocols_bad, dttls.protocols_phase_out)
protocols_all = annotate_and_combine_all(
dttls.protocols_good, dttls.protocols_sufficient, dttls.protocols_bad, dttls.protocols_phase_out
)
if len(dttls.protocols_bad) > 0:
category.subtests["tls_version"].result_bad(protocols_all)
elif len(dttls.protocols_phase_out) > 0:
category.subtests["tls_version"].result_phase_out(protocols_all)
else:
category.subtests["tls_version"].result_good()
category.subtests["tls_version"].result_good(protocols_all)

if dttls.compression:
category.subtests["tls_compression"].result_bad()
Expand Down

0 comments on commit 234c6d5

Please sign in to comment.