Skip to content

Instantly share code, notes, and snippets.

@AdamISZ
Last active April 3, 2023 20:27
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save AdamISZ/d9b96ebc37756aa379f0 to your computer and use it in GitHub Desktop.
Save AdamISZ/d9b96ebc37756aa379f0 to your computer and use it in GitHub Desktop.
TLSNotary notarization file format

Data format: binary. Default file extension: '.tlsn'

Contents

Field description (size in bytes) code in Python version
Header (29) 'tlsnotary notarization file\n\n'
File Version (2) '\x00\x01' version 0.1
Chosen cipher suite (2) shared.bi2ba(tlsn_session.chosen_cipher_suite,fixed=2)
Client random (32) tlsn_session.client_random
Server random (32) tlsn_session.server_random
Premaster secret 1st half (24) tlsn_session.pms1
Premaster secret 2nd half (24) tlsn_session.pms2
Audited site server cert length (3)
Audited site server cert (var)
Audit TLS version used (2) tlsn_session.tlsver
Audit TLS version initially requested (2) tlsn_session.initial_tlsver
Server response length (8) shared.bi2ba(len(response),fixed=8)
Encrypted server response (var) response
IV after finished length (2) len(IV)
IV after finished ([16|258]) IV
Notary signature length (2) len(signature)
Notary signature ([2048|4096..]) signature
Commit sha256 hash (32) commit_hash
Notary pubkey (same as Notary signature) (N as bytearray)
OPTIONAL decrypted server response (to EOF)
@AdamISZ
Copy link
Author

AdamISZ commented Apr 13, 2015

Note: the signature is on the data: commitment_hash(32) + pms2(24) + audited_site_server_modulus(var) - this last is embedded in the server cert.

@AdamISZ
Copy link
Author

AdamISZ commented Apr 13, 2015

Note: possible improvements for version 00 02 : add timestamp of notarization into signature, add auditee identifying key into signature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment