diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2019-01-20 12:27:35 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2019-01-20 12:27:35 +0000 |
commit | d03c9afa38132cd6fcabdbe6971f76d655d76399 (patch) | |
tree | ff1120f42ce48284000ccbef9355c90bac630637 /lib/libssl/tls13_internal.h | |
parent | 37fe5f902bd78a23644121775ecddad7331f3050 (diff) |
Provide a handshake message handling implementation for TLS 1.3.
It receives handshake messages by reading and parsing data from the record
layer. It also provides support for building and sending handshake
messages.
ok tb@
Diffstat (limited to 'lib/libssl/tls13_internal.h')
-rw-r--r-- | lib/libssl/tls13_internal.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/libssl/tls13_internal.h b/lib/libssl/tls13_internal.h index 496627c0cd2..6b85cfdab90 100644 --- a/lib/libssl/tls13_internal.h +++ b/lib/libssl/tls13_internal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_internal.h,v 1.9 2019/01/20 10:31:54 jsing Exp $ */ +/* $OpenBSD: tls13_internal.h,v 1.10 2019/01/20 12:27:34 jsing Exp $ */ /* * Copyright (c) 2018 Bob Beck <beck@openbsd.org> * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> @@ -97,6 +97,9 @@ int tls13_derive_application_secrets(struct tls13_secrets *secrets, struct tls13_ctx; +/* + * Record Layer. + */ struct tls13_record_layer; struct tls13_record_layer *tls13_record_layer_new(tls13_read_cb wire_read, @@ -119,7 +122,25 @@ ssize_t tls13_write_application_data(struct tls13_record_layer *rl, const uint8_ size_t n); /* - * RFC 8446, Section B.3 + * Handshake Messages. + */ +struct tls13_handshake_msg; + +struct tls13_handshake_msg *tls13_handshake_msg_new(void); +void tls13_handshake_msg_free(struct tls13_handshake_msg *msg); +void tls13_handshake_msg_data(struct tls13_handshake_msg *msg, CBS *cbs); +uint8_t tls13_handshake_msg_type(struct tls13_handshake_msg *msg); +int tls13_handshake_msg_content(struct tls13_handshake_msg *msg, CBS *cbs); +int tls13_handshake_msg_start(struct tls13_handshake_msg *msg, CBB *body, + uint8_t msg_type); +int tls13_handshake_msg_finish(struct tls13_handshake_msg *msg); +int tls13_handshake_msg_recv(struct tls13_handshake_msg *msg, + struct tls13_record_layer *rl); +int tls13_handshake_msg_send(struct tls13_handshake_msg *msg, + struct tls13_record_layer *rl); + +/* + * Message Types - RFC 8446, Section B.3. * * Values listed as "_RESERVED" were used in previous versions of TLS and are * listed here for completeness. TLS 1.3 implementations MUST NOT send them but |