nx_tls12_keys.nx
buildroot/runtime/nx_tls12_keys.nx
about
nx_tls12_keys.nx -- TLS 1.2 key schedule (rung 3 of the sovereign TLS 1.2 client).
Wires the already-RFC-tested nx_tls12_prf_sha256 with the exact labels + seed orders RFC 5246 specifies:
master_secret = PRF(premaster, "master secret", client_random || server_random)[0..48]
key_block = PRF(master_secret, "key expansion", server_random || client_random)[0..n] (NOTE: SR||CR)
For ECDHE-*-AES128-GCM (AEAD, no MAC keys) the 40-byte key_block splits as:
client_write_key(16) | server_write_key(16) | client_write_IV(4) | server_write_IV(4)
license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_tls12_prf.nx
imported by: nx_tls12_client_session.nxnx_tls12_keys_test.nx
structs
| none |
consts
| none |
functions
| 11 | func tls12_derive_master_secret(pm: *u8, pm_len: i64, cr: *u8, sr: *u8, out48: *u8) -> i64 |
| 21 | func tls12_derive_key_block(ms: *u8, sr: *u8, cr: *u8, out: *u8, n: i64) -> i64 |
| 32 | func tls12_split_keys_aes128gcm(kb: *u8, c_key: *u8, s_key: *u8, c_iv: *u8, s_iv: *u8) -> i64 |
| 46 | func tls12_finished_verify_data(ms: *u8, label: *u8, label_len: i64, handshake_hash32: *u8, out12: *u8) -> i64 |