iPXE
tlsfmt_test.c File Reference

TLS data format tests. More...

#include <string.h>
#include <byteswap.h>
#include <ipxe/tls.h>
#include <ipxe/tlsfmt.h>
#include <ipxe/test.h>

Go to the source code of this file.

Data Structures

union  tlsfmt_test_data
 Space for test data. More...

Macros

#define map_version_ok(type, version)
 Report a mapping validity test result.
#define map_ok(type)
 Report a mapping validity test result.
#define cursor_ok(cursor, reference)
#define pre_ext_ok(data, ext, reference, reference_ext)

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static void cursor_okx (struct tls_cursor *cursor, struct tls_cursor *reference, const char *file, unsigned int line)
 Report a cursor comparison test result.
static void pre_ext_okx (const void *data, struct tls_cursor *extensions, const void *reference, struct tls_cursor *reference_ext, const char *file, unsigned int line)
 Report a pre-extensions comparison test result.
static void tlsfmt_test_exec (void)
 Perform TLS data format self-test.

Variables

static uint8_t tls13_server_hello []
 Known valid TLSv1.3 ServerHello (from RFC 8448).
static uint8_t tls13_server_hello_random []
 TLSv1.3 ServerHello random bytes.
static uint8_t tls13_server_hello_public []
 TLSv1.3 ServerHello public key.
static uint8_t tls13_certificate []
 Known valid TLSv1.3 Certificate (from RFC 8448).
static uint8_t tls12_certificate []
 TLSv1.2 Certificate (derived from RFC 8448).
static uint8_t tls11_server_hello []
 TLSv1.1 ServerHello with no extensions.
static uint8_t tls12_server_key_exchange_ecdhe []
 TLSv1.2 ServerKeyExchange with explicit signature hash algorithm.
static uint8_t tls11_server_key_exchange_ecdhe []
 TLSv1.1 ServerKeyExchange with implicit signature hash algorithm.
static uint8_t server_key_exchange_point []
 ServerKeyExchange public curve point.
static uint8_t server_key_exchange_sig []
 ServerKeyExchange signature.
static uint8_t tls13_client_hello []
 Reference TLSv1.3 ClientHello (from RFC 8448).
static uint8_t tls13_client_hello_random []
 TLSv1.3 ClientHello random bytes.
static uint8_t tls13_client_hello_suites []
 TLSv1.3 ClientHello cipher suites.
static uint8_t tls13_client_hello_groups []
 TLSv1.3 ClientHello supported groups.
static uint8_t tls13_client_hello_public []
 TLSv1.3 ClientHello public key.
static uint8_t tls13_client_hello_sigs []
 TLSv1.3 ClientHello signature algorithms.
static uint8_t tls13_client_hello_supvers [] = { 0x03, 0x04 }
 TLSv1.3 ClientHello supported version.
static uint8_t tls13_client_hello_pskmodes [] = { 0x01 }
 TLSv1.3 ClientHello pre-shared key modes.
struct self_test tlsfmt_test __self_test
 TLS data format self-test.

Detailed Description

TLS data format tests.

Definition in file tlsfmt_test.c.

Macro Definition Documentation

◆ map_version_ok

#define map_version_ok ( type,
version )
Value:
do { \
struct tls_cursor cursor; \
struct type desc; \
void *empty; \
\
memset ( &desc, 0, sizeof ( desc ) ); \
ok ( tls_size ( type, version, &desc, &cursor ) == 0 ); \
empty = zalloc ( cursor.len ); \
ok ( empty != NULL ); \
cursor.data = empty; \
ok ( tls_build ( type, version, &desc, &cursor ) == 0 ); \
ok ( tls_parse ( type, version, &cursor, &desc ) == 0 ); \
free ( empty ); \
} while ( 0 )
#define NULL
NULL pointer (VOID *).
Definition Base.h:321
u32 version
Driver version.
Definition ath9k_hw.c:1985
uint32_t type
Operating system type.
Definition ena.h:1
struct ena_llq_option desc
Descriptor counts.
Definition ena.h:9
void * zalloc(size_t size)
Allocate cleared memory.
Definition malloc.c:718
A TLS variable-length data cursor.
Definition tlsfmt.h:186
#define tls_build(type, version, desc, cursor)
Build TLS data structure.
Definition tlsfmt.h:763
#define tls_parse(type, version, cursor, desc)
Parse TLS data structure.
Definition tlsfmt.h:733
#define tls_size(type, version, desc, cursor)
Calculate length of TLS data structure.
Definition tlsfmt.h:778

Report a mapping validity test result.

Parameters
typeDescriptor structure name
versionProtocol version

Definition at line 340 of file tlsfmt_test.c.

340#define map_version_ok( type, version ) do { \
341 struct tls_cursor cursor; \
342 struct type desc; \
343 void *empty; \
344 \
345 memset ( &desc, 0, sizeof ( desc ) ); \
346 ok ( tls_size ( type, version, &desc, &cursor ) == 0 ); \
347 empty = zalloc ( cursor.len ); \
348 ok ( empty != NULL ); \
349 cursor.data = empty; \
350 ok ( tls_build ( type, version, &desc, &cursor ) == 0 ); \
351 ok ( tls_parse ( type, version, &cursor, &desc ) == 0 ); \
352 free ( empty ); \
353 } while ( 0 )

◆ map_ok

#define map_ok ( type)
Value:
do { \
map_version_ok ( type, TLS_VERSION_TLS_1_1 ); \
map_version_ok ( type, TLS_VERSION_TLS_1_2 ); \
map_version_ok ( type, TLS_VERSION_TLS_1_3 ); \
} while ( 0 )
#define TLS_VERSION_TLS_1_2
TLS version 1.2.
Definition tlsfmt.h:177
#define TLS_VERSION_TLS_1_3
TLS version 1.3.
Definition tlsfmt.h:180
#define TLS_VERSION_TLS_1_1
TLS version 1.1.
Definition tlsfmt.h:174

Report a mapping validity test result.

Parameters
typeDescriptor structure name

Definition at line 360 of file tlsfmt_test.c.

360#define map_ok( type ) do { \
361 map_version_ok ( type, TLS_VERSION_TLS_1_1 ); \
362 map_version_ok ( type, TLS_VERSION_TLS_1_2 ); \
363 map_version_ok ( type, TLS_VERSION_TLS_1_3 ); \
364 } while ( 0 )

Referenced by tlsfmt_test_exec().

◆ cursor_ok

#define cursor_ok ( cursor,
reference )
Value:
cursor_okx ( (cursor), (reference), __FILE__, __LINE__ )
static void cursor_okx(struct tls_cursor *cursor, struct tls_cursor *reference, const char *file, unsigned int line)
Report a cursor comparison test result.

Definition at line 383 of file tlsfmt_test.c.

383#define cursor_ok( cursor, reference ) \
384 cursor_okx ( (cursor), (reference), __FILE__, __LINE__ )

Referenced by tlsfmt_test_exec().

◆ pre_ext_ok

#define pre_ext_ok ( data,
ext,
reference,
reference_ext )
Value:
pre_ext_okx ( (data), (ext), (reference), (reference_ext), \
__FILE__, __LINE__ )
uint16_t ext
Extended status.
Definition ena.h:9
uint8_t data[48]
Additional event data.
Definition ena.h:11
static void pre_ext_okx(const void *data, struct tls_cursor *extensions, const void *reference, struct tls_cursor *reference_ext, const char *file, unsigned int line)
Report a pre-extensions comparison test result.

Definition at line 407 of file tlsfmt_test.c.

407#define pre_ext_ok( data, ext, reference, reference_ext ) \
408 pre_ext_okx ( (data), (ext), (reference), (reference_ext), \
409 __FILE__, __LINE__ )

Referenced by tlsfmt_test_exec().

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ cursor_okx()

void cursor_okx ( struct tls_cursor * cursor,
struct tls_cursor * reference,
const char * file,
unsigned int line )
static

Report a cursor comparison test result.

Parameters
cursorCursor
referenceReference cursor
fileTest code file
lineTest code line

Definition at line 374 of file tlsfmt_test.c.

376 {
377
378 /* Compare cursors */
379 okx ( cursor->len == reference->len, file, line );
380 okx ( memcmp ( cursor->data, reference->data, reference->len ) == 0,
381 file, line );
382}
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
Definition string.c:115
void * data
Data.
Definition tlsfmt.h:188
size_t len
Length of data.
Definition tlsfmt.h:190
#define okx(success, file, line)
Report test result.
Definition test.h:44

References tls_cursor::data, tls_cursor::len, memcmp(), and okx.

◆ pre_ext_okx()

void pre_ext_okx ( const void * data,
struct tls_cursor * extensions,
const void * reference,
struct tls_cursor * reference_ext,
const char * file,
unsigned int line )
static

Report a pre-extensions comparison test result.

Parameters
dataData
extExtensions
referenceReference data
reference_extReference extensions
fileTest code file
lineTest code line

Definition at line 396 of file tlsfmt_test.c.

399 {
400 size_t reference_len = ( reference_ext->data - reference );
401 size_t len = ( extensions->data - data );
402
403 /* Compare cursors */
404 okx ( len == reference_len, file, line );
405 okx ( memcmp ( data, reference, reference_len ) == 0, file, line );
406}
ring len
Length.
Definition dwmac.h:226

References data, tls_cursor::data, len, memcmp(), and okx.

◆ tlsfmt_test_exec()

void tlsfmt_test_exec ( void )
static

Perform TLS data format self-test.

Definition at line 415 of file tlsfmt_test.c.

