174#define TLS_VERSION_TLS_1_1 0x0302
177#define TLS_VERSION_TLS_1_2 0x0303
180#define TLS_VERSION_TLS_1_3 0x0304
183#define TLS_VERSION_BASE TLS_VERSION_TLS_1_1
207#define TLS_DESCR_COUNT( desc ) \
209 ( sizeof ( struct desc ) / sizeof ( union tls_ptr_len ) ) + \
211 ( 0 * sizeof ( int[ -( sizeof ( struct desc ) % \
212 sizeof ( union tls_ptr_len ) ) ] ) ) )
220#define TLS_DESCR_MAPPING( desc ) \
221 const uint8_t desc ## _map [ 1 + \
222 TLS_DESCR_COUNT ( desc ) ]
229#define TLS_MAPSZ( desc ) \
230 [0] = ( 1 + TLS_DESCR_COUNT ( desc ) )
239#define TLS_INDEX( desc, field ) \
243 ( offsetof ( struct desc, field ) / \
244 sizeof ( union tls_ptr_len ) ) + \
246 ( 0 * sizeof ( int[ -( offsetof ( struct desc, field ) % \
247 sizeof ( union tls_ptr_len ) ) ] ) ) )
256#define TLS_EXTNS( desc, field ) \
257 ( ( sizeof ( ( ( struct desc * ) NULL )->field ) - \
258 sizeof ( ( ( struct desc * ) NULL )->field.all ) ) \
259 / sizeof ( struct tls_cursor ) )
268#define TLS_FIXED( desc, version, field ) \
270 [ TLS_INDEX ( desc, field ) ] = \
271 ( ( (version) - TLS_VERSION_BASE ) + \
272 ( ( sizeof ( *( ( ( struct desc * ) NULL )->field ) ) \
284#define TLS_VARIABLE( desc, version, field, bits, extns ) \
286 [ TLS_INDEX ( desc, field ) ] = \
287 ( ( (version) - TLS_VERSION_BASE ) + ( 1 << 2 ) ), \
289 [ TLS_INDEX ( desc, field ) + 1 ] = \
290 ( ( ( (bits) + 7 ) / 8 ) + ( (extns) << 2 ) )
299#define TLS_EXTRA( desc, version, field ) \
300 TLS_VARIABLE ( desc, version, field, 0, 0 )
309#define TLS_VAR08( desc, version, field ) \
310 TLS_VARIABLE ( desc, (version), field, 8, 0 )
319#define TLS_VAR16( desc, version, field ) \
320 TLS_VARIABLE ( desc, (version), field, 16, 0 )
329#define TLS_VAR24( desc, version, field ) \
330 TLS_VARIABLE ( desc, (version), field, 24, 0 )
339#define TLS_EXT16( desc, version, field ) \
340 TLS_VARIABLE ( desc, (version), field.all, 16, \
341 ( TLS_EXTNS ( desc, field ) + 1 ) )
350#define TLS_EXTND( desc, extension, field ) \
351 [ TLS_INDEX ( desc, field ) ] = \
352 ( ( (extension) >> 8 ) ^ 0xff ), \
353 [ TLS_INDEX ( desc, field ) + 1 ] = \
354 ( ( (extension) & 0xff ) ^ 0xff )
362#define TLS_MAP_MIN( byte ) ( TLS_VERSION_BASE + ( (byte) & 0x03 ) )
370#define TLS_MAP_FIXED( byte ) ( ( (byte) >> 2 ) - 1 )
378#define TLS_MAP_LEN_LEN( byte ) ( (byte) & 0x03 )
381#define TLS_MAP_LEN_LEN_MAX 3
389#define TLS_MAP_EXTENSIONS( byte ) ( ( (byte) >> 2 ) - 1 )
555 build_assert ( ( (
const void * ) &
u->tls.data ) == &
u->asn1.data );
597#define tls_parse( type, version, cursor, desc ) \
598 tls_parse_map ( type ## _map, (version), (cursor), \
599 ( ( union tls_ptr_len * ) \
600 ( (desc) == ( ( struct type * ) NULL ) ? \
601 (desc) : (desc) ) ) )
612#define tls_parse_opt( type, version, cursor, desc ) \
613 tls_parse_opt_map ( type ## _map, (version), (cursor), \
614 ( ( union tls_ptr_len * ) \
615 ( (desc) == ( ( struct type * ) NULL ) ? \
616 (desc) : (desc) ) ) )
627#define tls_build( type, version, desc, cursor ) \
628 tls_build_map ( type ## _map, (version), \
629 ( ( union tls_ptr_len * ) \
630 ( (desc) == ( ( struct type * ) NULL ) ? \
631 (desc) : (desc) ) ), (cursor) )
642#define tls_size( type, version, desc, cursor ) \
643 tls_size_map ( type ## _map, (version), \
644 ( ( union tls_ptr_len * ) \
645 ( (desc) == ( ( struct type * ) NULL ) ? \
646 (desc) : (desc) ) ), (cursor) )
#define NULL
NULL pointer (VOID *).
typeof(acpi_finder=acpi_find)
ACPI table finder.
#define build_assert(condition)
Assert a condition at build time (after dead code elimination).
u32 version
Driver version.
union @104331263140136355135267063077374276003064103115 u
uint16_t ext
Extended status.
struct ena_llq_option desc
Descriptor counts.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
static __always_inline int struct dma_mapping * map
#define container_of(ptr, type, field)
Get containing structure.
CertificateEntry descriptor.
struct tls_cursor next
Next certificate.
struct tls_cursor all
All extensions.
struct tls_cursor cert
Certificate data.
struct tls_cursor list
Certificate list.
struct tls_cursor context
Certificate request context.
A TLS variable-length data cursor.
size_t len
Length of data.
DigitallySigned descriptor.
uint16_t * sig_hash
Signature and hash algorithm.
struct tls_cursor sig
Signature.
struct tls_cursor data
Extension data.
struct tls_cursor next
Next extension.
uint16_t * type
Extension type.
KeyShareEntry descriptor.
struct tls_cursor next
Next key share.
uint16_t * group
Named group.
struct tls_cursor public
Public key.
NewSessionTicket descriptor.
struct tls_cursor all
All extensions.
uint32_t * age
Age obfuscation.
struct tls_cursor ticket
Ticket.
struct tls_cursor nonce
Nonce.
uint32_t * lifetime
Lifetime hint.
RenegotiationInfo descriptor.
struct tls_cursor verify
Verification data from previous Finished.
ServerHelloDone descriptor.
struct tls_cursor key
Key share.
struct tls_cursor all
All extensions.
uint16_t cipher_suite
Selected cipher suite.
struct tls_server_hello::@125012126022344142326053215051117066274341043305 * b
Second fixed-length portion.
struct tls_cursor session_id
Session ID.
struct tls_cursor ems
Extended master secret extension.
uint8_t random[32]
Server random bytes.
uint16_t version
Selected version.
struct tls_cursor reneg
Renegotiation information extension.
struct tls_server_hello::@315336275176055335347330363223260265225077223170 * a
First fixed-length portion.
uint8_t compression_method
Selected compression method.
struct tls_cursor supver
Supported version.
ServerKeyExchange descriptor (for DHE).
struct tls_cursor dsig
Signature.
struct tls_cursor dh_ys
Public key.
struct tls_cursor dh_g
Generator.
struct tls_cursor dh_p
Prime modulus.
ServerKeyExchange descriptor (for ECDHE).
uint16_t group
Named group.
struct tls_server_key_exchange_ecdhe::@161027372353017270343224204013300325065157134244 * curve
Curve parameters.
struct tls_cursor dsig
Signature.
struct tls_cursor point
Curve point.
SupportedVersions descriptor (in ServerHello).
uint16_t * selected
Selected version.
SupportedVersions descriptor (in ClientHello).
struct tls_cursor versions
Supported versions.
int tls_build_map(const uint8_t *map, unsigned int version, union tls_ptr_len *desc, struct tls_cursor *cursor)
Build TLS data structure.
static const struct asn1_cursor * tls_asn1(const struct tls_cursor *cursor)
Get ASN.1 cursor from TLS cursor.
#define TLS_DESCR_MAPPING(desc)
Binary encoding of a descriptor structure mapping.
int tls_parse_opt_map(const uint8_t *map, unsigned int version, const struct tls_cursor *cursor, union tls_ptr_len *desc)
Parse optional TLS data structure.
int tls_parse_map(const uint8_t *map, unsigned int version, const struct tls_cursor *cursor, union tls_ptr_len *desc)
Parse TLS data structure.
static int tls_size_map(const uint8_t *map, unsigned int version, union tls_ptr_len *desc, struct tls_cursor *cursor)
Calculate length of TLS data structure.