writeonce/runtime/test/tls_hs_vectors.h
shoney.arickathil 74b153aa0a feat(tls): offline handshake verification (rv2 9 phase F3b)
- wo_tls_verify_cert_verify: verifies a server CertificateVerify
  (RFC 8446 §4.4.3) — builds the 64-space || context || 0x00 ||
  transcript-hash content, parses the leaf SPKI (phase E) and dispatches
  to phase-D RSA-PSS / RSA-PKCS1 / ECDSA-P256; the scheme must match the
  leaf key type. ECDSA sig r/s pulled from its DER SEQ
- reuses wo_tls_finished_verify (phase F2) for server + client Finished
- KAT: the whole handshake crypto driven offline from the RFC 8448 §3
  recorded messages — CertificateVerify (RSA-PSS) VALID, wrong-transcript
  / tampered-sig / mismatched-scheme rejected, server Finished byte-exact,
  and the client Finished we would send byte-exact. test_tls 78 pass,
  ASan/UBSan clean

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit afd9f23508c648322712df91329aa117c975ccab)
2026-09-15 01:15:31 +02:00

121 lines
6.1 KiB
C

/* Generated from RFC 8448 §3 'Simple 1-RTT Handshake' by
* scratchpad gen (see commit msg). Handshake messages + secrets for the
* phase-F3b offline handshake-verification KAT. */
static const unsigned char hs_ch[] = {
0x01,0x00,0x00,0xc0,0x03,0x03,0xcb,0x34,0xec,0xb1,0xe7,0x81,
0x63,0xba,0x1c,0x38,0xc6,0xda,0xcb,0x19,0x6a,0x6d,0xff,0xa2,
0x1a,0x8d,0x99,0x12,0xec,0x18,0xa2,0xef,0x62,0x83,0x02,0x4d,
0xec,0xe7,0x00,0x00,0x06,0x13,0x01,0x13,0x03,0x13,0x02,0x01,
0x00,0x00,0x91,0x00,0x00,0x00,0x0b,0x00,0x09,0x00,0x00,0x06,
0x73,0x65,0x72,0x76,0x65,0x72,0xff,0x01,0x00,0x01,0x00,0x00,
0x0a,0x00,0x14,0x00,0x12,0x00,0x1d,0x00,0x17,0x00,0x18,0x00,
0x19,0x01,0x00,0x01,0x01,0x01,0x02,0x01,0x03,0x01,0x04,0x00,
0x23,0x00,0x00,0x00,0x33,0x00,0x26,0x00,0x24,0x00,0x1d,0x00,
0x20,0x99,0x38,0x1d,0xe5,0x60,0xe4,0xbd,0x43,0xd2,0x3d,0x8e,
0x43,0x5a,0x7d,0xba,0xfe,0xb3,0xc0,0x6e,0x51,0xc1,0x3c,0xae,
0x4d,0x54,0x13,0x69,0x1e,0x52,0x9a,0xaf,0x2c,0x00,0x2b,0x00,
0x03,0x02,0x03,0x04,0x00,0x0d,0x00,0x20,0x00,0x1e,0x04,0x03,
0x05,0x03,0x06,0x03,0x02,0x03,0x08,0x04,0x08,0x05,0x08,0x06,
0x04,0x01,0x05,0x01,0x06,0x01,0x02,0x01,0x04,0x02,0x05,0x02,
0x06,0x02,0x02,0x02,0x00,0x2d,0x00,0x02,0x01,0x01,0x00,0x1c,
0x00,0x02,0x40,0x01,
};
static const unsigned char hs_sh[] = {
0x02,0x00,0x00,0x56,0x03,0x03,0xa6,0xaf,0x06,0xa4,0x12,0x18,
0x60,0xdc,0x5e,0x6e,0x60,0x24,0x9c,0xd3,0x4c,0x95,0x93,0x0c,
0x8a,0xc5,0xcb,0x14,0x34,0xda,0xc1,0x55,0x77,0x2e,0xd3,0xe2,
0x69,0x28,0x00,0x13,0x01,0x00,0x00,0x2e,0x00,0x33,0x00,0x24,
0x00,0x1d,0x00,0x20,0xc9,0x82,0x88,0x76,0x11,0x20,0x95,0xfe,
0x66,0x76,0x2b,0xdb,0xf7,0xc6,0x72,0xe1,0x56,0xd6,0xcc,0x25,
0x3b,0x83,0x3d,0xf1,0xdd,0x69,0xb1,0xb0,0x4e,0x75,0x1f,0x0f,
0x00,0x2b,0x00,0x02,0x03,0x04,
};
static const unsigned char hs_ee[] = {
0x08,0x00,0x00,0x24,0x00,0x22,0x00,0x0a,0x00,0x14,0x00,0x12,
0x00,0x1d,0x00,0x17,0x00,0x18,0x00,0x19,0x01,0x00,0x01,0x01,
0x01,0x02,0x01,0x03,0x01,0x04,0x00,0x1c,0x00,0x02,0x40,0x01,
0x00,0x00,0x00,0x00,
};
static const unsigned char hs_cert[] = {
0x0b,0x00,0x01,0xb9,0x00,0x00,0x01,0xb5,0x00,0x01,0xb0,0x30,
0x82,0x01,0xac,0x30,0x82,0x01,0x15,0xa0,0x03,0x02,0x01,0x02,
0x02,0x01,0x02,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,
0x0d,0x01,0x01,0x0b,0x05,0x00,0x30,0x0e,0x31,0x0c,0x30,0x0a,
0x06,0x03,0x55,0x04,0x03,0x13,0x03,0x72,0x73,0x61,0x30,0x1e,
0x17,0x0d,0x31,0x36,0x30,0x37,0x33,0x30,0x30,0x31,0x32,0x33,
0x35,0x39,0x5a,0x17,0x0d,0x32,0x36,0x30,0x37,0x33,0x30,0x30,
0x31,0x32,0x33,0x35,0x39,0x5a,0x30,0x0e,0x31,0x0c,0x30,0x0a,
0x06,0x03,0x55,0x04,0x03,0x13,0x03,0x72,0x73,0x61,0x30,0x81,
0x9f,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
0x01,0x01,0x05,0x00,0x03,0x81,0x8d,0x00,0x30,0x81,0x89,0x02,
0x81,0x81,0x00,0xb4,0xbb,0x49,0x8f,0x82,0x79,0x30,0x3d,0x98,
0x08,0x36,0x39,0x9b,0x36,0xc6,0x98,0x8c,0x0c,0x68,0xde,0x55,
0xe1,0xbd,0xb8,0x26,0xd3,0x90,0x1a,0x24,0x61,0xea,0xfd,0x2d,
0xe4,0x9a,0x91,0xd0,0x15,0xab,0xbc,0x9a,0x95,0x13,0x7a,0xce,
0x6c,0x1a,0xf1,0x9e,0xaa,0x6a,0xf9,0x8c,0x7c,0xed,0x43,0x12,
0x09,0x98,0xe1,0x87,0xa8,0x0e,0xe0,0xcc,0xb0,0x52,0x4b,0x1b,
0x01,0x8c,0x3e,0x0b,0x63,0x26,0x4d,0x44,0x9a,0x6d,0x38,0xe2,
0x2a,0x5f,0xda,0x43,0x08,0x46,0x74,0x80,0x30,0x53,0x0e,0xf0,
0x46,0x1c,0x8c,0xa9,0xd9,0xef,0xbf,0xae,0x8e,0xa6,0xd1,0xd0,
0x3e,0x2b,0xd1,0x93,0xef,0xf0,0xab,0x9a,0x80,0x02,0xc4,0x74,
0x28,0xa6,0xd3,0x5a,0x8d,0x88,0xd7,0x9f,0x7f,0x1e,0x3f,0x02,
0x03,0x01,0x00,0x01,0xa3,0x1a,0x30,0x18,0x30,0x09,0x06,0x03,
0x55,0x1d,0x13,0x04,0x02,0x30,0x00,0x30,0x0b,0x06,0x03,0x55,
0x1d,0x0f,0x04,0x04,0x03,0x02,0x05,0xa0,0x30,0x0d,0x06,0x09,
0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x0b,0x05,0x00,0x03,
0x81,0x81,0x00,0x85,0xaa,0xd2,0xa0,0xe5,0xb9,0x27,0x6b,0x90,
0x8c,0x65,0xf7,0x3a,0x72,0x67,0x17,0x06,0x18,0xa5,0x4c,0x5f,
0x8a,0x7b,0x33,0x7d,0x2d,0xf7,0xa5,0x94,0x36,0x54,0x17,0xf2,
0xea,0xe8,0xf8,0xa5,0x8c,0x8f,0x81,0x72,0xf9,0x31,0x9c,0xf3,
0x6b,0x7f,0xd6,0xc5,0x5b,0x80,0xf2,0x1a,0x03,0x01,0x51,0x56,
0x72,0x60,0x96,0xfd,0x33,0x5e,0x5e,0x67,0xf2,0xdb,0xf1,0x02,
0x70,0x2e,0x60,0x8c,0xca,0xe6,0xbe,0xc1,0xfc,0x63,0xa4,0x2a,
0x99,0xbe,0x5c,0x3e,0xb7,0x10,0x7c,0x3c,0x54,0xe9,0xb9,0xeb,
0x2b,0xd5,0x20,0x3b,0x1c,0x3b,0x84,0xe0,0xa8,0xb2,0xf7,0x59,
0x40,0x9b,0xa3,0xea,0xc9,0xd9,0x1d,0x40,0x2d,0xcc,0x0c,0xc8,
0xf8,0x96,0x12,0x29,0xac,0x91,0x87,0xb4,0x2b,0x4d,0xe1,0x00,
0x00,
};
static const unsigned char hs_cv[] = {
0x0f,0x00,0x00,0x84,0x08,0x04,0x00,0x80,0x5a,0x74,0x7c,0x5d,
0x88,0xfa,0x9b,0xd2,0xe5,0x5a,0xb0,0x85,0xa6,0x10,0x15,0xb7,
0x21,0x1f,0x82,0x4c,0xd4,0x84,0x14,0x5a,0xb3,0xff,0x52,0xf1,
0xfd,0xa8,0x47,0x7b,0x0b,0x7a,0xbc,0x90,0xdb,0x78,0xe2,0xd3,
0x3a,0x5c,0x14,0x1a,0x07,0x86,0x53,0xfa,0x6b,0xef,0x78,0x0c,
0x5e,0xa2,0x48,0xee,0xaa,0xa7,0x85,0xc4,0xf3,0x94,0xca,0xb6,
0xd3,0x0b,0xbe,0x8d,0x48,0x59,0xee,0x51,0x1f,0x60,0x29,0x57,
0xb1,0x54,0x11,0xac,0x02,0x76,0x71,0x45,0x9e,0x46,0x44,0x5c,
0x9e,0xa5,0x8c,0x18,0x1e,0x81,0x8e,0x95,0xb8,0xc3,0xfb,0x0b,
0xf3,0x27,0x84,0x09,0xd3,0xbe,0x15,0x2a,0x3d,0xa5,0x04,0x3e,
0x06,0x3d,0xda,0x65,0xcd,0xf5,0xae,0xa2,0x0d,0x53,0xdf,0xac,
0xd4,0x2f,0x74,0xf3,
};
static const unsigned char hs_sfin[] = {
0x14,0x00,0x00,0x20,0x9b,0x9b,0x14,0x1d,0x90,0x63,0x37,0xfb,
0xd2,0xcb,0xdc,0xe7,0x1d,0xf4,0xde,0xda,0x4a,0xb4,0x2c,0x30,
0x95,0x72,0xcb,0x7f,0xff,0xee,0x54,0x54,0xb7,0x8f,0x07,0x18,
};
static const unsigned char hs_cfin[] = {
0x14,0x00,0x00,0x20,0xa8,0xec,0x43,0x6d,0x67,0x76,0x34,0xae,
0x52,0x5a,0xc1,0xfc,0xeb,0xe1,0x1a,0x03,0x9e,0xc1,0x76,0x94,
0xfa,0xc6,0xe9,0x85,0x27,0xb6,0x42,0xf2,0xed,0xd5,0xce,0x61,
};
static const unsigned char hs_c_traffic[] = {
0xb3,0xed,0xdb,0x12,0x6e,0x06,0x7f,0x35,0xa7,0x80,0xb3,0xab,
0xf4,0x5e,0x2d,0x8f,0x3b,0x1a,0x95,0x07,0x38,0xf5,0x2e,0x96,
0x00,0x74,0x6a,0x0e,0x27,0xa5,0x5a,0x21,
};
static const unsigned char hs_s_traffic[] = {
0xb6,0x7b,0x7d,0x69,0x0c,0xc1,0x6c,0x4e,0x75,0xe5,0x42,0x13,
0xcb,0x2d,0x37,0xb4,0xe9,0xc9,0x12,0xbc,0xde,0xd9,0x10,0x5d,
0x42,0xbe,0xfd,0x59,0xd3,0x91,0xad,0x38,
};