415 {
416 union tlsfmt_test_data u;
417 struct tls_cursor cursor;
418 struct tls_client_hello client_hello;
419 struct tls_client_hello client_hello_ref;
420 struct tls_server_hello server_hello;
421 struct tls_server_hello server_hello_ref;
422 struct tls_supported_version supported_version;
423 struct tls_supported_versions supported_versions;
424 struct tls_key_share_entry key_share_entry;
425 struct tls_key_share_client_hello key_share_client_hello;
426 struct tls_certificate certificate;
427 struct tls_certificate_entry certificate_entry;
428 struct tls_server_key_exchange_ecdhe server_key_exchange_ecdhe;
429 struct tls_digitally_signed digitally_signed;
430 struct tls_server_name server_name;
431 struct tls_server_name_list server_name_list;
432 struct tls_psk_key_exchange_modes psk_key_exchange_modes;
433 struct x509_certificate *tls13_cert;
434 struct x509_certificate *tls12_cert;
435 unsigned int offset;
436 uint16_t __attribute__ (( aligned ( 1 ) )) *tmp16;
438 uint16_t record;
439 uint8_t empty[0];
440
441 /* Check validity of all mappings */
469
470 /* Well-formed TLSv1.3 ServerHello */
471 memset ( u.tls13_server_hello, 0xaa, sizeof ( u.tls13_server_hello ) );
472 memcpy ( u.tls13_server_hello, tls13_server_hello,
473 sizeof ( tls13_server_hello ) );
474 cursor.data = u.tls13_server_hello;
475 cursor.len = sizeof ( tls13_server_hello );
477 &server_hello ) == 0 );
478 ok ( server_hello.a->version == htons ( TLS_VERSION_TLS_1_2 ) );
479 ok ( server_hello.session_id.data != NULL );
480 ok ( server_hello.session_id.len == 0 );
481 ok ( server_hello.b->suite == htons ( TLS_AES_128_GCM_SHA256 ) );
482 ok ( server_hello.ext.reneg.data == NULL );
483 ok ( server_hello.ext.ems.data == NULL );
484 ok ( server_hello.ext.supver.data != NULL );
485 ok ( server_hello.ext.key.data != NULL );
487 &server_hello.ext.supver, &supported_version ) == 0 );
488 ok ( *supported_version.selected == htons ( TLS_VERSION_TLS_1_3 ) );
490 &server_hello.ext.key, &key_share_entry ) == 0 );
491 ok ( *key_share_entry.group == htons ( TLS_NAMED_GROUP_X25519 ) );
492 ok ( key_share_entry.public.data != NULL );
493 ok ( key_share_entry.public.len ==
494 sizeof ( tls13_server_hello_public ) );
495 ok ( key_share_entry.next.data != NULL );
496 ok ( key_share_entry.next.len == 0 );
497
498 /* Truncated fixed-length data */
499 cursor.data = server_hello.ext.supver.data;
500 cursor.len = server_hello.ext.supver.len;
502 &cursor, &supported_version ) == 0 );
503 cursor.len -= 1;
505 &cursor, &supported_version ) != 0 );
506
507 /* Truncated variable-length length */
508 cursor.data = server_hello.ext.key.data;
509 cursor.len = server_hello.ext.key.len;
511 &key_share_entry ) == 0 );
512 cursor.len = ( sizeof ( *key_share_entry.group ) + 1 );
514 &key_share_entry ) != 0 );
515
516 /* Truncated variable-length data */
517 cursor.data = u.tls13_server_hello;
518 cursor.len = sizeof ( tls13_server_hello );
520 &server_hello ) == 0 );
521 cursor.len -= 1;
523 &server_hello ) != 0 );
524
525 /* Excess data */
526 cursor.data = u.tls13_server_hello;
527 cursor.len = sizeof ( tls13_server_hello );
529 &server_hello ) == 0 );
530 cursor.len += 1;
532 &server_hello ) != 0 );
533
534 /* Duplicate extension type */
535 cursor.data = u.tls13_server_hello;
536 cursor.len = sizeof ( tls13_server_hello );
538 &server_hello ) == 0 );
539 offset = ( server_hello.ext.key.data - cursor.data - 4 );
540 tmp16 = ( ( void * ) &u.tls13_server_hello[offset] );
541 ok ( *tmp16 == htons ( TLS_KEY_SHARE ) );
542 *tmp16 = htons ( TLS_RENEGOTIATION_INFO );
544 &server_hello ) == 0 );
545 *tmp16 = htons ( TLS_SUPPORTED_VERSIONS );
547 &server_hello ) != 0 );
548 *tmp16 = htons ( TLS_KEY_SHARE );
550 &server_hello ) == 0 );
551
552 /* Malformed extension length */
553 cursor.data = u.tls13_server_hello;
554 cursor.len = sizeof ( tls13_server_hello );
556 &server_hello ) == 0 );
557 offset = ( server_hello.ext.key.data - cursor.data - 2 );
558 tmp16 = ( ( void * ) &u.tls13_server_hello[offset] );
559 ok ( *tmp16 == htons ( 36 ) );
560 *tmp16 = htons ( sizeof ( tls13_server_hello ) );
562 &server_hello ) != 0 );
563 *tmp16 = htons ( 36 );
565 &server_hello ) == 0 );
566
567 /* Well-formed TLSv1.3 Certificate */
568 memcpy ( u.tls13_certificate, tls13_certificate,
569 sizeof ( tls13_certificate ) );
570 cursor.data = u.tls13_certificate;
571 cursor.len = sizeof ( tls13_certificate );
573 &certificate ) == 0 );
575 &certificate.list, &certificate_entry ) == 0 );
576 ok ( x509_certificate ( certificate_entry.cert.data,
577 certificate_entry.cert.len,
578 &tls13_cert ) == 0 );
579 ok ( certificate_entry.next.data != NULL );
580 ok ( certificate_entry.next.len == 0 );
581 ok ( asn1_compare ( tls_asn1 ( &certificate_entry.cert ),
582 &tls13_cert->raw ) == 0 );
583
584 /* Fields not present in older TLS versions */
586 &certificate ) == 0 );
588 &certificate ) != 0 );
589
590 /* Well-formed TLSv1.2 Certificate */
591 memcpy ( u.tls12_certificate, tls12_certificate,
592 sizeof ( tls12_certificate ) );
593 cursor.data = u.tls12_certificate;
594 cursor.len = sizeof ( tls12_certificate );
596 &certificate ) == 0 );
598 &certificate.list, &certificate_entry ) == 0 );
599 ok ( x509_certificate ( certificate_entry.cert.data,
600 certificate_entry.cert.len,
601 &tls12_cert ) == 0 );
602 ok ( certificate_entry.next.data != NULL );
603 ok ( certificate_entry.next.len == 0 );
604 ok ( asn1_compare ( tls_asn1 ( &certificate_entry.cert ),
605 &tls12_cert->raw ) == 0 );
606 ok ( tls12_cert == tls13_cert );
607
608 /* Fields not present in newer TLS versions */
610 &certificate ) == 0 );
612 &certificate ) != 0 );
613
614 /* Well-formed TLSv1.1 ServerHello with no extensions */
615 memcpy ( u.tls11_server_hello, tls11_server_hello,
616 sizeof ( tls11_server_hello ) );
617 cursor.data = u.tls11_server_hello;
618 cursor.len = sizeof ( tls11_server_hello );
620 &server_hello ) == 0 );
622 &server_hello ) == 0 );
624 &server_hello ) != 0 );
625
626 /* Well-formed TLSv1.2 ServerKeyExchange with explicit algorithm */
627 memcpy ( u.tls12_server_key_exchange_ecdhe,
630 cursor.data = u.tls12_server_key_exchange_ecdhe;
631 cursor.len = sizeof ( tls12_server_key_exchange_ecdhe );
633 &cursor, &server_key_exchange_ecdhe ) == 0 );
634 ok ( server_key_exchange_ecdhe.curve->type == TLS_NAMED_CURVE_TYPE );
635 ok ( server_key_exchange_ecdhe.curve->group ==
638 &cursor, &server_key_exchange_ecdhe ) == 0 );
640 &server_key_exchange_ecdhe.dsig,
641 &digitally_signed ) == 0 );
642 ok ( digitally_signed.sig_hash != NULL );
643 ok ( *digitally_signed.sig_hash == htons ( TLS_RSA_SHA1_ALGORITHM ) );
645 &server_key_exchange_ecdhe.dsig,
646 &digitally_signed ) != 0 );
647
648 /* Well-formed TLSv1.1 ServerKeyExchange with implicit algorithm */
649 memcpy ( u.tls11_server_key_exchange_ecdhe,
652 cursor.data = u.tls11_server_key_exchange_ecdhe;
653 cursor.len = sizeof ( tls11_server_key_exchange_ecdhe );
655 &cursor, &server_key_exchange_ecdhe ) == 0 );
656 ok ( server_key_exchange_ecdhe.curve->type == TLS_NAMED_CURVE_TYPE );
657 ok ( server_key_exchange_ecdhe.curve->group ==
660 &cursor, &server_key_exchange_ecdhe ) == 0 );
662 &server_key_exchange_ecdhe.dsig,
663 &digitally_signed ) == 0 );
664 ok ( digitally_signed.sig_hash == NULL );
666 &server_key_exchange_ecdhe.dsig,
667 &digitally_signed ) != 0 );
668
669 /* Build TLSv1.3 ServerHello */
670 memset ( &supported_version, 0, sizeof ( supported_version ) );
671 memset ( &key_share_entry, 0, sizeof ( key_share_entry ) );
672 memset ( &server_hello, 0, sizeof ( server_hello ) );
674 key_share_entry.group = &group;
675 key_share_entry.public.data = tls13_server_hello_public;
676 key_share_entry.public.len = sizeof ( tls13_server_hello_public );
678 &supported_version, &server_hello.ext.supver ) == 0 );
680 &key_share_entry, &server_hello.ext.key ) == 0 );
682 &server_hello, &cursor ) == 0 );
683 ok ( cursor.len == sizeof ( tls13_server_hello ) );
684 cursor.data = u.tls13_server_hello;
686 &server_hello, &cursor ) == 0 );
687 server_hello.a->version = htons ( TLS_VERSION_TLS_1_2 );
688 memcpy ( server_hello.a->random, tls13_server_hello_random,
689 sizeof ( server_hello.a->random ) );
690 server_hello.b->suite = htons ( TLS_AES_128_GCM_SHA256 );
692 &key_share_entry, &server_hello.ext.key ) == 0 );
694 &supported_version, &server_hello.ext.supver ) == 0 );
695 *supported_version.selected = htons ( TLS_VERSION_TLS_1_3 );
696 DBGC ( &cursor, "TLSFMT built TLSv1.3 ServerHello:\n" );
697 DBGC_HDA ( &cursor, 0, cursor.data, cursor.len );
698 DBGC ( &cursor, "TLSFMT reference TLSv1.3 ServerHello:\n" );
699 DBGC_HDA ( &cursor, 0, tls13_server_hello,
700 sizeof ( tls13_server_hello ) );
701 cursor.data = tls13_server_hello;
702 cursor.len = sizeof ( tls13_server_hello );
704 &cursor, &server_hello_ref ) == 0 );
705 pre_ext_ok ( u.tls13_server_hello, &server_hello.ext.all,
706 tls13_server_hello, &server_hello_ref.ext.all );
707 cursor_ok ( &server_hello.ext.supver, &server_hello_ref.ext.supver );
708 cursor_ok ( &server_hello.ext.key, &server_hello_ref.ext.key );
709
710 /* Build TLSv1.2 ServerKeyExchange */
711 memset ( &digitally_signed, 0, sizeof ( digitally_signed ) );
712 memset ( &server_key_exchange_ecdhe, 0,
713 sizeof ( server_key_exchange_ecdhe ) );
714 server_key_exchange_ecdhe.point.data = server_key_exchange_point;
715 server_key_exchange_ecdhe.point.len =
716 sizeof ( server_key_exchange_point );
717 digitally_signed.sig.data = server_key_exchange_sig;
718 digitally_signed.sig.len = sizeof ( server_key_exchange_sig );
720 &digitally_signed,
721 &server_key_exchange_ecdhe.dsig ) == 0 );
723 &server_key_exchange_ecdhe, &cursor ) == 0 );
724 ok ( cursor.len == sizeof ( tls12_server_key_exchange_ecdhe ) );
725 cursor.data = u.tls12_server_key_exchange_ecdhe;
727 &server_key_exchange_ecdhe, &cursor ) == 0 );
729 &digitally_signed,
730 &server_key_exchange_ecdhe.dsig ) == 0 );
731 server_key_exchange_ecdhe.curve->type = TLS_NAMED_CURVE_TYPE;
732 server_key_exchange_ecdhe.curve->group =
734 ok ( digitally_signed.sig_hash != NULL );
735 *digitally_signed.sig_hash = htons ( TLS_RSA_SHA1_ALGORITHM );
736 DBGC ( &cursor, "TLSFMT built TLSv1.2 ServerKeyExchange:\n" );
737 DBGC_HDA ( &cursor, 0, cursor.data, cursor.len );
738 DBGC ( &cursor, "TLSFMT reference TLSv1.2 ServerKeyExchange:\n" );
741 ok ( memcmp ( u.tls12_server_key_exchange_ecdhe,
743 sizeof ( tls12_server_key_exchange_ecdhe ) ) == 0 );
744
745 /* Build TLSv1.1 ServerKeyExchange */
746 memset ( &digitally_signed, 0, sizeof ( digitally_signed ) );
747 memset ( &server_key_exchange_ecdhe, 0,
748 sizeof ( server_key_exchange_ecdhe ) );
749 server_key_exchange_ecdhe.point.data = server_key_exchange_point;
750 server_key_exchange_ecdhe.point.len =
751 sizeof ( server_key_exchange_point );
752 digitally_signed.sig.data = server_key_exchange_sig;
753 digitally_signed.sig.len = sizeof ( server_key_exchange_sig );
755 &digitally_signed,
756 &server_key_exchange_ecdhe.dsig ) == 0 );
758 &server_key_exchange_ecdhe, &cursor ) == 0 );
759 ok ( cursor.len == sizeof ( tls11_server_key_exchange_ecdhe ) );
760 cursor.data = u.tls11_server_key_exchange_ecdhe;
762 &server_key_exchange_ecdhe, &cursor ) == 0 );
764 &digitally_signed,
765 &server_key_exchange_ecdhe.dsig ) == 0 );
766 server_key_exchange_ecdhe.curve->type = TLS_NAMED_CURVE_TYPE;
767 server_key_exchange_ecdhe.curve->group =
769 ok ( digitally_signed.sig_hash == NULL );
770 DBGC ( &cursor, "TLSFMT built TLSv1.1 ServerKeyExchange:\n" );
771 DBGC_HDA ( &cursor, 0, cursor.data, cursor.len );
772 DBGC ( &cursor, "TLSFMT reference TLSv1.1 ServerKeyExchange:\n" );
775 ok ( memcmp ( u.tls11_server_key_exchange_ecdhe,
777 sizeof ( tls11_server_key_exchange_ecdhe ) ) == 0 );
778
779 /* Build TLSv1.3 ClientHello */
780 memset ( &server_name, 0, sizeof ( server_name ) );
781 memset ( &server_name_list, 0, sizeof ( server_name_list ) );
782 memset ( &key_share_entry, 0, sizeof ( key_share_entry ) );
783 memset ( &key_share_client_hello, 0,
784 sizeof ( key_share_client_hello ) );
785 memset ( &supported_versions, 0, sizeof ( supported_versions ) );
786 memset ( &psk_key_exchange_modes, 0,
787 sizeof ( psk_key_exchange_modes ) );
788 memset ( &client_hello, 0, sizeof ( client_hello ) );
789 server_name.name.data = "server";
790 server_name.name.len = strlen ( server_name.name.data );
792 &server_name, &server_name_list.list ) == 0 );
794 &server_name_list, &client_hello.ext.names ) == 0 );
796 key_share_entry.group = &group;
797 key_share_entry.public.data = tls13_client_hello_public;
798 key_share_entry.public.len = sizeof ( tls13_client_hello_public );
800 &key_share_entry,
801 &key_share_client_hello.list ) == 0 );
803 &key_share_client_hello,
804 &client_hello.ext.keys ) == 0 );
805 supported_versions.list.data = tls13_client_hello_supvers;
806 supported_versions.list.len = sizeof ( tls13_client_hello_supvers );
808 &supported_versions,
809 &client_hello.ext.supvers ) == 0 );
810 psk_key_exchange_modes.list.data = tls13_client_hello_pskmodes;
811 psk_key_exchange_modes.list.len =
814 &psk_key_exchange_modes,
815 &client_hello.ext.pskmodes ) == 0 );
816 client_hello.suites.data = tls13_client_hello_suites;
817 client_hello.suites.len = sizeof ( tls13_client_hello_suites );
818 client_hello.compression.len = 1;
819 client_hello.ext.reneg.len = 1;
820 client_hello.ext.groups.data = tls13_client_hello_groups;
821 client_hello.ext.groups.len = sizeof ( tls13_client_hello_groups );
822 client_hello.ext.ticket.data = empty;
823 client_hello.ext.sigs.data = tls13_client_hello_sigs;
824 client_hello.ext.sigs.len = sizeof ( tls13_client_hello_sigs );
825 record = htons ( 0x4001 );
826 client_hello.ext.record.data = &record;
827 client_hello.ext.record.len = sizeof ( record );
829 &client_hello, &cursor ) == 0 );
830 ok ( cursor.len == sizeof ( tls13_client_hello ) );
831 cursor.data = u.tls13_client_hello;
833 &client_hello, &cursor ) == 0 );
834 client_hello.a->version = htons ( TLS_VERSION_TLS_1_2 );
836 &server_name_list, &client_hello.ext.names ) == 0 );
838 &server_name, &server_name_list.list ) == 0 );
840 &key_share_client_hello,
841 &client_hello.ext.keys ) == 0 );
843 &key_share_entry,
844 &key_share_client_hello.list ) == 0 );
846 &supported_versions,
847 &client_hello.ext.supvers ) == 0 );
849 &psk_key_exchange_modes,
850 &client_hello.ext.pskmodes ) == 0 );
851 memcpy ( client_hello.a->random, tls13_client_hello_random,
852 sizeof ( client_hello.a->random ) );
853 DBGC ( &cursor, "TLSFMT built TLSv1.3 ClientHello:\n" );
854 DBGC_HDA ( &cursor, 0, cursor.data, cursor.len );
855 DBGC ( &cursor, "TLSFMT reference TLSv1.3 ClientHello:\n" );
856 DBGC_HDA ( &cursor, 0, tls13_client_hello,
857 sizeof ( tls13_client_hello ) );
858 cursor.data = tls13_client_hello;
859 cursor.len = sizeof ( tls13_client_hello );
861 &cursor, &client_hello_ref ) == 0 );
862 pre_ext_ok ( u.tls13_client_hello, &client_hello.ext.all,
863 tls13_client_hello, &client_hello_ref.ext.all );
864 cursor_ok ( &client_hello.ext.ems, &client_hello_ref.ext.ems );
865 cursor_ok ( &client_hello.ext.frag, &client_hello_ref.ext.frag );
866 cursor_ok ( &client_hello.ext.groups, &client_hello_ref.ext.groups );
867 cursor_ok ( &client_hello.ext.keys, &client_hello_ref.ext.keys );
868 cursor_ok ( &client_hello.ext.names, &client_hello_ref.ext.names );
869 cursor_ok ( &client_hello.ext.pskmodes,
870 &client_hello_ref.ext.pskmodes );
871 cursor_ok ( &client_hello.ext.record, &client_hello_ref.ext.record );
872 cursor_ok ( &client_hello.ext.reneg, &client_hello_ref.ext.reneg );
873 cursor_ok ( &client_hello.ext.sigs, &client_hello_ref.ext.sigs );
874 cursor_ok ( &client_hello.ext.supvers, &client_hello_ref.ext.supvers );
875 cursor_ok ( &client_hello.ext.ticket, &client_hello_ref.ext.ticket );
876
877 /* Propagation of sizing errors */
878 memset ( &digitally_signed, 0, sizeof ( digitally_signed ) );
879 memset ( &server_key_exchange_ecdhe, 0,
880 sizeof ( server_key_exchange_ecdhe ) );
882 &digitally_signed,
883 &server_key_exchange_ecdhe.dsig ) == 0 );
885 &server_key_exchange_ecdhe, &cursor ) == 0 );
886 memset ( &digitally_signed, 0, sizeof ( digitally_signed ) );
887 memset ( &server_key_exchange_ecdhe, 0,
888 sizeof ( server_key_exchange_ecdhe ) );
889 digitally_signed.sig.len = 0x10000;
891 &digitally_signed,
892 &server_key_exchange_ecdhe.dsig ) != 0 );
894 &server_key_exchange_ecdhe, &cursor ) != 0 );
895
896 /* Drop certificate references */
897 x509_put ( tls12_cert );
898 x509_put ( tls13_cert );
899}
unsigned short uint16_t
Definition stdint.h:11
unsigned char uint8_t
Definition stdint.h:10
int asn1_compare(const struct asn1_cursor *cursor1, const struct asn1_cursor *cursor2)
Compare two ASN.1 objects.
Definition asn1.c:566
uint16_t offset
Offset to command line.
Definition bzimage.h:3
union @104331263140136355135267063077374276003064103115 u
uint16_t group
Type of event.
Definition ena.h:1
#define DBGC(...)
Definition compiler.h:530
#define DBGC_HDA(...)
Definition compiler.h:531
#define htons(value)
Definition byteswap.h:136
#define __attribute__(x)
Definition compiler.h:10
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * memset(void *dest, int character, size_t len) __nonnull
size_t strlen(const char *src)
Get length of string.
Definition string.c:244
CertificateEntry descriptor.
Definition tlsfmt.h:400
Certificate descriptor.
Definition tlsfmt.h:392
ClientHello descriptor.
Definition tlsfmt.h:413
ClientKeyExchange descriptor (for DHE).
Definition tlsfmt.h:459
ClientKeyExchange descriptor (for ECDHE).
Definition tlsfmt.h:465
ClientKeyExchange descriptor (for key transport).
Definition tlsfmt.h:471
DigitallySigned descriptor.
Definition tlsfmt.h:491
Extension descriptor.
Definition tlsfmt.h:499
HelloRequest descriptor.
Definition tlsfmt.h:509
KeyShareClientHello descriptor.
Definition tlsfmt.h:512
KeyShareEntry descriptor.
Definition tlsfmt.h:518
KeyShareHelloRetryRequest descriptor.
Definition tlsfmt.h:528
KeyShareServerHello descriptor.
Definition tlsfmt.h:534
MaxFragmentLength descriptor.
Definition tlsfmt.h:554
NamedGroupList descriptor.
Definition tlsfmt.h:560
NewSessionTicket descriptor.
Definition tlsfmt.h:566
PskKeyExchangeModes descriptor.
Definition tlsfmt.h:583
RenegotiationInfo descriptor.
Definition tlsfmt.h:589
ServerHelloDone descriptor.
Definition tlsfmt.h:630
ServerHello descriptor.
Definition tlsfmt.h:595
ServerKeyExchange descriptor (for DHE).
Definition tlsfmt.h:633
ServerKeyExchange descriptor (for ECDHE).
Definition tlsfmt.h:645
ServerNameList descriptor.
Definition tlsfmt.h:668
ServerName descriptor.
Definition tlsfmt.h:660
SignatureSchemeList descriptor.
Definition tlsfmt.h:674
SupportedVersions descriptor (in ServerHello).
Definition tlsfmt.h:680
SupportedVersions descriptor (in ClientHello).
Definition tlsfmt.h:686
An X.509 certificate.
Definition x509.h:216
struct asn1_cursor raw
Raw certificate.
Definition x509.h:231
#define ok(success)
Definition test.h:46
#define TLS_RENEGOTIATION_INFO
Definition tls.h:201
#define TLS_KEY_SHARE
Definition tls.h:198
#define TLS_SUPPORTED_VERSIONS
Definition tls.h:189
#define TLS_AES_128_GCM_SHA256
Definition tls.h:124
#define TLS_RSA_SHA1_ALGORITHM
Definition tls.h:140
#define TLS_NAMED_GROUP_X25519
Definition tls.h:171
#define TLS_NAMED_CURVE_TYPE
TLS named curve type.
Definition tls.h:305
static const struct asn1_cursor * tls_asn1(const struct tls_cursor *cursor)
Get ASN.1 cursor from TLS cursor.
Definition tlsfmt.h:698
static uint8_t tls13_client_hello_supvers[]
TLSv1.3 ClientHello supported version.
static uint8_t server_key_exchange_point[]
ServerKeyExchange public curve point.
static uint8_t tls11_server_hello[]
TLSv1.1 ServerHello with no extensions.
#define cursor_ok(cursor, reference)
static uint8_t tls11_server_key_exchange_ecdhe[]
TLSv1.1 ServerKeyExchange with implicit signature hash algorithm.
static uint8_t tls13_client_hello_sigs[]
TLSv1.3 ClientHello signature algorithms.
static uint8_t tls13_server_hello_public[]
TLSv1.3 ServerHello public key.
Definition tlsfmt_test.c:61
static uint8_t server_key_exchange_sig[]
ServerKeyExchange signature.
static uint8_t tls13_client_hello_random[]
TLSv1.3 ClientHello random bytes.
#define map_ok(type)
Report a mapping validity test result.
static uint8_t tls13_server_hello_random[]
TLSv1.3 ServerHello random bytes.
Definition tlsfmt_test.c:54
static uint8_t tls13_client_hello_suites[]
TLSv1.3 ClientHello cipher suites.
static uint8_t tls13_server_hello[]
Known valid TLSv1.3 ServerHello (from RFC 8448).
Definition tlsfmt_test.c:42
#define pre_ext_ok(data, ext, reference, reference_ext)
static uint8_t tls13_client_hello_groups[]
TLSv1.3 ClientHello supported groups.
static uint8_t tls12_server_key_exchange_ecdhe[]
TLSv1.2 ServerKeyExchange with explicit signature hash algorithm.
static uint8_t tls12_certificate[]
TLSv1.2 Certificate (derived from RFC 8448).
static uint8_t tls13_client_hello_public[]
TLSv1.3 ClientHello public key.
static uint8_t tls13_certificate[]
Known valid TLSv1.3 Certificate (from RFC 8448).
Definition tlsfmt_test.c:68
static uint8_t tls13_client_hello[]
Reference TLSv1.3 ClientHello (from RFC 8448).
static uint8_t tls13_client_hello_pskmodes[]
TLSv1.3 ClientHello pre-shared key modes.
Space for test data.
static void x509_put(struct x509_certificate *cert)
Drop reference to X.509 certificate.
Definition x509.h:278

