From 5d7ec3a714a8c3ade2c9a85046d4d85c55a6addb Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sat, 5 Apr 2014 01:33:33 +0200 Subject: [PATCH] add ability to ignore results from untrusted servers --- top1m/parse_results.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/top1m/parse_results.py b/top1m/parse_results.py index 0a9817b..51b84c1 100644 --- a/top1m/parse_results.py +++ b/top1m/parse_results.py @@ -9,6 +9,8 @@ import sys from collections import defaultdict import os +report_untrused=False + cipherstats = defaultdict(int) pfsstats = defaultdict(int) protocolstats = defaultdict(int) @@ -43,6 +45,7 @@ for r,d,flist in os.walk(path): TLS1_2 = False dualstack = False ECDSA = False + trusted = False """ process the file """ f_abs = os.path.join(r,f) @@ -57,11 +60,12 @@ for r,d,flist in os.walk(path): if len(results['ciphersuite']) < 1: continue - total += 1 - """ loop over list of ciphers """ for entry in results['ciphersuite']: + if 'True' in entry['trusted']: + trusted = True + """ store the ciphers supported """ if 'AES-GCM' in entry['cipher']: if not AESGCM: @@ -126,6 +130,12 @@ for r,d,flist in os.walk(path): TLS1_2 = True json_file.close() + """ don't store stats from unusued servers """ + if report_untrused == False and trusted == False: + continue + + total += 1 + """ done with this file, storing the stats """ if DHE or ECDHE: pfsstats['Support PFS'] += 1