|
iPXE
|
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. | |
TLS data format tests.
Definition in file tlsfmt_test.c.
Report a mapping validity test result.
Definition at line 340 of file tlsfmt_test.c.
| #define map_ok | ( | type | ) |
Report a mapping validity test result.
| type | Descriptor structure name |
Definition at line 360 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
| #define cursor_ok | ( | cursor, | |
| reference ) |
Definition at line 383 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
Definition at line 407 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Report a cursor comparison test result.
| cursor | Cursor |
| reference | Reference cursor |
| file | Test code file |
| line | Test code line |
Definition at line 374 of file tlsfmt_test.c.
References tls_cursor::data, tls_cursor::len, memcmp(), and okx.
|
static |
Report a pre-extensions comparison test result.
| data | Data |
| ext | Extensions |
| reference | Reference data |
| reference_ext | Reference extensions |
| file | Test code file |
| line | Test code line |
Definition at line 396 of file tlsfmt_test.c.
References data, tls_cursor::data, len, memcmp(), and okx.
|
static |
Perform TLS data format self-test.
Definition at line 415 of file tlsfmt_test.c.
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().
|
static |
Known valid TLSv1.3 ServerHello (from RFC 8448).
Definition at line 42 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
TLSv1.3 ServerHello random bytes.
Definition at line 54 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
TLSv1.3 ServerHello public key.
Definition at line 61 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
Known valid TLSv1.3 Certificate (from RFC 8448).
Definition at line 68 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
TLSv1.2 Certificate (derived from RFC 8448).
Definition at line 113 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
TLSv1.1 ServerHello with no extensions.
Definition at line 157 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
TLSv1.2 ServerKeyExchange with explicit signature hash algorithm.
Definition at line 165 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
TLSv1.1 ServerKeyExchange with implicit signature hash algorithm.
Definition at line 196 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
ServerKeyExchange public curve point.
Definition at line 227 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
ServerKeyExchange signature.
Definition at line 234 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
Reference TLSv1.3 ClientHello (from RFC 8448).
Definition at line 262 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
TLSv1.3 ClientHello random bytes.
Definition at line 284 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
TLSv1.3 ClientHello cipher suites.
Definition at line 291 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
TLSv1.3 ClientHello supported groups.
Definition at line 296 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
TLSv1.3 ClientHello public key.
Definition at line 302 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
TLSv1.3 ClientHello signature algorithms.
Definition at line 309 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
TLSv1.3 ClientHello supported version.
Definition at line 316 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
|
static |
TLSv1.3 ClientHello pre-shared key modes.
Definition at line 319 of file tlsfmt_test.c.
Referenced by tlsfmt_test_exec().
| struct self_test tlsfmt_test __self_test |
TLS data format self-test.
Definition at line 902 of file tlsfmt_test.c.