References __attribute__, tls_client_hello::a, tls_server_hello::a, tls_client_hello::all, tls_server_hello::all, asn1_compare(), tls_server_hello::b, tls_certificate_entry::cert, tls_client_hello::compression, cursor_ok, tls_server_key_exchange_ecdhe::curve, tls_cursor::data, DBGC, DBGC_HDA, tls_server_key_exchange_ecdhe::dsig, tls_client_hello::ems, tls_server_hello::ems, tls_client_hello::ext, tls_server_hello::ext, tls_client_hello::frag, group, tls_key_share_entry::group, tls_server_key_exchange_ecdhe::group, tls_client_hello::groups, htons, tls_server_hello::key, tls_client_hello::keys, tls_cursor::len, tls_certificate::list, tls_key_share_client_hello::list, tls_psk_key_exchange_modes::list, tls_server_name_list::list, tls_supported_versions::list, map_ok, memcmp(), memcpy(), memset(), tls_server_name::name, tls_client_hello::names, tls_certificate_entry::next, tls_key_share_entry::next, NULL, offset, ok, tls_server_key_exchange_ecdhe::point, pre_ext_ok, tls_client_hello::pskmodes, tls_key_share_entry::public, tls_client_hello::random, tls_server_hello::random, x509_certificate::raw, tls_client_hello::record, tls_client_hello::reneg, tls_server_hello::reneg, tls_supported_version::selected, server_key_exchange_point, server_key_exchange_sig, tls_server_hello::session_id, tls_digitally_signed::sig, tls_digitally_signed::sig_hash, tls_client_hello::sigs, strlen(), tls_server_hello::suite, tls_client_hello::suites, tls_server_hello::supver, tls_client_hello::supvers, tls_client_hello::ticket, tls11_server_hello, tls11_server_key_exchange_ecdhe, tls12_certificate, tls12_server_key_exchange_ecdhe, tls13_certificate, tls13_client_hello, tls13_client_hello_groups, tls13_client_hello_pskmodes, tls13_client_hello_public, tls13_client_hello_random, tls13_client_hello_sigs, tls13_client_hello_suites, tls13_client_hello_supvers, tls13_server_hello, tls13_server_hello_public, tls13_server_hello_random, TLS_AES_128_GCM_SHA256, tls_asn1(), tls_build, TLS_KEY_SHARE, TLS_NAMED_CURVE_TYPE, TLS_NAMED_GROUP_X25519, tls_parse, TLS_RENEGOTIATION_INFO, TLS_RSA_SHA1_ALGORITHM, tls_size, TLS_SUPPORTED_VERSIONS, TLS_VERSION_TLS_1_1, TLS_VERSION_TLS_1_2, TLS_VERSION_TLS_1_3, tls_server_key_exchange_ecdhe::type, u, tls_client_hello::version, tls_server_hello::version, and x509_put().

