nx_tls12_ske_verify.nx
buildroot/runtime/nx_tls12_ske_verify.nx
about
nx_tls12_ske_verify.nx -- TLS 1.2 ECDHE-RSA ServerKeyExchange signature
verification (rung 5 of the sovereign TLS 1.2 client; RFC 5246 §7.4.3 +
§7.4.1.4.1). The server proves ownership of its certificate's RSA key by
signing the ephemeral ECDHE parameters bound to both handshake randoms:
signed_data = client_random(32) || server_random(32) || ECDHE_params
signature = RSASSA-PKCS1-v1_5( SHA-256(signed_data) ) // leaf RSA key
ECDHE_params = curve_type(1=0x03 named_curve)
|| named_curve(2=0x0017 secp256r1)
|| point_len(1) || point(point_len, 0x04||X||Y uncompressed)
On the TLS 1.2 wire the SKE body additionally carries, AFTER the params, a
2-byte SignatureAndHashAlgorithm (e.g. 0x0401 = {sha256, rsa}) and a 2-byte
signature length -- but those frame the signature; the SIGNED bytes are
exactly client_random || server_random || ECDHE_params.
COMPOSED, not re-implemented (verify-don't-rebuild):
- tls12_skx_signed_data -> nx_tls12_parse.nx (signed-data assembly)
- tls12_parse_server_key_exchange -> nx_tls12_parse.nx (wire field split)
- rsa_pkcs1_v1_5_sha256_verify -> nx_rsa_pkcs1_v1_5_sha256.nx (RSA-2048
PKCS1 v1.5 + SHA-256 verify, hashes
signed_data internally)
- u2048_load_be -> nx_u2048.nx (modulus load)
This rung adds ONLY the glue: assemble -> hash+verify -> sealed verdict.
license_tier: INDEPENDENT_REDERIVE
genealogy_id: international-research-sources/ietf/rfc_5246 + rfc_8017
lineage_id: nishi_tls12_ske_verify_q1
nx_safety_envelope:
intended_use: "TLS 1.2 ECDHE-RSA ServerKeyExchange signature
verification (server authentication / anti-MITM)"
sil_target: SIL3 (authentication; a forged-accept = MITM)
evidence: [composed_from_rsa_pkcs1v15_sha256_verify,
openssl_signed_fixture_VERIFIED,
neg_control_flipped_sig_and_signed_data_REJECTED]
verdict: NOT_YET_EVALUATED
dependencies 5 imports · 2 importers
imports: nx_syscalls.nxnx_u2048.nxnx_rsa_pkcs1_v1_5_sha256.nxnx_tls12_parse.nxnx_x509_verify_ecdsa.nx
imported by: nx_tls12_client_session.nxnx_tls12_ske_verify_gate.nx
structs
| none |
consts
| 48 | const NX_TLS12_SKE_OK: i64 = 1 |
| 49 | const NX_TLS12_SKE_BAD_SIG: i64 = 2 // signature did not verify |
| 50 | const NX_TLS12_SKE_BAD_PARAMS: i64 = 3 // malformed SKE wire body |
| 51 | const NX_TLS12_SKE_VERDICT_N: i64 = 4 |
functions
| 53 | func nx_tls12_ske_verdict_is_valid(v: i64) -> i64 |
| 63 | func nx_tls12_ske_verify(client_random: *u8, server_random: *u8, |
| 83 | func nx_tls12_ske_verify_ecdsa(client_random: *u8, server_random: *u8, |
| 97 | func nx_tls12_ske_verify_n(client_random: *u8, server_random: *u8, |
| 111 | func nx_tls12_ske_verify_wire(client_random: *u8, server_random: *u8, |