From aac3e9a9db1fb56b6263d4fe054d5643e4e49750 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Thu, 30 Oct 2014 01:41:46 +0100 Subject: [PATCH] parse_CAs.py - add few comments --- top1m/parse_CAs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/top1m/parse_CAs.py b/top1m/parse_CAs.py index d564c28..f3db0bf 100644 --- a/top1m/parse_CAs.py +++ b/top1m/parse_CAs.py @@ -65,7 +65,7 @@ def get_path_for_hash(cert_hash): return None return f_name -""" convert RSA and DSA key sizes to estimated Level of security """ +""" convert RSA and DSA key sizes to estimated Level of Security """ def rsa_key_size_to_los(size): if size < 760: return 40 @@ -84,6 +84,7 @@ def rsa_key_size_to_los(size): else: return 256 +""" convert signature algotihm to estimated Level of Security """ def sig_alg_to_los(name): if 'MD5' in name.upper(): return 64 @@ -119,6 +120,8 @@ def collect_key_sizes(file_names): keysize['DSA ' + str(pubkey.bits())] += 1 tmp_keysize['DSA ' + str(pubkey.bits())] = 1 security_level = rsa_key_size_to_los(pubkey.bits()) + # following 408 should be crypto.TYPE_ECDSA, but even new(ish) version + # of OpenSSL Python module don't define it elif pubkey.type() == 408: keysize['ECDSA ' + str(pubkey.bits())] += 1 tmp_keysize['ECDSA ' + str(pubkey.bits())] = 1