Variable Documentation

◆ tls13_server_hello

uint8_t tls13_server_hello[]
static
Initial value:
= {
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
}

Known valid TLSv1.3 ServerHello (from RFC 8448).

Definition at line 42 of file tlsfmt_test.c.

42 {
43 0x03, 0x03, 0xa6, 0xaf, 0x06, 0xa4, 0x12, 0x18, 0x60, 0xdc, 0x5e,
44 0x6e, 0x60, 0x24, 0x9c, 0xd3, 0x4c, 0x95, 0x93, 0x0c, 0x8a, 0xc5,
45 0xcb, 0x14, 0x34, 0xda, 0xc1, 0x55, 0x77, 0x2e, 0xd3, 0xe2, 0x69,
46 0x28, 0x00, 0x13, 0x01, 0x00, 0x00, 0x2e, 0x00, 0x33, 0x00, 0x24,
47 0x00, 0x1d, 0x00, 0x20, 0xc9, 0x82, 0x88, 0x76, 0x11, 0x20, 0x95,
48 0xfe, 0x66, 0x76, 0x2b, 0xdb, 0xf7, 0xc6, 0x72, 0xe1, 0x56, 0xd6,
49 0xcc, 0x25, 0x3b, 0x83, 0x3d, 0xf1, 0xdd, 0x69, 0xb1, 0xb0, 0x4e,
50 0x75, 0x1f, 0x0f, 0x00, 0x2b, 0x00, 0x02, 0x03, 0x04
51};

Referenced by tlsfmt_test_exec().

◆ tls13_server_hello_random

uint8_t tls13_server_hello_random[]
static
Initial value:
= {
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
}

TLSv1.3 ServerHello random bytes.

Definition at line 54 of file tlsfmt_test.c.

54 {
55 0xa6, 0xaf, 0x06, 0xa4, 0x12, 0x18, 0x60, 0xdc, 0x5e, 0x6e, 0x60,
56 0x24, 0x9c, 0xd3, 0x4c, 0x95, 0x93, 0x0c, 0x8a, 0xc5, 0xcb, 0x14,
57 0x34, 0xda, 0xc1, 0x55, 0x77, 0x2e, 0xd3, 0xe2, 0x69, 0x28
58};

Referenced by tlsfmt_test_exec().

◆ tls13_server_hello_public

uint8_t tls13_server_hello_public[]
static
Initial value:
= {
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
}

TLSv1.3 ServerHello public key.

Definition at line 61 of file tlsfmt_test.c.

61 {
62 0xc9, 0x82, 0x88, 0x76, 0x11, 0x20, 0x95, 0xfe, 0x66, 0x76, 0x2b,
63 0xdb, 0xf7, 0xc6, 0x72, 0xe1, 0x56, 0xd6, 0xcc, 0x25, 0x3b, 0x83,
64 0x3d, 0xf1, 0xdd, 0x69, 0xb1, 0xb0, 0x4e, 0x75, 0x1f, 0x0f
65};

Referenced by tlsfmt_test_exec().

◆ tls13_certificate

uint8_t tls13_certificate[]
static

Known valid TLSv1.3 Certificate (from RFC 8448).

Definition at line 68 of file tlsfmt_test.c.

