diff options
author | jsing <> | 2020-01-22 13:10:51 +0000 |
---|---|---|
committer | jsing <> | 2020-01-22 13:10:51 +0000 |
commit | 7655835d7e1b8fa812246e1e652a1747a4f67b32 (patch) | |
tree | 80ca1bcd2a0b8b6d5658a3b4bbec080ceced53e3 /src/lib/libssl/tls13_internal.h | |
parent | e53889cb5c5ff4e8801ca99623f6e16491f94358 (diff) | |
download | openbsd-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.h | 31 |
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 | ||
43 | typedef void (*tls13_alert_cb)(uint8_t _alert_desc, void *_cb_arg); | 44 | typedef void (*tls13_alert_cb)(uint8_t _alert_desc, void *_cb_arg); |
44 | typedef ssize_t (*tls13_phh_recv_cb)(void *_cb_arg, CBS *cbs); | 45 | typedef 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 | ||
259 | int tls13_client_hello_send(struct tls13_ctx *ctx); | 260 | int tls13_client_hello_send(struct tls13_ctx *ctx); |
260 | int tls13_client_hello_sent(struct tls13_ctx *ctx); | 261 | int tls13_client_hello_sent(struct tls13_ctx *ctx); |
261 | int tls13_client_hello_recv(struct tls13_ctx *ctx); | 262 | int tls13_client_hello_recv(struct tls13_ctx *ctx, CBS *cbs); |
262 | int tls13_client_hello_retry_send(struct tls13_ctx *ctx); | 263 | int tls13_client_hello_retry_send(struct tls13_ctx *ctx); |
263 | int tls13_client_hello_retry_recv(struct tls13_ctx *ctx); | 264 | int tls13_client_hello_retry_recv(struct tls13_ctx *ctx, CBS *cbs); |
264 | int tls13_client_end_of_early_data_send(struct tls13_ctx *ctx); | 265 | int tls13_client_end_of_early_data_send(struct tls13_ctx *ctx); |
265 | int tls13_client_end_of_early_data_recv(struct tls13_ctx *ctx); | 266 | int tls13_client_end_of_early_data_recv(struct tls13_ctx *ctx, CBS *cbs); |
266 | int tls13_client_certificate_send(struct tls13_ctx *ctx); | 267 | int tls13_client_certificate_send(struct tls13_ctx *ctx); |
267 | int tls13_client_certificate_recv(struct tls13_ctx *ctx); | 268 | int tls13_client_certificate_recv(struct tls13_ctx *ctx, CBS *cbs); |
268 | int tls13_client_certificate_verify_send(struct tls13_ctx *ctx); | 269 | int tls13_client_certificate_verify_send(struct tls13_ctx *ctx); |
269 | int tls13_client_certificate_verify_recv(struct tls13_ctx *ctx); | 270 | int tls13_client_certificate_verify_recv(struct tls13_ctx *ctx, CBS *cbs); |
270 | int tls13_client_finished_recv(struct tls13_ctx *ctx); | 271 | int tls13_client_finished_recv(struct tls13_ctx *ctx, CBS *cbs); |
271 | int tls13_client_finished_send(struct tls13_ctx *ctx); | 272 | int tls13_client_finished_send(struct tls13_ctx *ctx); |
272 | int tls13_client_finished_sent(struct tls13_ctx *ctx); | 273 | int tls13_client_finished_sent(struct tls13_ctx *ctx); |
273 | int tls13_client_key_update_send(struct tls13_ctx *ctx); | 274 | int tls13_client_key_update_send(struct tls13_ctx *ctx); |
274 | int tls13_client_key_update_recv(struct tls13_ctx *ctx); | 275 | int tls13_client_key_update_recv(struct tls13_ctx *ctx, CBS *cbs); |
275 | int tls13_server_hello_recv(struct tls13_ctx *ctx); | 276 | int tls13_server_hello_recv(struct tls13_ctx *ctx, CBS *cbs); |
276 | int tls13_server_hello_send(struct tls13_ctx *ctx); | 277 | int tls13_server_hello_send(struct tls13_ctx *ctx); |
277 | int tls13_server_hello_retry_recv(struct tls13_ctx *ctx); | 278 | int tls13_server_hello_retry_recv(struct tls13_ctx *ctx, CBS *cbs); |
278 | int tls13_server_hello_retry_send(struct tls13_ctx *ctx); | 279 | int tls13_server_hello_retry_send(struct tls13_ctx *ctx); |
279 | int tls13_server_encrypted_extensions_recv(struct tls13_ctx *ctx); | 280 | int tls13_server_encrypted_extensions_recv(struct tls13_ctx *ctx, CBS *cbs); |
280 | int tls13_server_encrypted_extensions_send(struct tls13_ctx *ctx); | 281 | int tls13_server_encrypted_extensions_send(struct tls13_ctx *ctx); |
281 | int tls13_server_certificate_recv(struct tls13_ctx *ctx); | 282 | int tls13_server_certificate_recv(struct tls13_ctx *ctx, CBS *cbs); |
282 | int tls13_server_certificate_send(struct tls13_ctx *ctx); | 283 | int tls13_server_certificate_send(struct tls13_ctx *ctx); |
283 | int tls13_server_certificate_request_recv(struct tls13_ctx *ctx); | 284 | int tls13_server_certificate_request_recv(struct tls13_ctx *ctx, CBS *cbs); |
284 | int tls13_server_certificate_request_send(struct tls13_ctx *ctx); | 285 | int tls13_server_certificate_request_send(struct tls13_ctx *ctx); |
285 | int tls13_server_certificate_verify_send(struct tls13_ctx *ctx); | 286 | int tls13_server_certificate_verify_send(struct tls13_ctx *ctx); |
286 | int tls13_server_certificate_verify_recv(struct tls13_ctx *ctx); | 287 | int tls13_server_certificate_verify_recv(struct tls13_ctx *ctx, CBS *cbs); |
287 | int tls13_server_finished_recv(struct tls13_ctx *ctx); | 288 | int tls13_server_finished_recv(struct tls13_ctx *ctx, CBS *cbs); |
288 | int tls13_server_finished_send(struct tls13_ctx *ctx); | 289 | int tls13_server_finished_send(struct tls13_ctx *ctx); |
289 | 290 | ||
290 | void tls13_error_clear(struct tls13_error *error); | 291 | void tls13_error_clear(struct tls13_error *error); |