iPXE
tls.h
Go to the documentation of this file.
1#ifndef _IPXE_TLS_H
2#define _IPXE_TLS_H
3
4/**
5 * @file
6 *
7 * Transport Layer Security Protocol
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <stdint.h>
14#include <ipxe/refcnt.h>
15#include <ipxe/interface.h>
16#include <ipxe/process.h>
17#include <ipxe/crypto.h>
18#include <ipxe/x509.h>
19#include <ipxe/privkey.h>
20#include <ipxe/pending.h>
21#include <ipxe/iobuf.h>
22#include <ipxe/tables.h>
23#include <ipxe/channel.h>
24#include <ipxe/tlskey.h>
25#include <ipxe/tlsfmt.h>
26
27struct tls_connection;
28
29/** A TLS header */
30struct tls_header {
31 /** Content type
32 *
33 * This is a TLS_TYPE_XXX constant
34 */
36 /** Protocol version
37 *
38 * This is a TLS_VERSION_XXX constant
39 */
41 /** Length of payload */
43} __attribute__ (( packed ));
44
45/** A TLS handshake header */
47 /** Type */
49 /** Type and length */
51} __attribute__ (( packed ));
52
53/** Get TLS handshake length */
54#define TLS_HANDSHAKE_LEN( type_len ) ( ntohl (type_len) & 0xffffff )
55
56/** TLS server random data */
58 /** Random bytes */
60 /** Version downgrade detection */
61 struct {
62 /** Unused */
64 /** Magic signature */
66 /** Negotiated version (as a delta from TLSv1.1) */
68 } __attribute__ (( packed )) downgrade;
69};
70
71/** TLS server downgrade detection magic signature */
72#define TLS_SERVER_DOWNGRADE_MAGIC "DOWNGRD"
73
74/** Change cipher content type */
75#define TLS_TYPE_CHANGE_CIPHER 20
76
77/** Change cipher spec magic byte */
78#define TLS_CHANGE_CIPHER_SPEC 1
79
80/** Alert content type */
81#define TLS_TYPE_ALERT 21
82
83/** Handshake content type */
84#define TLS_TYPE_HANDSHAKE 22
85
86/** Application data content type */
87#define TLS_TYPE_DATA 23
88
89/* Handshake message types */
90#define TLS_HELLO_REQUEST 0
91#define TLS_CLIENT_HELLO 1
92#define TLS_SERVER_HELLO 2
93#define TLS_NEW_SESSION_TICKET 4
94#define TLS_CERTIFICATE 11
95#define TLS_SERVER_KEY_EXCHANGE 12
96#define TLS_CERTIFICATE_REQUEST 13
97#define TLS_SERVER_HELLO_DONE 14
98#define TLS_CERTIFICATE_VERIFY 15
99#define TLS_CLIENT_KEY_EXCHANGE 16
100#define TLS_FINISHED 20
101
102/* TLS alert levels */
103#define TLS_ALERT_WARNING 1
104#define TLS_ALERT_FATAL 2
105
106/* TLS alert descriptions */
107#define TLS_ALERT_CLOSE_NOTIFY 0
108
109/* TLS cipher specifications */
110#define TLS_RSA_WITH_NULL_MD5 0x0001
111#define TLS_RSA_WITH_NULL_SHA 0x0002
112#define TLS_RSA_WITH_AES_128_CBC_SHA 0x002f
113#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA 0x0033
114#define TLS_RSA_WITH_AES_256_CBC_SHA 0x0035
115#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA 0x0039
116#define TLS_RSA_WITH_AES_128_CBC_SHA256 0x003c
117#define TLS_RSA_WITH_AES_256_CBC_SHA256 0x003d
118#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 0x0067
119#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 0x006b
120#define TLS_RSA_WITH_AES_128_GCM_SHA256 0x009c
121#define TLS_RSA_WITH_AES_256_GCM_SHA384 0x009d
122#define TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 0x009e
123#define TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 0x009f
124#define TLS_AES_128_GCM_SHA256 0x1301
125#define TLS_AES_256_GCM_SHA384 0x1302
126#define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0xc009
127#define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0xc00a
128#define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA 0xc013
129#define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA 0xc014
130#define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 0xc023
131#define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 0xc024
132#define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 0xc027
133#define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 0xc028
134#define TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0xc02b
135#define TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0xc02c
136#define TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xc02f
137#define TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0xc030
138
139/* TLS signature hash algorithm identifiers */
140#define TLS_RSA_SHA1_ALGORITHM 0x0201
141#define TLS_RSA_SHA224_ALGORITHM 0x0301
142#define TLS_ECDSA_SHA224_ALGORITHM 0x0303
143#define TLS_RSA_SHA256_ALGORITHM 0x0401
144#define TLS_ECDSA_SHA256_ALGORITHM 0x0403
145#define TLS_RSA_SHA384_ALGORITHM 0x0501
146#define TLS_ECDSA_SHA384_ALGORITHM 0x0503
147#define TLS_RSA_SHA512_ALGORITHM 0x0601
148#define TLS_ECDSA_SHA512_ALGORITHM 0x0603
149#define TLS_RSA_PSS_RSAE_SHA256_ALGORITHM 0x0804
150#define TLS_RSA_PSS_RSAE_SHA384_ALGORITHM 0x0805
151#define TLS_RSA_PSS_RSAE_SHA512_ALGORITHM 0x0806
152#define TLS_RSA_PSS_PSS_SHA256_ALGORITHM 0x0809
153#define TLS_RSA_PSS_PSS_SHA384_ALGORITHM 0x080a
154#define TLS_RSA_PSS_PSS_SHA512_ALGORITHM 0x080b
155
156/* TLS server name extension */
157#define TLS_SERVER_NAME 0
158#define TLS_SERVER_NAME_HOST_NAME 0
159
160/* TLS maximum fragment length extension */
161#define TLS_MAX_FRAGMENT_LENGTH 1
162#define TLS_MAX_FRAGMENT_LENGTH_512 1
163#define TLS_MAX_FRAGMENT_LENGTH_1024 2
164#define TLS_MAX_FRAGMENT_LENGTH_2048 3
165#define TLS_MAX_FRAGMENT_LENGTH_4096 4
166
167/* TLS named key exchange group extension */
168#define TLS_NAMED_GROUP 10
169#define TLS_NAMED_GROUP_SECP256R1 23
170#define TLS_NAMED_GROUP_SECP384R1 24
171#define TLS_NAMED_GROUP_X25519 29
172#define TLS_NAMED_GROUP_FFDHE2048 256
173#define TLS_NAMED_GROUP_FFDHE3072 257
174#define TLS_NAMED_GROUP_FFDHE4096 258
175
176/* TLS signature algorithms extension */
177#define TLS_SIGNATURE_ALGORITHMS 13
178
179/* TLS extended master secret extension */
180#define TLS_EXTENDED_MASTER_SECRET 23
181
182/* TLS record size limit extension */
183#define TLS_RECORD_SIZE_LIMIT 28
184
185/* TLS session ticket extension */
186#define TLS_SESSION_TICKET 35
187
188/* TLS supported versions extension */
189#define TLS_SUPPORTED_VERSIONS 43
190
191/* TLS cookie extension */
192#define TLS_COOKIE 44
193
194/* TLS pre-shared key modes extension */
195#define TLS_PSK_MODES 45
196
197/* TLS key share extension */
198#define TLS_KEY_SHARE 51
199
200/* TLS renegotiation information extension */
201#define TLS_RENEGOTIATION_INFO 0xff01
202
203/** TLS authentication header */
205 /** Sequence number */
207 /** TLS header */
209} __attribute__ (( packed ));
210
211/** TLS RX state machine state */
216
217/** TLS TX pending flags */
226
227/** TLS key exchange parameters */
229 /** Length of parameters (excluding trailing signature) */
230 size_t len;
231 /** Named group */
233 /** Partner key */
235};
236
237/** A TLS key exchange algorithm */
239 /** Algorithm name */
240 const char *name;
241 /** Default named group */
243 /**
244 * Parse key exchange parameters from Server Key Exchange record
245 *
246 * @v tls TLS connection
247 * @v cursor Server Key Exchange handshake record
248 * @v kex Key exchange parameters to fill in
249 * @ret rc Return status code
250 */
251 int ( * parse ) ( struct tls_connection *tls,
252 const struct tls_cursor *cursor,
253 struct tls_key_exchange_parameters *kex );
254 /** ClientKeyExchange descriptor mapping */
255 const uint8_t *map;
256};
257
258/**
259 * A TLS cipher suite
260 *
261 * All algorithm fields must be defined. If the cipher suite does not
262 * use the algorithm in question, then the null version of that
263 * algorithm must be used (e.g. @c &digest_null for AEAD ciphers that
264 * have no MAC digest algorithm).
265 */
267 /** Key exchange algorithm */
269 /** Public-key encryption algorithm */
271 /** Bulk encryption cipher algorithm */
273 /** MAC digest algorithm */
275 /** Handshake digest algorithm (for TLSv1.2 and above) */
277 /** Numeric code (in network-endian order) */
279 /** Key length */
281 /** Fixed initialisation vector length */
283 /** Record initialisation vector length */
285 /** MAC length */
287 /** Verification data length */
289 /** Flags */
291};
292
293/** Cipher XORs sequence number into the initialisation vector */
294#define TLS_CIPHER_FL_SEQUENTIAL_IV 0x01
295
296/** TLS cipher suite table */
297#define TLS_CIPHER_SUITES \
298 __table ( struct tls_cipher_suite, "tls_cipher_suites" )
299
300/** Declare a TLS cipher suite */
301#define __tls_cipher_suite( pref ) \
302 __table_entry ( TLS_CIPHER_SUITES, pref )
303
304/** TLS named curve type */
305#define TLS_NAMED_CURVE_TYPE 3
306
307/** A TLS named group */
309 /** Key exchange algorithm */
311 /** Numeric code (in network-endian order) */
313};
314
315/** TLS named group table */
316#define TLS_NAMED_GROUPS \
317 __table ( struct tls_named_group, "tls_named_groups" )
318
319/** Declare a TLS named group */
320#define __tls_named_group( pref ) \
321 __table_entry ( TLS_NAMED_GROUPS, pref )
322
323/** Declare a TLS anonymous named group */
324#define __tls_anon_named_group __tls_named_group ( 98 )
325
326/** Number of non-anonymous TLS named groups */
327#define TLS_NUM_NAMED_GROUPS \
328 ( ( unsigned int ) \
329 ( __table_entries ( TLS_NAMED_GROUPS, 97 ) \
330 - table_start ( TLS_NAMED_GROUPS ) ) )
331
332/** A TLS cipher specification */
334 /** Cipher suite */
336 /** Writer endpoint */
337 const struct tls_endpoint *writer;
338 /** Secure pipe */
340 /** Pending traffic phase change */
341 const struct tls_phase *pending;
342 /** Sequence number */
344
345 /** Dynamically-allocated storage */
346 void *dynamic;
347 /** Cipher key */
349 /** MAC secret */
351 /** Fixed initialisation vector */
352 void *fixed_iv;
353};
354
355/** A TLS signature algorithm */
357 /** Digest algorithm */
359 /** Public-key algorithm */
361 /** Required certificate OID-identified algorithm, if any */
363 /** Numeric code (in network-endian order) */
365};
366
367/** TLS signature hash algorithm table
368 *
369 * Note that the default (TLSv1.1 and earlier) algorithm using
370 * MD5+SHA1 is never explicitly specified.
371 */
372#define TLS_SIG_HASH_ALGORITHMS \
373 __table ( struct tls_signature_hash_algorithm, \
374 "tls_sig_hash_algorithms" )
375
376/** Declare a TLS signature hash algorithm */
377#define __tls_sig_hash_algorithm \
378 __table_entry ( TLS_SIG_HASH_ALGORITHMS, 01 )
379
380/** A TLS session ID */
382 /** ID */
384 /** Length of ID */
386};
387
388/** A TLS session */
390 /** Reference counter */
392 /** List of sessions */
394
395 /** Server name */
396 const char *name;
397 /** Root of trust */
399 /** Private key */
401
402 /** Bound peer identity */
404 /** Pre-shared key */
406 /** Session ID */
408 /** Session ticket */
410
411 /** List of connections */
413};
414
415/** TLS verification data */
417 /** Dynamically allocated storage */
418 void *dynamic;
419 /** Client verification data */
420 void *client;
421 /** Server verification data */
422 void *server;
423 /** Length of each verification data */
424 size_t len;
425};
426
427/** TLS transmit state */
428struct tls_tx {
429 /** Cipher specification */
431 /** Pending transmissions */
432 unsigned int pending;
433 /** Transmit process */
435};
436
437/** TLS receive state */
438struct tls_rx {
439 /** Cipher specification */
441 /** State machine current state */
443 /** Current received record header */
445 /** Current received record header (static I/O buffer) */
447 /** List of received data buffers */
449 /** Received handshake fragment (if any) */
451};
452
453/** TLS client state */
455 /** Private key */
457 /** Certificate chain (if any) */
459 /** Security negotiation pending operation */
461};
462
463/** TLS server state */
465 /** Root of trust */
467 /** Certificate chain (if any) */
469 /** Certificate validator */
471 /** Certificate validation pending operation */
473 /** Security negotiation pending operation */
475};
476
477/** A TLS connection */
479 /** Reference counter */
481
482 /** Session */
484 /** List of connections within the same session */
486 /** New session ID (if any) */
488 /** New session ticket (if any) */
490
491 /** Plaintext stream */
493 /** Ciphertext stream */
495
496 /** Protocol version */
498 /** Legacy protocol version */
500 /** Cipher suite */
502 /** Key exchange named group */
504 /** Secure renegotiation flag */
506 /** Extended master secret flag */
508 /** Verification data */
510 /** Cookie */
512
513 /** Secure channel */
515 /** Key schedule */
517 /** Transmit state */
518 struct tls_tx tx;
519 /** Receive state */
520 struct tls_rx rx;
521 /** Client state */
523 /** Server state */
525};
526
527/** Advertised maximum fragment length */
528#define TLS_MAX_FRAGMENT_LENGTH_VALUE TLS_MAX_FRAGMENT_LENGTH_4096
529
530/** TX maximum fragment length
531 *
532 * TLS requires us to limit our transmitted records to the maximum
533 * fragment length that we attempt to negotiate, even if the server
534 * does not respect this choice.
535 */
536#define TLS_TX_BUFSIZE 4096
537
538/** RX I/O buffer size
539 *
540 * The maximum fragment length extension is optional, and many common
541 * implementations (including OpenSSL) do not support it. We must
542 * therefore be prepared to receive records of up to 16kB in length.
543 * The chance of an allocation of this size failing is non-negligible,
544 * so we must split received data into smaller allocations.
545 */
546#define TLS_RX_BUFSIZE 4096
547
548/** Minimum RX I/O buffer size
549 *
550 * To simplify manipulations, we ensure that no RX I/O buffer is
551 * smaller than this size. This allows us to assume that the MAC and
552 * padding are entirely contained within the final I/O buffer.
553 */
554#define TLS_RX_MIN_BUFSIZE 512
555
556/** RX I/O buffer alignment */
557#define TLS_RX_ALIGN 16
558
560
565
566extern int add_tls ( struct interface *xfer, const char *name,
567 struct x509_root *root, struct private_key *key );
568
569#endif /* _IPXE_TLS_H */
union @162305117151260234136356364136041353210355154177 key
unsigned short uint16_t
Definition stdint.h:11
unsigned int uint32_t
Definition stdint.h:12
unsigned long long uint64_t
Definition stdint.h:13
unsigned char uint8_t
Definition stdint.h:10
const char * name
Definition ath9k_hw.c:1986
Secure channel abstraction.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
#define __attribute__(x)
Definition compiler.h:10
Cryptographic API.
Object interfaces.
I/O buffers.
Pending operations.
Private key.
Processes.
Reference counting.
struct stp_switch root
Root switch.
Definition stp.h:15
An ASN.1 OID-identified algorithm.
Definition asn1.h:429
A cipher algorithm.
Definition crypto.h:58
A message digest algorithm.
Definition crypto.h:19
A key exchange algorithm.
Definition crypto.h:210
An object interface.
Definition interface.h:125
A persistent I/O buffer.
Definition iobuf.h:98
A doubly-linked list entry (or list head).
Definition list.h:19
A pending operation.
Definition pending.h:14
A private key.
Definition privkey.h:17
A public key algorithm.
Definition crypto.h:142
A secure channel.
Definition channel.h:72
A secure channel transmit or receive pipe.
Definition channel.h:56
A pre-shared bound peer identity.
Definition channel.h:97
TLS authentication header.
Definition tls.h:204
uint64_t seq
Sequence number.
Definition tls.h:206
struct tls_header header
TLS header.
Definition tls.h:208
A TLS cipher suite.
Definition tls.h:266
uint8_t fixed_iv_len
Fixed initialisation vector length.
Definition tls.h:282
struct cipher_algorithm * cipher
Bulk encryption cipher algorithm.
Definition tls.h:272
struct pubkey_algorithm * pubkey
Public-key encryption algorithm.
Definition tls.h:270
uint8_t key_len
Key length.
Definition tls.h:280
uint8_t verify_len
Verification data length.
Definition tls.h:288
uint8_t mac_len
MAC length.
Definition tls.h:286
uint8_t record_iv_len
Record initialisation vector length.
Definition tls.h:284
uint8_t flags
Flags.
Definition tls.h:290
struct digest_algorithm * digest
MAC digest algorithm.
Definition tls.h:274
struct tls_key_exchange_algorithm * exchange
Key exchange algorithm.
Definition tls.h:268
uint16_t code
Numeric code (in network-endian order).
Definition tls.h:278
struct digest_algorithm * handshake
Handshake digest algorithm (for TLSv1.2 and above).
Definition tls.h:276
A TLS cipher specification.
Definition tls.h:333
void * fixed_iv
Fixed initialisation vector.
Definition tls.h:352
uint64_t seq
Sequence number.
Definition tls.h:343
void * cipher_key
Cipher key.
Definition tls.h:348
const struct tls_endpoint * writer
Writer endpoint.
Definition tls.h:337
const struct tls_phase * pending
Pending traffic phase change.
Definition tls.h:341
struct tls_cipher_suite * suite
Cipher suite.
Definition tls.h:335
void * dynamic
Dynamically-allocated storage.
Definition tls.h:346
struct secure_pipe * pipe
Secure pipe.
Definition tls.h:339
void * mac_secret
MAC secret.
Definition tls.h:350
TLS client state.
Definition tls.h:454
struct private_key * key
Private key.
Definition tls.h:456
struct x509_chain * chain
Certificate chain (if any).
Definition tls.h:458
struct pending_operation negotiation
Security negotiation pending operation.
Definition tls.h:460
A TLS connection.
Definition tls.h:478
struct tls_named_group * group
Key exchange named group.
Definition tls.h:503
struct interface cipherstream
Ciphertext stream.
Definition tls.h:494
struct tls_session * session
Session.
Definition tls.h:483
struct tls_server server
Server state.
Definition tls.h:524
struct tls_key_schedule key
Key schedule.
Definition tls.h:516
struct tls_rx rx
Receive state.
Definition tls.h:520
struct tls_verify_data verify
Verification data.
Definition tls.h:509
struct secure_channel channel
Secure channel.
Definition tls.h:514
struct interface plainstream
Plaintext stream.
Definition tls.h:492
struct tls_tx tx
Transmit state.
Definition tls.h:518
struct tls_cursor cookie
Cookie.
Definition tls.h:511
struct tls_cipher_suite * suite
Cipher suite.
Definition tls.h:501
int extended_master_secret
Extended master secret flag.
Definition tls.h:507
struct list_head list
List of connections within the same session.
Definition tls.h:485
struct tls_client client
Client state.
Definition tls.h:522
struct tls_cursor new_ticket
New session ticket (if any).
Definition tls.h:489
uint16_t version
Protocol version.
Definition tls.h:497
uint16_t legacy_version
Legacy protocol version.
Definition tls.h:499
struct tls_session_id new_id
New session ID (if any).
Definition tls.h:487
struct refcnt refcnt
Reference counter.
Definition tls.h:480
int secure_renegotiation
Secure renegotiation flag.
Definition tls.h:505
A TLS variable-length data cursor.
Definition tlsfmt.h:186
A TLS endpoint.
Definition tlskey.h:19
A TLS header.
Definition tls.h:30
uint16_t version
Protocol version.
Definition tls.h:40
uint16_t length
Length of payload.
Definition tls.h:42
uint8_t type
Content type.
Definition tls.h:35
A TLS key exchange algorithm.
Definition tls.h:238
const char * name
Algorithm name.
Definition tls.h:240
struct tls_named_group * group
Default named group.
Definition tls.h:242
int(* parse)(struct tls_connection *tls, const struct tls_cursor *cursor, struct tls_key_exchange_parameters *kex)
Parse key exchange parameters from Server Key Exchange record.
Definition tls.h:251
const uint8_t * map
ClientKeyExchange descriptor mapping.
Definition tls.h:255
TLS key exchange parameters.
Definition tls.h:228
size_t len
Length of parameters (excluding trailing signature).
Definition tls.h:230
struct tls_named_group * group
Named group.
Definition tls.h:232
struct tls_cursor partner
Partner key.
Definition tls.h:234
A TLS key schedule.
Definition tlskey.h:113
A TLS named group.
Definition tls.h:308
uint16_t code
Numeric code (in network-endian order).
Definition tls.h:312
struct exchange_algorithm * exchange
Key exchange algorithm.
Definition tls.h:310
A TLS traffic phase.
Definition tlskey.c:127
A TLS pre-shared key.
Definition tlskey.h:141
TLS receive state.
Definition tls.h:438
struct list_head data
List of received data buffers.
Definition tls.h:448
struct io_buffer iobuf
Current received record header (static I/O buffer).
Definition tls.h:446
struct tls_cipherspec cipherspec
Cipher specification.
Definition tls.h:440
struct io_buffer * handshake
Received handshake fragment (if any).
Definition tls.h:450
enum tls_rx_state state
State machine current state.
Definition tls.h:442
struct tls_header header
Current received record header.
Definition tls.h:444
TLS server state.
Definition tls.h:464
struct pending_operation validation
Certificate validation pending operation.
Definition tls.h:472
struct interface validator
Certificate validator.
Definition tls.h:470
struct x509_root * root
Root of trust.
Definition tls.h:466
struct pending_operation negotiation
Security negotiation pending operation.
Definition tls.h:474
struct x509_chain * chain
Certificate chain (if any).
Definition tls.h:468
A TLS session ID.
Definition tls.h:381
uint8_t len
Length of ID.
Definition tls.h:385
uint8_t data[32]
ID.
Definition tls.h:383
A TLS session.
Definition tls.h:389
struct private_key * key
Private key.
Definition tls.h:400
struct tls_cursor ticket
Session ticket.
Definition tls.h:409
const char * name
Server name.
Definition tls.h:396
struct secure_preshared_identity psid
Bound peer identity.
Definition tls.h:403
struct x509_root * root
Root of trust.
Definition tls.h:398
struct tls_preshared_key psk
Pre-shared key.
Definition tls.h:405
struct list_head conn
List of connections.
Definition tls.h:412
struct refcnt refcnt
Reference counter.
Definition tls.h:391
struct tls_session_id id
Session ID.
Definition tls.h:407
struct list_head list
List of sessions.
Definition tls.h:393
A TLS signature algorithm.
Definition tls.h:356
struct asn1_algorithm * algorithm
Required certificate OID-identified algorithm, if any.
Definition tls.h:362
struct pubkey_algorithm * pubkey
Public-key algorithm.
Definition tls.h:360
uint16_t code
Numeric code (in network-endian order).
Definition tls.h:364
struct digest_algorithm * digest
Digest algorithm.
Definition tls.h:358
TLS transmit state.
Definition tls.h:428
struct tls_cipherspec cipherspec
Cipher specification.
Definition tls.h:430
unsigned int pending
Pending transmissions.
Definition tls.h:432
struct process process
Transmit process.
Definition tls.h:434
TLS verification data.
Definition tls.h:416
void * dynamic
Dynamically allocated storage.
Definition tls.h:418
void * client
Client verification data.
Definition tls.h:420
size_t len
Length of each verification data.
Definition tls.h:424
void * server
Server verification data.
Definition tls.h:422
An X.509 certificate chain.
Definition x509.h:201
An X.509 root certificate list.
Definition x509.h:375
Linker tables.
struct tls_key_exchange_algorithm tls_null_exchange_algorithm
Null key exchange algorithm.
Definition tls.c:1125
struct tls_key_exchange_algorithm tls_pubkey_exchange_algorithm
Public key exchange algorithm.
Definition tls.c:1138
struct tls_key_exchange_algorithm tls_ecdhe_exchange_algorithm
Ephemeral Elliptic Curve Diffie-Hellman key exchange algorithm.
Definition tls.c:1241
struct tls_key_exchange_algorithm tls_dhe_exchange_algorithm
Ephemeral Diffie-Hellman key exchange algorithm.
Definition tls.c:1186
tls_rx_state
TLS RX state machine state.
Definition tls.h:212
@ TLS_RX_HEADER
Definition tls.h:213
@ TLS_RX_DATA
Definition tls.h:214
tls_tx_pending
TLS TX pending flags.
Definition tls.h:218
@ TLS_TX_FINISHED
Definition tls.h:224
@ TLS_TX_CLIENT_KEY_EXCHANGE
Definition tls.h:221
@ TLS_TX_CLIENT_HELLO
Definition tls.h:219
@ TLS_TX_CHANGE_CIPHER
Definition tls.h:223
@ TLS_TX_CERTIFICATE_VERIFY
Definition tls.h:222
@ TLS_TX_CERTIFICATE
Definition tls.h:220
int add_tls(struct interface *xfer, const char *name, struct x509_root *root, struct private_key *key)
Add TLS on an interface.
Definition tls.c:4628
struct exchange_algorithm tls_classic_pre_master_algorithm
Classic pre-master secret key exchange algorithm.
Definition tlsclassic.c:101
TLS data formats.
TLS key schedules.
A TLS handshake header.
Definition tls.h:46
uint8_t type
Type.
Definition tls.h:48
uint32_t type_len
Type and length.
Definition tls.h:50
TLS server random data.
Definition tls.h:57
uint8_t magic[7]
Magic signature.
Definition tls.h:65
struct tls_server_random::@277065305262320303277017256323141213323144155004 downgrade
Version downgrade detection.
uint8_t version
Negotiated version (as a delta from TLSv1.1).
Definition tls.h:67
uint8_t random[32]
Random bytes.
Definition tls.h:59
uint8_t unused[24]
Unused.
Definition tls.h:63
X.509 certificates.