68 {
69 0x00, 0x00, 0x01, 0xb5, 0x00, 0x01, 0xb0, 0x30, 0x82, 0x01, 0xac,
70 0x30, 0x82, 0x01, 0x15, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01,
71 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
72 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x0e, 0x31, 0x0c, 0x30, 0x0a,
73 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x03, 0x72, 0x73, 0x61, 0x30,
74 0x1e, 0x17, 0x0d, 0x31, 0x36, 0x30, 0x37, 0x33, 0x30, 0x30, 0x31,
75 0x32, 0x33, 0x35, 0x39, 0x5a, 0x17, 0x0d, 0x32, 0x36, 0x30, 0x37,
76 0x33, 0x30, 0x30, 0x31, 0x32, 0x33, 0x35, 0x39, 0x5a, 0x30, 0x0e,
77 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x03,
78 0x72, 0x73, 0x61, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a,
79 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03,
80 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xb4,
81 0xbb, 0x49, 0x8f, 0x82, 0x79, 0x30, 0x3d, 0x98, 0x08, 0x36, 0x39,
82 0x9b, 0x36, 0xc6, 0x98, 0x8c, 0x0c, 0x68, 0xde, 0x55, 0xe1, 0xbd,
83 0xb8, 0x26, 0xd3, 0x90, 0x1a, 0x24, 0x61, 0xea, 0xfd, 0x2d, 0xe4,
84 0x9a, 0x91, 0xd0, 0x15, 0xab, 0xbc, 0x9a, 0x95, 0x13, 0x7a, 0xce,
85 0x6c, 0x1a, 0xf1, 0x9e, 0xaa, 0x6a, 0xf9, 0x8c, 0x7c, 0xed, 0x43,
86 0x12, 0x09, 0x98, 0xe1, 0x87, 0xa8, 0x0e, 0xe0, 0xcc, 0xb0, 0x52,
87 0x4b, 0x1b, 0x01, 0x8c, 0x3e, 0x0b, 0x63, 0x26, 0x4d, 0x44, 0x9a,
88 0x6d, 0x38, 0xe2, 0x2a, 0x5f, 0xda, 0x43, 0x08, 0x46, 0x74, 0x80,
89 0x30, 0x53, 0x0e, 0xf0, 0x46, 0x1c, 0x8c, 0xa9, 0xd9, 0xef, 0xbf,
90 0xae, 0x8e, 0xa6, 0xd1, 0xd0, 0x3e, 0x2b, 0xd1, 0x93, 0xef, 0xf0,
91 0xab, 0x9a, 0x80, 0x02, 0xc4, 0x74, 0x28, 0xa6, 0xd3, 0x5a, 0x8d,
92 0x88, 0xd7, 0x9f, 0x7f, 0x1e, 0x3f, 0x02, 0x03, 0x01, 0x00, 0x01,
93 0xa3, 0x1a, 0x30, 0x18, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13,
94 0x04, 0x02, 0x30, 0x00, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f,
95 0x04, 0x04, 0x03, 0x02, 0x05, 0xa0, 0x30, 0x0d, 0x06, 0x09, 0x2a,
96 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03,
97 0x81, 0x81, 0x00, 0x85, 0xaa, 0xd2, 0xa0, 0xe5, 0xb9, 0x27, 0x6b,
98 0x90, 0x8c, 0x65, 0xf7, 0x3a, 0x72, 0x67, 0x17, 0x06, 0x18, 0xa5,
99 0x4c, 0x5f, 0x8a, 0x7b, 0x33, 0x7d, 0x2d, 0xf7, 0xa5, 0x94, 0x36,
100 0x54, 0x17, 0xf2, 0xea, 0xe8, 0xf8, 0xa5, 0x8c, 0x8f, 0x81, 0x72,
101 0xf9, 0x31, 0x9c, 0xf3, 0x6b, 0x7f, 0xd6, 0xc5, 0x5b, 0x80, 0xf2,
102 0x1a, 0x03, 0x01, 0x51, 0x56, 0x72, 0x60, 0x96, 0xfd, 0x33, 0x5e,
103 0x5e, 0x67, 0xf2, 0xdb, 0xf1, 0x02, 0x70, 0x2e, 0x60, 0x8c, 0xca,
104 0xe6, 0xbe, 0xc1, 0xfc, 0x63, 0xa4, 0x2a, 0x99, 0xbe, 0x5c, 0x3e,
105 0xb7, 0x10, 0x7c, 0x3c, 0x54, 0xe9, 0xb9, 0xeb, 0x2b, 0xd5, 0x20,
106 0x3b, 0x1c, 0x3b, 0x84, 0xe0, 0xa8, 0xb2, 0xf7, 0x59, 0x40, 0x9b,
107 0xa3, 0xea, 0xc9, 0xd9, 0x1d, 0x40, 0x2d, 0xcc, 0x0c, 0xc8, 0xf8,
108 0x96, 0x12, 0x29, 0xac, 0x91, 0x87, 0xb4, 0x2b, 0x4d, 0xe1, 0x00,
109 0x00
110};

Referenced by tlsfmt_test_exec().

◆ tls12_certificate

uint8_t tls12_certificate[]
static

TLSv1.2 Certificate (derived from RFC 8448).

Definition at line 113 of file tlsfmt_test.c.

113 {
114 0x00, 0x01, 0xb3, 0x00, 0x01, 0xb0, 0x30, 0x82, 0x01, 0xac, 0x30,
115 0x82, 0x01, 0x15, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x02,
116 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
117 0x01, 0x0b, 0x05, 0x00, 0x30, 0x0e, 0x31, 0x0c, 0x30, 0x0a, 0x06,
118 0x03, 0x55, 0x04, 0x03, 0x13, 0x03, 0x72, 0x73, 0x61, 0x30, 0x1e,
119 0x17, 0x0d, 0x31, 0x36, 0x30, 0x37, 0x33, 0x30, 0x30, 0x31, 0x32,
120 0x33, 0x35, 0x39, 0x5a, 0x17, 0x0d, 0x32, 0x36, 0x30, 0x37, 0x33,
121 0x30, 0x30, 0x31, 0x32, 0x33, 0x35, 0x39, 0x5a, 0x30, 0x0e, 0x31,
122 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x03, 0x72,
123 0x73, 0x61, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86,
124 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81,
125 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xb4, 0xbb,
126 0x49, 0x8f, 0x82, 0x79, 0x30, 0x3d, 0x98, 0x08, 0x36, 0x39, 0x9b,
127 0x36, 0xc6, 0x98, 0x8c, 0x0c, 0x68, 0xde, 0x55, 0xe1, 0xbd, 0xb8,
128 0x26, 0xd3, 0x90, 0x1a, 0x24, 0x61, 0xea, 0xfd, 0x2d, 0xe4, 0x9a,
129 0x91, 0xd0, 0x15, 0xab, 0xbc, 0x9a, 0x95, 0x13, 0x7a, 0xce, 0x6c,
130 0x1a, 0xf1, 0x9e, 0xaa, 0x6a, 0xf9, 0x8c, 0x7c, 0xed, 0x43, 0x12,
131 0x09, 0x98, 0xe1, 0x87, 0xa8, 0x0e, 0xe0, 0xcc, 0xb0, 0x52, 0x4b,
132 0x1b, 0x01, 0x8c, 0x3e, 0x0b, 0x63, 0x26, 0x4d, 0x44, 0x9a, 0x6d,
133 0x38, 0xe2, 0x2a, 0x5f, 0xda, 0x43, 0x08, 0x46, 0x74, 0x80, 0x30,
134 0x53, 0x0e, 0xf0, 0x46, 0x1c, 0x8c, 0xa9, 0xd9, 0xef, 0xbf, 0xae,
135 0x8e, 0xa6, 0xd1, 0xd0, 0x3e, 0x2b, 0xd1, 0x93, 0xef, 0xf0, 0xab,
136 0x9a, 0x80, 0x02, 0xc4, 0x74, 0x28, 0xa6, 0xd3, 0x5a, 0x8d, 0x88,
137 0xd7, 0x9f, 0x7f, 0x1e, 0x3f, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3,
138 0x1a, 0x30, 0x18, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04,
139 0x02, 0x30, 0x00, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04,
140 0x04, 0x03, 0x02, 0x05, 0xa0, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86,
141 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x81,
142 0x81, 0x00, 0x85, 0xaa, 0xd2, 0xa0, 0xe5, 0xb9, 0x27, 0x6b, 0x90,
143 0x8c, 0x65, 0xf7, 0x3a, 0x72, 0x67, 0x17, 0x06, 0x18, 0xa5, 0x4c,
144 0x5f, 0x8a, 0x7b, 0x33, 0x7d, 0x2d, 0xf7, 0xa5, 0x94, 0x36, 0x54,
145 0x17, 0xf2, 0xea, 0xe8, 0xf8, 0xa5, 0x8c, 0x8f, 0x81, 0x72, 0xf9,
146 0x31, 0x9c, 0xf3, 0x6b, 0x7f, 0xd6, 0xc5, 0x5b, 0x80, 0xf2, 0x1a,
147 0x03, 0x01, 0x51, 0x56, 0x72, 0x60, 0x96, 0xfd, 0x33, 0x5e, 0x5e,
148 0x67, 0xf2, 0xdb, 0xf1, 0x02, 0x70, 0x2e, 0x60, 0x8c, 0xca, 0xe6,
149 0xbe, 0xc1, 0xfc, 0x63, 0xa4, 0x2a, 0x99, 0xbe, 0x5c, 0x3e, 0xb7,
150 0x10, 0x7c, 0x3c, 0x54, 0xe9, 0xb9, 0xeb, 0x2b, 0xd5, 0x20, 0x3b,
151 0x1c, 0x3b, 0x84, 0xe0, 0xa8, 0xb2, 0xf7, 0x59, 0x40, 0x9b, 0xa3,
152 0xea, 0xc9, 0xd9, 0x1d, 0x40, 0x2d, 0xcc, 0x0c, 0xc8, 0xf8, 0x96,
153 0x12, 0x29, 0xac, 0x91, 0x87, 0xb4, 0x2b, 0x4d, 0xe1
154};

Referenced by tlsfmt_test_exec().

◆ tls11_server_hello

uint8_t tls11_server_hello[]
static
Initial value:
= {
0x03, 0x02, 0x1d, 0xd2, 0xbc, 0xd6, 0xce, 0xb4, 0x4b, 0x7c, 0x86,
0xd1, 0xac, 0x69, 0xef, 0x72, 0xf0, 0x97, 0xf7, 0xba, 0x9a, 0x84,
0x8d, 0x7c, 0x43, 0xf0, 0x9b, 0xea, 0x2a, 0xc0, 0x2b, 0xe6, 0xc2,
0xca, 0x00, 0x00, 0x2f, 0x00
}

TLSv1.1 ServerHello with no extensions.

Definition at line 157 of file tlsfmt_test.c.

157 {
158 0x03, 0x02, 0x1d, 0xd2, 0xbc, 0xd6, 0xce, 0xb4, 0x4b, 0x7c, 0x86,
159 0xd1, 0xac, 0x69, 0xef, 0x72, 0xf0, 0x97, 0xf7, 0xba, 0x9a, 0x84,
160 0x8d, 0x7c, 0x43, 0xf0, 0x9b, 0xea, 0x2a, 0xc0, 0x2b, 0xe6, 0xc2,
161 0xca, 0x00, 0x00, 0x2f, 0x00
162};

Referenced by tlsfmt_test_exec().

◆ tls12_server_key_exchange_ecdhe

uint8_t tls12_server_key_exchange_ecdhe[]
static
Initial value:
= {
0x03, 0x00, 0x1d, 0x20, 0x79, 0xc4, 0x99, 0x60, 0xa2, 0x38, 0xa5,
0x11, 0xe1, 0xd1, 0x88, 0x30, 0x17, 0xb0, 0xbe, 0xef, 0xd3, 0x93,
0x71, 0x1e, 0xc4, 0x76, 0x70, 0x5a, 0xd5, 0x24, 0x94, 0xdb, 0x6a,
0xfa, 0x1c, 0x74, 0x02, 0x01, 0x01, 0x00, 0x4a, 0x8e, 0x81, 0x8b,
0x7f, 0x7c, 0xe0, 0x0f, 0x71, 0xe6, 0xcf, 0x24, 0xce, 0x99, 0xb4,
0x18, 0xf1, 0xb0, 0x68, 0x8b, 0xbf, 0x18, 0xe9, 0xed, 0xf5, 0xb4,
0x61, 0x4a, 0x89, 0x57, 0xa2, 0x30, 0xe8, 0x67, 0xdd, 0x70, 0x85,
0x60, 0xc8, 0x16, 0x4e, 0x6b, 0x0e, 0x7f, 0x8d, 0xa3, 0x5b, 0xd8,
0xbc, 0x2b, 0xc7, 0x81, 0xf2, 0x5f, 0xda, 0xed, 0x25, 0x60, 0x7b,
0x01, 0x8d, 0xaf, 0xad, 0x6b, 0x7e, 0x89, 0x2e, 0x4b, 0x14, 0xa0,
0x17, 0xa9, 0x53, 0xd9, 0x1f, 0xd2, 0x82, 0x88, 0x9c, 0xd9, 0x2e,
0x6e, 0x30, 0x78, 0x07, 0xf1, 0x9f, 0x53, 0x1f, 0xc8, 0xec, 0x2d,
0xf2, 0xf7, 0xdc, 0x19, 0x2b, 0x36, 0xbc, 0xf6, 0xec, 0x73, 0x9a,
0x43, 0xf1, 0x44, 0xa2, 0x9d, 0x80, 0xd5, 0xee, 0x18, 0xf5, 0x76,
0xcd, 0x81, 0xfd, 0x66, 0xb0, 0xf0, 0xa5, 0x23, 0x35, 0x42, 0x4b,
0xc2, 0x36, 0xbc, 0x9f, 0x55, 0x33, 0x0f, 0x64, 0x97, 0xda, 0x67,
0x25, 0xcb, 0x2c, 0xae, 0x78, 0xab, 0xd0, 0xa2, 0xd4, 0xf8, 0xde,
0x88, 0x44, 0x5a, 0x6a, 0x46, 0x1d, 0x69, 0x98, 0x2f, 0x2e, 0xe7,
0xd2, 0xde, 0x87, 0x0b, 0x25, 0xe3, 0x2c, 0xc1, 0x8f, 0xb6, 0xec,
0xf1, 0xb3, 0xba, 0xdc, 0xd7, 0x17, 0xf8, 0xbc, 0x40, 0x8f, 0xa5,
0x76, 0x3a, 0x40, 0xe6, 0x4c, 0x6d, 0x84, 0x76, 0x88, 0xf8, 0x37,
0xf4, 0x53, 0x14, 0xf6, 0x9c, 0x59, 0x39, 0x5f, 0x9b, 0x02, 0xea,
0x22, 0xbf, 0xa3, 0xb2, 0xde, 0x06, 0xc5, 0xba, 0x01, 0xd8, 0x15,
0xdc, 0x02, 0x8c, 0xdb, 0xa5, 0x56, 0x85, 0xa7, 0xbd, 0x8b, 0x9a,
0xdf, 0x8e, 0xbd, 0x7b, 0xac, 0xe4, 0xf3, 0x5a, 0xc4, 0x52, 0xd6,
0xba, 0x32, 0xca, 0xdc, 0x9f, 0x71, 0x0e, 0x00, 0xc9, 0xb0, 0x9a,
0x6e, 0xc6, 0xe3, 0x20, 0xb2, 0x9b, 0xe5, 0x02, 0x07, 0x2e
}

TLSv1.2 ServerKeyExchange with explicit signature hash algorithm.

Definition at line 165 of file tlsfmt_test.c.

165 {
166 0x03, 0x00, 0x1d, 0x20, 0x79, 0xc4, 0x99, 0x60, 0xa2, 0x38, 0xa5,
167 0x11, 0xe1, 0xd1, 0x88, 0x30, 0x17, 0xb0, 0xbe, 0xef, 0xd3, 0x93,
168 0x71, 0x1e, 0xc4, 0x76, 0x70, 0x5a, 0xd5, 0x24, 0x94, 0xdb, 0x6a,
169 0xfa, 0x1c, 0x74, 0x02, 0x01, 0x01, 0x00, 0x4a, 0x8e, 0x81, 0x8b,
170 0x7f, 0x7c, 0xe0, 0x0f, 0x71, 0xe6, 0xcf, 0x24, 0xce, 0x99, 0xb4,
171 0x18, 0xf1, 0xb0, 0x68, 0x8b, 0xbf, 0x18, 0xe9, 0xed, 0xf5, 0xb4,
172 0x61, 0x4a, 0x89, 0x57, 0xa2, 0x30, 0xe8, 0x67, 0xdd, 0x70, 0x85,
173 0x60, 0xc8, 0x16, 0x4e, 0x6b, 0x0e, 0x7f, 0x8d, 0xa3, 0x5b, 0xd8,
174 0xbc, 0x2b, 0xc7, 0x81, 0xf2, 0x5f, 0xda, 0xed, 0x25, 0x60, 0x7b,
175 0x01, 0x8d, 0xaf, 0xad, 0x6b, 0x7e, 0x89, 0x2e, 0x4b, 0x14, 0xa0,
176 0x17, 0xa9, 0x53, 0xd9, 0x1f, 0xd2, 0x82, 0x88, 0x9c, 0xd9, 0x2e,
177 0x6e, 0x30, 0x78, 0x07, 0xf1, 0x9f, 0x53, 0x1f, 0xc8, 0xec, 0x2d,
178 0xf2, 0xf7, 0xdc, 0x19, 0x2b, 0x36, 0xbc, 0xf6, 0xec, 0x73, 0x9a,
179 0x43, 0xf1, 0x44, 0xa2, 0x9d, 0x80, 0xd5, 0xee, 0x18, 0xf5, 0x76,
180 0xcd, 0x81, 0xfd, 0x66, 0xb0, 0xf0, 0xa5, 0x23, 0x35, 0x42, 0x4b,
181 0xc2, 0x36, 0xbc, 0x9f, 0x55, 0x33, 0x0f, 0x64, 0x97, 0xda, 0x67,
182 0x25, 0xcb, 0x2c, 0xae, 0x78, 0xab, 0xd0, 0xa2, 0xd4, 0xf8, 0xde,
183 0x88, 0x44, 0x5a, 0x6a, 0x46, 0x1d, 0x69, 0x98, 0x2f, 0x2e, 0xe7,
184 0xd2, 0xde, 0x87, 0x0b, 0x25, 0xe3, 0x2c, 0xc1, 0x8f, 0xb6, 0xec,
185 0xf1, 0xb3, 0xba, 0xdc, 0xd7, 0x17, 0xf8, 0xbc, 0x40, 0x8f, 0xa5,
186 0x76, 0x3a, 0x40, 0xe6, 0x4c, 0x6d, 0x84, 0x76, 0x88, 0xf8, 0x37,
187 0xf4, 0x53, 0x14, 0xf6, 0x9c, 0x59, 0x39, 0x5f, 0x9b, 0x02, 0xea,
188 0x22, 0xbf, 0xa3, 0xb2, 0xde, 0x06, 0xc5, 0xba, 0x01, 0xd8, 0x15,
189 0xdc, 0x02, 0x8c, 0xdb, 0xa5, 0x56, 0x85, 0xa7, 0xbd, 0x8b, 0x9a,
190 0xdf, 0x8e, 0xbd, 0x7b, 0xac, 0xe4, 0xf3, 0x5a, 0xc4, 0x52, 0xd6,
191 0xba, 0x32, 0xca, 0xdc, 0x9f, 0x71, 0x0e, 0x00, 0xc9, 0xb0, 0x9a,
192 0x6e, 0xc6, 0xe3, 0x20, 0xb2, 0x9b, 0xe5, 0x02, 0x07, 0x2e
193};

Referenced by tlsfmt_test_exec().

◆ tls11_server_key_exchange_ecdhe

uint8_t tls11_server_key_exchange_ecdhe[]
static
Initial value:
= {
0x03, 0x00, 0x1d, 0x20, 0x79, 0xc4, 0x99, 0x60, 0xa2, 0x38, 0xa5,
0x11, 0xe1, 0xd1, 0x88, 0x30, 0x17, 0xb0, 0xbe, 0xef, 0xd3, 0x93,
0x71, 0x1e, 0xc4, 0x76, 0x70, 0x5a, 0xd5, 0x24, 0x94, 0xdb, 0x6a,
0xfa, 0x1c, 0x74, 0x01, 0x00, 0x4a, 0x8e, 0x81, 0x8b, 0x7f, 0x7c,
0xe0, 0x0f, 0x71, 0xe6, 0xcf, 0x24, 0xce, 0x99, 0xb4, 0x18, 0xf1,
0xb0, 0x68, 0x8b, 0xbf, 0x18, 0xe9, 0xed, 0xf5, 0xb4, 0x61, 0x4a,
0x89, 0x57, 0xa2, 0x30, 0xe8, 0x67, 0xdd, 0x70, 0x85, 0x60, 0xc8,
0x16, 0x4e, 0x6b, 0x0e, 0x7f, 0x8d, 0xa3, 0x5b, 0xd8, 0xbc, 0x2b,
0xc7, 0x81, 0xf2, 0x5f, 0xda, 0xed, 0x25, 0x60, 0x7b, 0x01, 0x8d,
0xaf, 0xad, 0x6b, 0x7e, 0x89, 0x2e, 0x4b, 0x14, 0xa0, 0x17, 0xa9,
0x53, 0xd9, 0x1f, 0xd2, 0x82, 0x88, 0x9c, 0xd9, 0x2e, 0x6e, 0x30,
0x78, 0x07, 0xf1, 0x9f, 0x53, 0x1f, 0xc8, 0xec, 0x2d, 0xf2, 0xf7,
0xdc, 0x19, 0x2b, 0x36, 0xbc, 0xf6, 0xec, 0x73, 0x9a, 0x43, 0xf1,
0x44, 0xa2, 0x9d, 0x80, 0xd5, 0xee, 0x18, 0xf5, 0x76, 0xcd, 0x81,
0xfd, 0x66, 0xb0, 0xf0, 0xa5, 0x23, 0x35, 0x42, 0x4b, 0xc2, 0x36,
0xbc, 0x9f, 0x55, 0x33, 0x0f, 0x64, 0x97, 0xda, 0x67, 0x25, 0xcb,
0x2c, 0xae, 0x78, 0xab, 0xd0, 0xa2, 0xd4, 0xf8, 0xde, 0x88, 0x44,
0x5a, 0x6a, 0x46, 0x1d, 0x69, 0x98, 0x2f, 0x2e, 0xe7, 0xd2, 0xde,
0x87, 0x0b, 0x25, 0xe3, 0x2c, 0xc1, 0x8f, 0xb6, 0xec, 0xf1, 0xb3,
0xba, 0xdc, 0xd7, 0x17, 0xf8, 0xbc, 0x40, 0x8f, 0xa5, 0x76, 0x3a,
0x40, 0xe6, 0x4c, 0x6d, 0x84, 0x76, 0x88, 0xf8, 0x37, 0xf4, 0x53,
0x14, 0xf6, 0x9c, 0x59, 0x39, 0x5f, 0x9b, 0x02, 0xea, 0x22, 0xbf,
0xa3, 0xb2, 0xde, 0x06, 0xc5, 0xba, 0x01, 0xd8, 0x15, 0xdc, 0x02,
0x8c, 0xdb, 0xa5, 0x56, 0x85, 0xa7, 0xbd, 0x8b, 0x9a, 0xdf, 0x8e,
0xbd, 0x7b, 0xac, 0xe4, 0xf3, 0x5a, 0xc4, 0x52, 0xd6, 0xba, 0x32,
0xca, 0xdc, 0x9f, 0x71, 0x0e, 0x00, 0xc9, 0xb0, 0x9a, 0x6e, 0xc6,
0xe3, 0x20, 0xb2, 0x9b, 0xe5, 0x02, 0x07, 0x2e
}

