diff options
| -rwxr-xr-x | monitor/josef_leveldb.py | 4 | ||||
| -rwxr-xr-x | monitor/josef_monitor.py | 12 |
2 files changed, 10 insertions, 6 deletions
diff --git a/monitor/josef_leveldb.py b/monitor/josef_leveldb.py index 74498c7..5c7fc8a 100755 --- a/monitor/josef_leveldb.py +++ b/monitor/josef_leveldb.py @@ -91,6 +91,8 @@ def db_add_certs(db, data): if db is None: print "ERROR: NO DATABASE SET!" return + + # batch = leveldb.WriteBatch() for cert in data: try: db_add_domain_2(db, cert["subject"].split("CN=")[1], str(cert)) @@ -103,7 +105,7 @@ def db_add_certs(db, data): pass except IndexError: pass - + # db.Write(batch, sync = True) def db_lookup_domain(db, domain): diff --git a/monitor/josef_monitor.py b/monitor/josef_monitor.py index 79d364f..e102efe 100755 --- a/monitor/josef_monitor.py +++ b/monitor/josef_monitor.py @@ -209,11 +209,11 @@ def check_domain(raw_entry, log=None): orig_entry = extract_original_entry(raw_entry) try: cert_info = my_get_cert_info(orig_entry[0][0]) + if log: + cert_info["log"] = log[8:-1] # strip generic URL stuff + return cert_info except IndexError: - pass - if log: - cert_info["log"] = log[8:-1] # strip generic URL stuff - return cert_info + return None def fetch_and_increment_subtree(first, last, url, subtree =[[]]): global DB @@ -223,7 +223,9 @@ def fetch_and_increment_subtree(first, last, url, subtree =[[]]): entries = get_entries(url, first, last)["entries"] tmp_cert_data = [] for item in entries: - tmp_cert_data.append(check_domain(item, url)) + tmp_data = check_domain(item, url) + if tmp_data: + tmp_cert_data.append() new_leafs.append(get_leaf_hash(base64.b64decode(item["leaf_input"]))) if DEFAULT_CERT_FILE: if DB is None: |
