summaryrefslogtreecommitdiff
path: root/monitor/josef_experimental.py
blob: 1119a22254e90a7a39aeeb99a58c63b5d6a41072 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/usr/bin/python
# -*- coding: utf-8 -*-     

import sys
import os
from josef_lib import *
import leveldb
import argparse
import json
from josef_leveldb import *
from datetime import datetime as dt
from josef_monitor import verify_inclusion_by_hash
from monitor_conf import *


# def verify_sct(baseurl, sctentry, key, sth_in=None):
#     if sth_in is None:
#         if baseurl:
#             sth = get_sth(baseurl)
#         else:
#             print "No sth provided!"
#     else:
#         sth = sth_in

#     # Verify signature
#     leafcert = base64.b64decode(sctentry["leafcert"])
#     if "issuer_key_hash" in sctentry:
#         issuer_key_hash = base64.b64decode(sctentry["issuer_key_hash"])
#     else:
#         issuer_key_hash = None
#     try:
#         if issuer_key_hash:
#             signed_entry = pack_precert(leafcert, issuer_key_hash)
#         else:
#             signed_entry = pack_cert(leafcert)
#         check_sct_signature(baseurl, signed_entry, sctentry["sct"], precert=issuer_key_hash, publickey=key)
#         print "Signature OK"
#     except AssertionError, e:
#         print "ERROR:", e
#     except urllib2.HTTPError, e:
#         print "ERROR:", e
#     except ecdsa.keys.BadSignatureError, e:
#         print "ERROR: bad signature"
    
#     # Verify inclusion
#     h = get_leaf_hash(base64.b64decode(sctentry["leafcert"]))
    
#     verify_inclusion_by_hash("https://localhost:8080/", h)



def update_roots(log):
    roots_hash = None

    roots = get_all_roots(log["url"])
    new_roots_hash = str(hash(str(roots)))

    if new_roots_hash != roots_hash:
        cert_dir = OUTPUT_DIR + log["name"] + "-roots"
        if not os.path.exists(cert_dir):
            os.makedirs(cert_dir)

        hash_list = []
        for cert in roots:
            h = str(hash(str(cert)))
            hash_list.append(h)

        loaded_list = os.listdir(cert_dir)

        added, removed = compare_lists(hash_list[:-1], loaded_list)

        # TODO log changes
        if len(added) != 0:
            print str(len(added)) + " new roots found!"
        if len(removed) != 0:
            print str(len(removed)) + " roots removed!"

        for item in removed:
            data = open(cert_dir + "/" + item).read()

            root_cert = base64.decodestring(data)
            subject = get_cert_info(root_cert)["subject"]
            issuer = get_cert_info(root_cert)["issuer"]
            if subject == issuer:
                print "Removed Root: " + item + ", " + subject
            else: 
                print "WTF? Not a root..."


        for item in added:
            root_cert = base64.decodestring(roots[hash_list.index(item)])
            subject = get_cert_info(root_cert)["subject"]
            issuer = get_cert_info(root_cert)["issuer"]
            if subject == issuer:
                print "New Root: " + item + ", " + subject
            else: 
                print "WTF? Not a root..."

            fn = cert_dir + "/" + item
            tempname = fn + ".new"
            data = roots[hash_list.index(item)]
            open(tempname, 'w').write(data)
            mv_file(tempname, fn)