TLSv1.1 ServerKeyExchange with implicit signature hash algorithm.

Definition at line 196 of file tlsfmt_test.c.

196 {
197 0x03, 0x00, 0x1d, 0x20, 0x79, 0xc4, 0x99, 0x60, 0xa2, 0x38, 0xa5,
198 0x11, 0xe1, 0xd1, 0x88, 0x30, 0x17, 0xb0, 0xbe, 0xef, 0xd3, 0x93,
199 0x71, 0x1e, 0xc4, 0x76, 0x70, 0x5a, 0xd5, 0x24, 0x94, 0xdb, 0x6a,
200 0xfa, 0x1c, 0x74, 0x01, 0x00, 0x4a, 0x8e, 0x81, 0x8b, 0x7f, 0x7c,
201 0xe0, 0x0f, 0x71, 0xe6, 0xcf, 0x24, 0xce, 0x99, 0xb4, 0x18, 0xf1,
202 0xb0, 0x68, 0x8b, 0xbf, 0x18, 0xe9, 0xed, 0xf5, 0xb4, 0x61, 0x4a,
203 0x89, 0x57, 0xa2, 0x30, 0xe8, 0x67, 0xdd, 0x70, 0x85, 0x60, 0xc8,
204 0x16, 0x4e, 0x6b, 0x0e, 0x7f, 0x8d, 0xa3, 0x5b, 0xd8, 0xbc, 0x2b,
205 0xc7, 0x81, 0xf2, 0x5f, 0xda, 0xed, 0x25, 0x60, 0x7b, 0x01, 0x8d,
206 0xaf, 0xad, 0x6b, 0x7e, 0x89, 0x2e, 0x4b, 0x14, 0xa0, 0x17, 0xa9,
207 0x53, 0xd9, 0x1f, 0xd2, 0x82, 0x88, 0x9c, 0xd9, 0x2e, 0x6e, 0x30,
208 0x78, 0x07, 0xf1, 0x9f, 0x53, 0x1f, 0xc8, 0xec, 0x2d, 0xf2, 0xf7,
209 0xdc, 0x19, 0x2b, 0x36, 0xbc, 0xf6, 0xec, 0x73, 0x9a, 0x43, 0xf1,
210 0x44, 0xa2, 0x9d, 0x80, 0xd5, 0xee, 0x18, 0xf5, 0x76, 0xcd, 0x81,
211 0xfd, 0x66, 0xb0, 0xf0, 0xa5, 0x23, 0x35, 0x42, 0x4b, 0xc2, 0x36,
212 0xbc, 0x9f, 0x55, 0x33, 0x0f, 0x64, 0x97, 0xda, 0x67, 0x25, 0xcb,
213 0x2c, 0xae, 0x78, 0xab, 0xd0, 0xa2, 0xd4, 0xf8, 0xde, 0x88, 0x44,
214 0x5a, 0x6a, 0x46, 0x1d, 0x69, 0x98, 0x2f, 0x2e, 0xe7, 0xd2, 0xde,
215 0x87, 0x0b, 0x25, 0xe3, 0x2c, 0xc1, 0x8f, 0xb6, 0xec, 0xf1, 0xb3,
216 0xba, 0xdc, 0xd7, 0x17, 0xf8, 0xbc, 0x40, 0x8f, 0xa5, 0x76, 0x3a,
217 0x40, 0xe6, 0x4c, 0x6d, 0x84, 0x76, 0x88, 0xf8, 0x37, 0xf4, 0x53,
218 0x14, 0xf6, 0x9c, 0x59, 0x39, 0x5f, 0x9b, 0x02, 0xea, 0x22, 0xbf,
219 0xa3, 0xb2, 0xde, 0x06, 0xc5, 0xba, 0x01, 0xd8, 0x15, 0xdc, 0x02,
220 0x8c, 0xdb, 0xa5, 0x56, 0x85, 0xa7, 0xbd, 0x8b, 0x9a, 0xdf, 0x8e,
221 0xbd, 0x7b, 0xac, 0xe4, 0xf3, 0x5a, 0xc4, 0x52, 0xd6, 0xba, 0x32,
222 0xca, 0xdc, 0x9f, 0x71, 0x0e, 0x00, 0xc9, 0xb0, 0x9a, 0x6e, 0xc6,
223 0xe3, 0x20, 0xb2, 0x9b, 0xe5, 0x02, 0x07, 0x2e
224};

Referenced by tlsfmt_test_exec().

◆ server_key_exchange_point

uint8_t server_key_exchange_point[]
static
Initial value:
= {
0x79, 0xc4, 0x99, 0x60, 0xa2, 0x38, 0xa5, 0x11, 0xe1, 0xd1, 0x88,
0x30, 0x17, 0xb0, 0xbe, 0xef, 0xd3, 0x93, 0x71, 0x1e, 0xc4, 0x76,
0x70, 0x5a, 0xd5, 0x24, 0x94, 0xdb, 0x6a, 0xfa, 0x1c, 0x74
}

ServerKeyExchange public curve point.

Definition at line 227 of file tlsfmt_test.c.

227 {
228 0x79, 0xc4, 0x99, 0x60, 0xa2, 0x38, 0xa5, 0x11, 0xe1, 0xd1, 0x88,
229 0x30, 0x17, 0xb0, 0xbe, 0xef, 0xd3, 0x93, 0x71, 0x1e, 0xc4, 0x76,
230 0x70, 0x5a, 0xd5, 0x24, 0x94, 0xdb, 0x6a, 0xfa, 0x1c, 0x74
231};

Referenced by tlsfmt_test_exec().

◆ server_key_exchange_sig

uint8_t server_key_exchange_sig[]
static
Initial value:
= {
0x4a, 0x8e, 0x81, 0x8b, 0x7f, 0x7c, 0xe0, 0x0f, 0x71, 0xe6, 0xcf,
0x24, 0xce, 0x99, 0xb4, 0x18, 0xf1, 0xb0, 0x68, 0x8b, 0xbf, 0x18,
0xe9, 0xed, 0xf5, 0xb4, 0x61, 0x4a, 0x89, 0x57, 0xa2, 0x30, 0xe8,
0x67, 0xdd, 0x70, 0x85, 0x60, 0xc8, 0x16, 0x4e, 0x6b, 0x0e, 0x7f,
0x8d, 0xa3, 0x5b, 0xd8, 0xbc, 0x2b, 0xc7, 0x81, 0xf2, 0x5f, 0xda,
0xed, 0x25, 0x60, 0x7b, 0x01, 0x8d, 0xaf, 0xad, 0x6b, 0x7e, 0x89,
0x2e, 0x4b, 0x14, 0xa0, 0x17, 0xa9, 0x53, 0xd9, 0x1f, 0xd2, 0x82,
0x88, 0x9c, 0xd9, 0x2e, 0x6e, 0x30, 0x78, 0x07, 0xf1, 0x9f, 0x53,
0x1f, 0xc8, 0xec, 0x2d, 0xf2, 0xf7, 0xdc, 0x19, 0x2b, 0x36, 0xbc,
0xf6, 0xec, 0x73, 0x9a, 0x43, 0xf1, 0x44, 0xa2, 0x9d, 0x80, 0xd5,
0xee, 0x18, 0xf5, 0x76, 0xcd, 0x81, 0xfd, 0x66, 0xb0, 0xf0, 0xa5,
0x23, 0x35, 0x42, 0x4b, 0xc2, 0x36, 0xbc, 0x9f, 0x55, 0x33, 0x0f,
0x64, 0x97, 0xda, 0x67, 0x25, 0xcb, 0x2c, 0xae, 0x78, 0xab, 0xd0,
0xa2, 0xd4, 0xf8, 0xde, 0x88, 0x44, 0x5a, 0x6a, 0x46, 0x1d, 0x69,
0x98, 0x2f, 0x2e, 0xe7, 0xd2, 0xde, 0x87, 0x0b, 0x25, 0xe3, 0x2c,
0xc1, 0x8f, 0xb6, 0xec, 0xf1, 0xb3, 0xba, 0xdc, 0xd7, 0x17, 0xf8,
0xbc, 0x40, 0x8f, 0xa5, 0x76, 0x3a, 0x40, 0xe6, 0x4c, 0x6d, 0x84,
0x76, 0x88, 0xf8, 0x37, 0xf4, 0x53, 0x14, 0xf6, 0x9c, 0x59, 0x39,
0x5f, 0x9b, 0x02, 0xea, 0x22, 0xbf, 0xa3, 0xb2, 0xde, 0x06, 0xc5,
0xba, 0x01, 0xd8, 0x15, 0xdc, 0x02, 0x8c, 0xdb, 0xa5, 0x56, 0x85,
0xa7, 0xbd, 0x8b, 0x9a, 0xdf, 0x8e, 0xbd, 0x7b, 0xac, 0xe4, 0xf3,
0x5a, 0xc4, 0x52, 0xd6, 0xba, 0x32, 0xca, 0xdc, 0x9f, 0x71, 0x0e,
0x00, 0xc9, 0xb0, 0x9a, 0x6e, 0xc6, 0xe3, 0x20, 0xb2, 0x9b, 0xe5,
0x02, 0x07, 0x2e
}

