2
0
mirror of https://github.com/mozilla/cipherscan.git synced 2024-11-22 22:33:40 +01:00

parse_results.py: compatibility with old results files

This commit is contained in:
Hubert Kario 2014-06-04 18:52:39 +02:00
parent be0439ef99
commit 7591062bbc

View File

@ -55,7 +55,7 @@ for r,d,flist in os.walk(path):
dualstack = False dualstack = False
ECDSA = False ECDSA = False
trusted = False trusted = False
ocsp_stapling = False ocsp_stapling = None
""" process the file """ """ process the file """
f_abs = os.path.join(r,f) f_abs = os.path.join(r,f)
@ -151,13 +151,15 @@ for r,d,flist in os.walk(path):
tempsigstats[entry['sigalg'][0]] = 1 tempsigstats[entry['sigalg'][0]] = 1
""" save tls ticket hint """ """ save tls ticket hint """
tempticketstats[entry['ticket_hint']] = 1 if 'ticket_hint' in entry:
tempticketstats[entry['ticket_hint']] = 1
""" check if OCSP stapling is supported """ """ check if OCSP stapling is supported """
if entry['ocsp_stapling'] == 'True': if 'ocsp_stapling' in entry:
ocsp_stapling=True if entry['ocsp_stapling'] == 'True':
else: ocsp_stapling=True
ocsp_stapling=False else:
ocsp_stapling=False
""" store the versions of TLS supported """ """ store the versions of TLS supported """
for protocol in entry['protocols']: for protocol in entry['protocols']:
@ -207,7 +209,9 @@ for r,d,flist in os.walk(path):
for s in tempticketstats: for s in tempticketstats:
tickethint[s] += 1 tickethint[s] += 1
if ocsp_stapling: if ocsp_stapling is None:
ocspstaple['Unknown'] += 1
elif ocsp_stapling:
ocspstaple['Supported'] += 1 ocspstaple['Supported'] += 1
else: else:
ocspstaple['Unsupported'] += 1 ocspstaple['Unsupported'] += 1
@ -258,6 +262,8 @@ for r,d,flist in os.walk(path):
handshakestats['ECDHE'] += 1 handshakestats['ECDHE'] += 1
if DHE: if DHE:
handshakestats['DHE'] += 1 handshakestats['DHE'] += 1
if DHE and ECDHE:
handshakestats['ECDHE and DHE'] += 1
if ECDH: if ECDH:
handshakestats['ECDH'] += 1 handshakestats['ECDH'] += 1
if DH: if DH: