ctutlz icon indicating copy to clipboard operation
ctutlz copied to clipboard

The REPL example in the README

Open josephnoir opened this issue 4 years ago • 0 comments

Hi,

I tried the REPL example in the README and got no verifications. After looking through the code, I found a similar pattern in verify_scts.py which converted the results form the download into a list of logs first. After adopting that pattern the verification works a bit more:

>>> from ctutlz.ctlog import download_log_list, Logs, set_operator_names
>>> from ctutlz.scripts.verify_scts import verify_scts_by_cert, verify_scts_by_tls, verify_scts_by_ocsp
>>> from ctutlz.tls.handshake import do_handshake
>>>
>>> all_dict = download_log_list()
>>> set_operator_names(all_dict)
>>> ctlogs = Logs([all_dict])

This still does not produce any results with verify_scts_by_tls, I did get a debug message, though:

>>> handshake_res = do_handshake('google.com')
debug: len(chain_x509s) = 2
>>> verifications = verify_scts_by_tls(handshake_res, ctlogs)
>>> for ver in verifications:
...   print(f'{ver.verified}: {ver.log.description}')
...
>>>

With verify_scts_by_cert I do get two verifications. Without converting the logs beforehand (as above) this call gives me an attribute error instead.

>>> verifications = verify_scts_by_cert(handshake_res, ctlogs)
>>> for ver in verifications:
...   print(f'{ver.verified}: {ver.log.description}')
...
True: DigiCert Nessie2020 Log
True: Google 'Xenon2020' log

Could you give me a pointer how to use this, where did I go wrong?

Kind regards Raphael

josephnoir avatar Nov 06 '20 14:11 josephnoir