ServerKeyExchange signature.

Definition at line 234 of file tlsfmt_test.c.

234 {
235 0x4a, 0x8e, 0x81, 0x8b, 0x7f, 0x7c, 0xe0, 0x0f, 0x71, 0xe6, 0xcf,
236 0x24, 0xce, 0x99, 0xb4, 0x18, 0xf1, 0xb0, 0x68, 0x8b, 0xbf, 0x18,
237 0xe9, 0xed, 0xf5, 0xb4, 0x61, 0x4a, 0x89, 0x57, 0xa2, 0x30, 0xe8,
238 0x67, 0xdd, 0x70, 0x85, 0x60, 0xc8, 0x16, 0x4e, 0x6b, 0x0e, 0x7f,
239 0x8d, 0xa3, 0x5b, 0xd8, 0xbc, 0x2b, 0xc7, 0x81, 0xf2, 0x5f, 0xda,
240 0xed, 0x25, 0x60, 0x7b, 0x01, 0x8d, 0xaf, 0xad, 0x6b, 0x7e, 0x89,
241 0x2e, 0x4b, 0x14, 0xa0, 0x17, 0xa9, 0x53, 0xd9, 0x1f, 0xd2, 0x82,
242 0x88, 0x9c, 0xd9, 0x2e, 0x6e, 0x30, 0x78, 0x07, 0xf1, 0x9f, 0x53,
243 0x1f, 0xc8, 0xec, 0x2d, 0xf2, 0xf7, 0xdc, 0x19, 0x2b, 0x36, 0xbc,
244 0xf6, 0xec, 0x73, 0x9a, 0x43, 0xf1, 0x44, 0xa2, 0x9d, 0x80, 0xd5,
245 0xee, 0x18, 0xf5, 0x76, 0xcd, 0x81, 0xfd, 0x66, 0xb0, 0xf0, 0xa5,
246 0x23, 0x35, 0x42, 0x4b, 0xc2, 0x36, 0xbc, 0x9f, 0x55, 0x33, 0x0f,
247 0x64, 0x97, 0xda, 0x67, 0x25, 0xcb, 0x2c, 0xae, 0x78, 0xab, 0xd0,
248 0xa2, 0xd4, 0xf8, 0xde, 0x88, 0x44, 0x5a, 0x6a, 0x46, 0x1d, 0x69,
249 0x98, 0x2f, 0x2e, 0xe7, 0xd2, 0xde, 0x87, 0x0b, 0x25, 0xe3, 0x2c,
250 0xc1, 0x8f, 0xb6, 0xec, 0xf1, 0xb3, 0xba, 0xdc, 0xd7, 0x17, 0xf8,
251 0xbc, 0x40, 0x8f, 0xa5, 0x76, 0x3a, 0x40, 0xe6, 0x4c, 0x6d, 0x84,
252 0x76, 0x88, 0xf8, 0x37, 0xf4, 0x53, 0x14, 0xf6, 0x9c, 0x59, 0x39,
253 0x5f, 0x9b, 0x02, 0xea, 0x22, 0xbf, 0xa3, 0xb2, 0xde, 0x06, 0xc5,
254 0xba, 0x01, 0xd8, 0x15, 0xdc, 0x02, 0x8c, 0xdb, 0xa5, 0x56, 0x85,
255 0xa7, 0xbd, 0x8b, 0x9a, 0xdf, 0x8e, 0xbd, 0x7b, 0xac, 0xe4, 0xf3,
256 0x5a, 0xc4, 0x52, 0xd6, 0xba, 0x32, 0xca, 0xdc, 0x9f, 0x71, 0x0e,
257 0x00, 0xc9, 0xb0, 0x9a, 0x6e, 0xc6, 0xe3, 0x20, 0xb2, 0x9b, 0xe5,
258 0x02, 0x07, 0x2e
259};

Referenced by tlsfmt_test_exec().

◆ tls13_client_hello

uint8_t tls13_client_hello[]
static
Initial value:
= {
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
}

Reference TLSv1.3 ClientHello (from RFC 8448).

Definition at line 262 of file tlsfmt_test.c.

262 {
263 0x03, 0x03, 0xcb, 0x34, 0xec, 0xb1, 0xe7, 0x81, 0x63, 0xba, 0x1c,
264 0x38, 0xc6, 0xda, 0xcb, 0x19, 0x6a, 0x6d, 0xff, 0xa2, 0x1a, 0x8d,
265 0x99, 0x12, 0xec, 0x18, 0xa2, 0xef, 0x62, 0x83, 0x02, 0x4d, 0xec,
266 0xe7, 0x00, 0x00, 0x06, 0x13, 0x01, 0x13, 0x03, 0x13, 0x02, 0x01,
267 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x09, 0x00, 0x00,
268 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0xff, 0x01, 0x00, 0x01,
269 0x00, 0x00, 0x0a, 0x00, 0x14, 0x00, 0x12, 0x00, 0x1d, 0x00, 0x17,
270 0x00, 0x18, 0x00, 0x19, 0x01, 0x00, 0x01, 0x01, 0x01, 0x02, 0x01,
271 0x03, 0x01, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x33, 0x00, 0x26,
272 0x00, 0x24, 0x00, 0x1d, 0x00, 0x20, 0x99, 0x38, 0x1d, 0xe5, 0x60,
273 0xe4, 0xbd, 0x43, 0xd2, 0x3d, 0x8e, 0x43, 0x5a, 0x7d, 0xba, 0xfe,
274 0xb3, 0xc0, 0x6e, 0x51, 0xc1, 0x3c, 0xae, 0x4d, 0x54, 0x13, 0x69,
275 0x1e, 0x52, 0x9a, 0xaf, 0x2c, 0x00, 0x2b, 0x00, 0x03, 0x02, 0x03,
276 0x04, 0x00, 0x0d, 0x00, 0x20, 0x00, 0x1e, 0x04, 0x03, 0x05, 0x03,
277 0x06, 0x03, 0x02, 0x03, 0x08, 0x04, 0x08, 0x05, 0x08, 0x06, 0x04,
278 0x01, 0x05, 0x01, 0x06, 0x01, 0x02, 0x01, 0x04, 0x02, 0x05, 0x02,
279 0x06, 0x02, 0x02, 0x02, 0x00, 0x2d, 0x00, 0x02, 0x01, 0x01, 0x00,
280 0x1c, 0x00, 0x02, 0x40, 0x01
281};

Referenced by tlsfmt_test_exec().

◆ tls13_client_hello_random

uint8_t tls13_client_hello_random[]
static
Initial value:
= {
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
}

TLSv1.3 ClientHello random bytes.

Definition at line 284 of file tlsfmt_test.c.

284 {
285 0xcb, 0x34, 0xec, 0xb1, 0xe7, 0x81, 0x63, 0xba, 0x1c, 0x38, 0xc6,
286 0xda, 0xcb, 0x19, 0x6a, 0x6d, 0xff, 0xa2, 0x1a, 0x8d, 0x99, 0x12,
287 0xec, 0x18, 0xa2, 0xef, 0x62, 0x83, 0x02, 0x4d, 0xec, 0xe7
288};

Referenced by tlsfmt_test_exec().

◆ tls13_client_hello_suites

uint8_t tls13_client_hello_suites[]
static
Initial value:
= {
0x13, 0x01, 0x13, 0x03, 0x13, 0x02
}

TLSv1.3 ClientHello cipher suites.

Definition at line 291 of file tlsfmt_test.c.

291 {
292 0x13, 0x01, 0x13, 0x03, 0x13, 0x02
293};

Referenced by tlsfmt_test_exec().

◆ tls13_client_hello_groups

uint8_t tls13_client_hello_groups[]
static
Initial value:
= {
0x00, 0x12, 0x00, 0x1d, 0x00, 0x17, 0x00, 0x18, 0x00, 0x19, 0x01,
0x00, 0x01, 0x01, 0x01, 0x02, 0x01, 0x03, 0x01, 0x04
}

TLSv1.3 ClientHello supported groups.

Definition at line 296 of file tlsfmt_test.c.

296 {
297 0x00, 0x12, 0x00, 0x1d, 0x00, 0x17, 0x00, 0x18, 0x00, 0x19, 0x01,
298 0x00, 0x01, 0x01, 0x01, 0x02, 0x01, 0x03, 0x01, 0x04
299};

Referenced by tlsfmt_test_exec().

◆ tls13_client_hello_public

uint8_t tls13_client_hello_public[]
static
Initial value:
= {
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
}

TLSv1.3 ClientHello public key.

Definition at line 302 of file tlsfmt_test.c.

302 {
303 0x99, 0x38, 0x1d, 0xe5, 0x60, 0xe4, 0xbd, 0x43, 0xd2, 0x3d, 0x8e,
304 0x43, 0x5a, 0x7d, 0xba, 0xfe, 0xb3, 0xc0, 0x6e, 0x51, 0xc1, 0x3c,
305 0xae, 0x4d, 0x54, 0x13, 0x69, 0x1e, 0x52, 0x9a, 0xaf, 0x2c
306};

Referenced by tlsfmt_test_exec().

◆ tls13_client_hello_sigs

uint8_t tls13_client_hello_sigs[]
static
Initial value:
= {
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
}

TLSv1.3 ClientHello signature algorithms.

Definition at line 309 of file tlsfmt_test.c.

309 {
310 0x00, 0x1e, 0x04, 0x03, 0x05, 0x03, 0x06, 0x03, 0x02, 0x03, 0x08,
311 0x04, 0x08, 0x05, 0x08, 0x06, 0x04, 0x01, 0x05, 0x01, 0x06, 0x01,
312 0x02, 0x01, 0x04, 0x02, 0x05, 0x02, 0x06, 0x02, 0x02, 0x02
313};

Referenced by tlsfmt_test_exec().

◆ tls13_client_hello_supvers

uint8_t tls13_client_hello_supvers[] = { 0x03, 0x04 }
static

TLSv1.3 ClientHello supported version.

Definition at line 316 of file tlsfmt_test.c.

316{ 0x03, 0x04 };

Referenced by tlsfmt_test_exec().

◆ tls13_client_hello_pskmodes

uint8_t tls13_client_hello_pskmodes[] = { 0x01 }
static

TLSv1.3 ClientHello pre-shared key modes.

Definition at line 319 of file tlsfmt_test.c.

319{ 0x01 };

Referenced by tlsfmt_test_exec().

◆ __self_test

struct self_test tlsfmt_test __self_test
Initial value:
= {
.name = "tlsfmt",
}
static void tlsfmt_test_exec(void)
Perform TLS data format self-test.

TLS data format self-test.

Definition at line 902 of file tlsfmt_test.c.

902 {
903 .name = "tlsfmt",
904 .exec = tlsfmt_test_exec,
905};