summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_internal.h
diff options
context:
space:
mode:
authorjsing <>2020-01-22 13:10:51 +0000
committerjsing <>2020-01-22 13:10:51 +0000
commit7655835d7e1b8fa812246e1e652a1747a4f67b32 (patch)
tree80ca1bcd2a0b8b6d5658a3b4bbec080ceced53e3 /src/lib/libssl/tls13_internal.h
parente53889cb5c5ff4e8801ca99623f6e16491f94358 (diff)
downloadopenbsd-7655835d7e1b8fa812246e1e652a1747a4f67b32.tar.gz
openbsd-7655835d7e1b8fa812246e1e652a1747a4f67b32.tar.bz2
openbsd-7655835d7e1b8fa812246e1e652a1747a4f67b32.zip
Pass a handshake message content CBS to TLSv1.3 receive handlers.
This avoids every receive handler from having to get the handshake message content itself. Additionally, pull the trailing data check up so that each receive handler does not have to implement it. This makes the code more readable and reduces duplication. ok beck@ tb@
Diffstat (limited to 'src/lib/libssl/tls13_internal.h')
-rw-r--r--src/lib/libssl/tls13_internal.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/lib/libssl/tls13_internal.h b/src/lib/libssl/tls13_internal.h
index 68a129a634..ba34961e33 100644
--- a/src/lib/libssl/tls13_internal.h
+++ b/src/lib/libssl/tls13_internal.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_internal.h,v 1.44 2020/01/22 06:23:00 jsing Exp $ */ 1/* $OpenBSD: tls13_internal.h,v 1.45 2020/01/22 13:10:51 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2018 Bob Beck <beck@openbsd.org> 3 * Copyright (c) 2018 Bob Beck <beck@openbsd.org>
4 * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
@@ -39,6 +39,7 @@ __BEGIN_HIDDEN_DECLS
39 39
40#define TLS13_ERR_VERIFY_FAILED 16 40#define TLS13_ERR_VERIFY_FAILED 16
41#define TLS13_ERR_HRR_FAILED 17 41#define TLS13_ERR_HRR_FAILED 17
42#define TLS13_ERR_TRAILING_DATA 18
42 43
43typedef void (*tls13_alert_cb)(uint8_t _alert_desc, void *_cb_arg); 44typedef void (*tls13_alert_cb)(uint8_t _alert_desc, void *_cb_arg);
44typedef ssize_t (*tls13_phh_recv_cb)(void *_cb_arg, CBS *cbs); 45typedef ssize_t (*tls13_phh_recv_cb)(void *_cb_arg, CBS *cbs);
@@ -258,33 +259,33 @@ int tls13_handshake_perform(struct tls13_ctx *ctx);
258 259
259int tls13_client_hello_send(struct tls13_ctx *ctx); 260int tls13_client_hello_send(struct tls13_ctx *ctx);
260int tls13_client_hello_sent(struct tls13_ctx *ctx); 261int tls13_client_hello_sent(struct tls13_ctx *ctx);
261int tls13_client_hello_recv(struct tls13_ctx *ctx); 262int tls13_client_hello_recv(struct tls13_ctx *ctx, CBS *cbs);
262int tls13_client_hello_retry_send(struct tls13_ctx *ctx); 263int tls13_client_hello_retry_send(struct tls13_ctx *ctx);
263int tls13_client_hello_retry_recv(struct tls13_ctx *ctx); 264int tls13_client_hello_retry_recv(struct tls13_ctx *ctx, CBS *cbs);
264int tls13_client_end_of_early_data_send(struct tls13_ctx *ctx); 265int tls13_client_end_of_early_data_send(struct tls13_ctx *ctx);
265int tls13_client_end_of_early_data_recv(struct tls13_ctx *ctx); 266int tls13_client_end_of_early_data_recv(struct tls13_ctx *ctx, CBS *cbs);
266int tls13_client_certificate_send(struct tls13_ctx *ctx); 267int tls13_client_certificate_send(struct tls13_ctx *ctx);
267int tls13_client_certificate_recv(struct tls13_ctx *ctx); 268int tls13_client_certificate_recv(struct tls13_ctx *ctx, CBS *cbs);
268int tls13_client_certificate_verify_send(struct tls13_ctx *ctx); 269int tls13_client_certificate_verify_send(struct tls13_ctx *ctx);
269int tls13_client_certificate_verify_recv(struct tls13_ctx *ctx); 270int tls13_client_certificate_verify_recv(struct tls13_ctx *ctx, CBS *cbs);
270int tls13_client_finished_recv(struct tls13_ctx *ctx); 271int tls13_client_finished_recv(struct tls13_ctx *ctx, CBS *cbs);
271int tls13_client_finished_send(struct tls13_ctx *ctx); 272int tls13_client_finished_send(struct tls13_ctx *ctx);
272int tls13_client_finished_sent(struct tls13_ctx *ctx); 273int tls13_client_finished_sent(struct tls13_ctx *ctx);
273int tls13_client_key_update_send(struct tls13_ctx *ctx); 274int tls13_client_key_update_send(struct tls13_ctx *ctx);
274int tls13_client_key_update_recv(struct tls13_ctx *ctx); 275int tls13_client_key_update_recv(struct tls13_ctx *ctx, CBS *cbs);
275int tls13_server_hello_recv(struct tls13_ctx *ctx); 276int tls13_server_hello_recv(struct tls13_ctx *ctx, CBS *cbs);
276int tls13_server_hello_send(struct tls13_ctx *ctx); 277int tls13_server_hello_send(struct tls13_ctx *ctx);
277int tls13_server_hello_retry_recv(struct tls13_ctx *ctx); 278int tls13_server_hello_retry_recv(struct tls13_ctx *ctx, CBS *cbs);
278int tls13_server_hello_retry_send(struct tls13_ctx *ctx); 279int tls13_server_hello_retry_send(struct tls13_ctx *ctx);
279int tls13_server_encrypted_extensions_recv(struct tls13_ctx *ctx); 280int tls13_server_encrypted_extensions_recv(struct tls13_ctx *ctx, CBS *cbs);
280int tls13_server_encrypted_extensions_send(struct tls13_ctx *ctx); 281int tls13_server_encrypted_extensions_send(struct tls13_ctx *ctx);
281int tls13_server_certificate_recv(struct tls13_ctx *ctx); 282int tls13_server_certificate_recv(struct tls13_ctx *ctx, CBS *cbs);
282int tls13_server_certificate_send(struct tls13_ctx *ctx); 283int tls13_server_certificate_send(struct tls13_ctx *ctx);
283int tls13_server_certificate_request_recv(struct tls13_ctx *ctx); 284int tls13_server_certificate_request_recv(struct tls13_ctx *ctx, CBS *cbs);
284int tls13_server_certificate_request_send(struct tls13_ctx *ctx); 285int tls13_server_certificate_request_send(struct tls13_ctx *ctx);
285int tls13_server_certificate_verify_send(struct tls13_ctx *ctx); 286int tls13_server_certificate_verify_send(struct tls13_ctx *ctx);
286int tls13_server_certificate_verify_recv(struct tls13_ctx *ctx); 287int tls13_server_certificate_verify_recv(struct tls13_ctx *ctx, CBS *cbs);
287int tls13_server_finished_recv(struct tls13_ctx *ctx); 288int tls13_server_finished_recv(struct tls13_ctx *ctx, CBS *cbs);
288int tls13_server_finished_send(struct tls13_ctx *ctx); 289int tls13_server_finished_send(struct tls13_ctx *ctx);
289 290
290void tls13_error_clear(struct tls13_error *error); 291void tls13_error_clear(struct tls13_error *error);