nx_tls13_server_session_emit_cv.nx
buildroot/runtime/nx_tls13_server_session_emit_cv.nx
about
nx_tls13_server_session_emit_cv.nx -- stone 7.5 of TLS server arc.
Emits the server CertificateVerify handshake message: ECDSA-P256
signature over a transcript-bound context, wrapped as an
AEAD-encrypted record.
Per RFC 8446 §4.4.3, the signed content is:
[0x20 × 64] (octet 0x20 = space, 64 bytes)
"TLS 1.3, server CertificateVerify" (33 bytes, the string)
0x00 (separator)
transcript_hash (32 bytes, SHA-256)
----- 130 bytes total -----
Signature: ECDSA-P256-SHA256. The signing primitive
nx_ecdsa_p256_sign hashes input itself.
Wire encoding:
HT_CERTIFICATE_VERIFY (0x0f) (1 byte)
u24 body_len (3 bytes)
u16 signature_scheme = 0x0403 (ecdsa_secp256r1_sha256)
u16 sig_len (DER signature length)
DER-encoded ECDSA(r, s) (~70-72 bytes)
State machine: requires CERT_SENT (i.e. EE has been emitted; the
Certificate stone 6.5 is logically before this but is queued, so
in v1 the substrate skips cert -- THIS IS HONESTLY ANONYMOUS-CERT
STILL). Advances to CV_SENT. emit_sf (patched this commit) now
accepts both CERT_SENT and CV_SENT.
Honest scope statement: a real client interop'ing with a real
public CA chain would expect Certificate to precede this message.
This commit ships the SIGNATURE pipeline (key schedule + transcript
+ ECDSA + DER + AEAD record), composable with stone 6.5 when it
ships. The signing primitive is KAT'd against RFC 6979 vectors.
license_tier: ORIGINAL
dependencies 9 imports · 7 importers
imports: nx_syscalls.nxnx_u256.nxnx_sha256.nxnx_ecdsa_p256_sign.nxnx_tls13.nxnx_tls13_record.nxnx_tls13_transcript.nxnx_tls13_server_session.nxnx_ed25519_signature.nx
imported by: nx_edge_daemon.nxnx_pages_https_daemon.nxnx_tls13_server_full_handshake_test.nxnx_tls13_server_session_emit_certificate_test.nxnx_tls13_server_session_emit_cv_test.nxnx_tls13_server_session_run.nxnx_tls13_server_session_run_h2.nx
structs
| none |
consts
| 49 | const NX_TLS13_SIG_SCHEME_ECDSA_P256_SHA256: i64 = 0x0403 |
| 50 | const NX_TLS13_CV_TRANSCRIPT_LEN: i64 = 32 // SHA-256 hash output |
| 51 | const NX_TLS13_CV_CONTEXT_LEN: i64 = 130 // 64 + 33 + 1 + 32 |
| 259 | const NX_TLS13_SIG_SCHEME_ED25519: i64 = 0x0807 |
functions
| 55 | func encode_ecdsa_p256_sig_der(r_bytes: *u8, s_bytes: *u8, called by 1: nx_tls13_server_session_emit_cv |
| 106 | func build_cv_context(transcript_hash: *u8, out: *u8) -> i64 |
| 135 | func nx_tls13_server_session_emit_cv( |
| 261 | func nx_tls13_server_session_emit_cv_ed25519( |