diff options
Diffstat (limited to 'src/lib/libssl/tls13_record.h')
-rw-r--r-- | src/lib/libssl/tls13_record.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/libssl/tls13_record.h b/src/lib/libssl/tls13_record.h index ca7a63f99c..72350d5d49 100644 --- a/src/lib/libssl/tls13_record.h +++ b/src/lib/libssl/tls13_record.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_record.h,v 1.1 2019/01/19 02:53:54 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_record.h,v 1.2 2019/01/20 09:12:05 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2019 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2019 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -24,7 +24,7 @@ | |||
24 | __BEGIN_HIDDEN_DECLS | 24 | __BEGIN_HIDDEN_DECLS |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * TLSv1.3 - RFC 8446 section 5. | 27 | * TLSv1.3 Record Protocol - RFC 8446 section 5. |
28 | * | 28 | * |
29 | * The maximum plaintext is 2^14, however for inner plaintext an additional | 29 | * The maximum plaintext is 2^14, however for inner plaintext an additional |
30 | * byte is allowed for the content type. A maximum AEAD overhead of 255-bytes | 30 | * byte is allowed for the content type. A maximum AEAD overhead of 255-bytes |
@@ -36,17 +36,23 @@ __BEGIN_HIDDEN_DECLS | |||
36 | #define TLS13_RECORD_MAX_PLAINTEXT_LEN 16384 | 36 | #define TLS13_RECORD_MAX_PLAINTEXT_LEN 16384 |
37 | #define TLS13_RECORD_MAX_INNER_PLAINTEXT_LEN \ | 37 | #define TLS13_RECORD_MAX_INNER_PLAINTEXT_LEN \ |
38 | (TLS13_RECORD_MAX_PLAINTEXT_LEN + 1) | 38 | (TLS13_RECORD_MAX_PLAINTEXT_LEN + 1) |
39 | #define TLS13_RECORD_MAX_CIPHERTEXT \ | 39 | #define TLS13_RECORD_MAX_CIPHERTEXT_LEN \ |
40 | (TLS13_RECORD_MAX_INNER_PLAINTEXT_LEN + TLS13_RECORD_MAX_AEAD_OVERHEAD) | 40 | (TLS13_RECORD_MAX_INNER_PLAINTEXT_LEN + TLS13_RECORD_MAX_AEAD_OVERHEAD) |
41 | #define TLS13_RECORD_MAX_LEN \ | 41 | #define TLS13_RECORD_MAX_LEN \ |
42 | (TLS13_RECORD_HEADER_LEN + TLS13_RECORD_MAX_CIPHERTEXT) | 42 | (TLS13_RECORD_HEADER_LEN + TLS13_RECORD_MAX_CIPHERTEXT_LEN) |
43 | |||
44 | /* | ||
45 | * TLSv1.3 Per-Record Nonces and Sequence Numbers - RFC 8446 section 5.3. | ||
46 | */ | ||
47 | #define TLS13_RECORD_SEQ_NUM_LEN 8 | ||
43 | 48 | ||
44 | struct tls13_record *tls13_record_new(void); | 49 | struct tls13_record *tls13_record_new(void); |
45 | void tls13_record_free(struct tls13_record *_rec); | 50 | void tls13_record_free(struct tls13_record *_rec); |
51 | int tls13_record_header(struct tls13_record *_rec, CBS *_cbs); | ||
46 | uint8_t tls13_record_content_type(struct tls13_record *_rec); | 52 | uint8_t tls13_record_content_type(struct tls13_record *_rec); |
47 | int tls13_record_content(struct tls13_record *_rec, CBS *_cbs); | 53 | int tls13_record_content(struct tls13_record *_rec, CBS *_cbs); |
48 | void tls13_record_data(struct tls13_record *_rec, CBS *_cbs); | 54 | void tls13_record_data(struct tls13_record *_rec, CBS *_cbs); |
49 | void tls13_record_set_data(struct tls13_record *_rec, uint8_t *_data, | 55 | int tls13_record_set_data(struct tls13_record *_rec, uint8_t *_data, |
50 | size_t _data_len); | 56 | size_t _data_len); |
51 | ssize_t tls13_record_recv(struct tls13_record *_rec, tls13_read_cb _wire_read, | 57 | ssize_t tls13_record_recv(struct tls13_record *_rec, tls13_read_cb _wire_read, |
52 | void *_wire_arg); | 58 | void *_wire_arg); |