diff options
author | josef <josef.gson@gmail.com> | 2015-11-10 16:06:58 +0100 |
---|---|---|
committer | josef <josef.gson@gmail.com> | 2015-11-10 16:06:58 +0100 |
commit | a82f34e80f5ec4465b6a827dd3205eda69195ad7 (patch) | |
tree | d4b456234ed5a4859a8be71e9e7c2de6f0efc442 | |
parent | ac138329e9cacca08d3fbc18f3789fb95ef883ed (diff) |
adding more info to content measurement
-rwxr-xr-x | monitor/josef_experimental.py | 12 | ||||
-rw-r--r-- | monitor/josef_lib.py | 4 |
2 files changed, 15 insertions, 1 deletions
diff --git a/monitor/josef_experimental.py b/monitor/josef_experimental.py index ba85a71..608c655 100755 --- a/monitor/josef_experimental.py +++ b/monitor/josef_experimental.py @@ -133,6 +133,7 @@ def parse_entry(e, idx, log): s = log["name"] s += sep + str(idx) # index + s += sep + e["serial"] # cert serial number s += sep + e["subject"] # Subject if "SAN" in e: s += sep + e["SAN"] # SAN @@ -142,6 +143,7 @@ def parse_entry(e, idx, log): s += sep + e["chain_length"] # path length s += sep + e["sig_algorithm"] # Signature algothithm s += sep + e["pubkey_algorithm"] # pubkey algorithm + s += sep + e["keylength"] s += sep + e["not_before"] # valid from s += sep + e["not_after"] # valid to s += sep + e["validation"] # EV? @@ -181,9 +183,17 @@ if __name__ == '__main__': print res + # Experimental + # if True: + # log = CTLOGS[0] + # entries = get_entries(log["url"],1000 ,1001)["entries"] + # entry = entries[0] + # res = check_domain_extended(entry) + # print parse_entry(res,0,log) + # Data gathering for Niklas if True: - logs = [CTLOGS[7]] + logs = [CTLOGS[9]] for log in logs: filename = log["name"] + "_content.txt" if os.path.exists(filename): diff --git a/monitor/josef_lib.py b/monitor/josef_lib.py index 575dd84..c5cddf7 100644 --- a/monitor/josef_lib.py +++ b/monitor/josef_lib.py @@ -263,12 +263,16 @@ def my_get_more_cert_info(s): result["subject"] = line.split("Subject: ")[1] if "Issuer:" in line: result["issuer"] = line.split("Issuer: ")[1] + if "Public-Key:" in line: + result["keylength"] = line.lstrip()[13:-5] if "Signature Algorithm:" in line: result["sig_algorithm"] = line.split("Signature Algorithm: ")[1] if "Public Key Algorithm:" in line: result["pubkey_algorithm"] = line.split("Public Key Algorithm: ")[1] if "Subject Alternative Name" in prev: result["SAN"] = line.lstrip() + if "Serial Number:" in prev: + result["serial"] = line.lstrip() if "Not After" in line: result["not_after"] = line.split(": ")[1] if "Not Before" in line: |