if __name__ == '__main__':

    # for log in ctlogs:
    #     update_roots(log)

    submission = ['MIIE1jCCA76gAwIBAgISESGwNq1DK/7r1wGrSndrRcJ9MA0GCSqGSIb3DQEBBQUAMC4xETAPBgNVBAoTCEFscGhhU1NMMRkwFwYDVQQDExBBbHBoYVNTTCBDQSAtIEcyMB4XDTE0MDYwNjEwMTYyNVoXDTE1MDYwNTEyMTE0NVowVTELMAkGA1UEBhMCR0IxITAfBgNVBAsTGERvbWFpbiBDb250cm9sIFZhbGlkYXRlZDEjMCEGA1UEAwwad3d3LnNwZWNpYWxpc3QtdGFwZXMuY28udWswggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDcGP5Pur9sf7kX0hVCAxydmUoke6quqcFjV1f+FsnOOTfliCxFn15Ezg1sbq0fFPK9tL8CWlewJO8vA0AIYAYTDyyWhaeNfHVdOR0Emus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wY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIABjAdBgNVHQ4EFgQUYHtmGkUNl8qJUC99BM00qP/8/UswDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOCAQEArqqf/LfSyx9fOSkoGJ40yWxPbxrwZKJwSk8ThptgKJ7ogUmYfQq75bCdPTbbjwVR/wkxKh/diXeeDy5slQTthsu0AD+EAk2AaioteAuubyuig0SDH81Qgkwkr733pbTIWg/050deSY43lv6aiAU62cDbKYfmGZZHpzqmjIs8d/5GY6dT2iHRrH5Jokvmw2dZL7OKDrssvamqQnw1wdh/1acxOk5jQzmvCLBhNIzTmKlDNPYPhyk7ncJWWJh3w/cbrPad+D6qp1RF8PX51TFl/mtYnHGzHtdS6jIX/EBgHcl5JLL2bP2oZg6C3ZjL2sJETy6ge/L3ayx2EYRGinij4w==']
    leaf = base64.b64decode(submission[0])
    # print leaf
    # print base64.b64decode(submission[0])
    # entry = json.loads('{"extra_data": "AAeyAAQzMIIELzCCAxegAwIBAgILBAAAAAABL07hNwIwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw0xMTA0MTMxMDAwMDBaFw0yMjA0MTMxMDAwMDBaMC4xETAPBgNVBAoTCEFscGhhU1NMMRkwFwYDVQQDExBBbHBoYVNTTCBDQSAtIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw/BliN8b3ca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CQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwOgYDVR0fBDMwMTAvoC2gK4YpaHR0cDovL2NybDIuYWxwaGFzc2wuY29tL2dzL2dzYWxwaGFnMi5jcmwwfwYIKwYBBQUHAQEEczBxMDwGCCsGAQUFBzAChjBodHRwOi8vc2VjdXJlMi5hbHBoYXNzbC5jb20vY2FjZXJ0L2dzYWxwaGFnMi5jcnQwMQYIKwYBBQUHMAGGJWh0dHA6Ly9vY3NwMi5nbG9iYWxzaWduLmNvbS9nc2FscGhhZzIwHQYDVR0OBBYEFPNVIQa7tlmkqxbVnJ+vcaz/7PQdMB8GA1UdIwQYMBaAFBTqGVXwDg0yxh90M7eOZhpMEjEeMA0GCSqGSIb3DQEBBQUAA4IBAQB4PzM03rndHWb3a02GzAZF3kLw6d0OkRM4PSIIwAT9KX1PgTAncD1JPGFCU1OQ0xyDCV/+iT8kKuGxW9fjEC/KiVSxJxZGfE3OiA6auquMOQB5X5GN0GW5uDocqKJE2i51Fj3zEqiJ3uIur+0Nk2TVUF1Q+5+/N8qEjmecb0mcLr75Lxa6IOAFYHmMdAt2gAjHegkcH7w53teM+QZw3usekqSeKiQKXUgrW8HWnr2+fumfuZeevtx3mcRBiHadj/UV+1PvCsxfSia/8Sw4CWWwWUCKYGdm1YBxCN1qK6yyOgS6guXPFnyKBHyQTV9AfLDW68tWGadmUiFQIEaLz0m5AAA="}')
    # print my_get_all_cert_info(leaf)
    precert = False

    # if issuer_key_hash:
    #         signed_entry = pack_precert(leaf, issuer_key_hash)
    #     else:
    signed_entry = pack_cert(leaf)

    log = {
    "name" : "pilot",
    "url" : "https://ct.googleapis.com/pilot/",
    "key" : "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEfahLEimAoz2t01p3uMziiLOl/fHTDM0YDOhBRuiBARsV4UvxG2LdNgoIGLrtCzWE0J5APC2em4JlvR8EEEFMoA==",
    "id" : "pLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BA="}
    



    sct = json.loads('{"timestamp": 1419573511033, "signature": "BAMARzBFAiAz6UTsDV6PcHdW/iZ1JqeF91KbjrpG2ubRVW0z5trPIwIhANtReTFlwkxDfVIvGscTdDk5monwBL702DkYd0oKM0xE", "sct_version": 0, "id": "pLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BA=", "extensions": ""}')

    check_sct_signature(log["url"], signed_entry, sct, precert, base64.b64decode(log["key"]))