summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_client.c
diff options
context:
space:
mode:
authortb <>2020-07-03 04:12:51 +0000
committertb <>2020-07-03 04:12:51 +0000
commit19ec1b6acc3e3c1c1156d9578424119a3a98dd63 (patch)
treeccbfc5a18a8593e33c9c504671e7d32e7f8e6c1a /src/lib/libssl/tls13_client.c
parentba5d20ce0e8a0f27f37d05f5e9e4457b8712655d (diff)
downloadopenbsd-19ec1b6acc3e3c1c1156d9578424119a3a98dd63.tar.gz
openbsd-19ec1b6acc3e3c1c1156d9578424119a3a98dd63.tar.bz2
openbsd-19ec1b6acc3e3c1c1156d9578424119a3a98dd63.zip
Improve argument order for the internal tlsext API
Move is_server and msg_type right after the SSL object so that CBS and CBB and alert come last. This brings these functions more in line with other internal functions and separates state from data. requested by jsing
Diffstat (limited to 'src/lib/libssl/tls13_client.c')
-rw-r--r--src/lib/libssl/tls13_client.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libssl/tls13_client.c b/src/lib/libssl/tls13_client.c
index e2f61f6c08..bd72db8be0 100644
--- a/src/lib/libssl/tls13_client.c
+++ b/src/lib/libssl/tls13_client.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_client.c,v 1.65 2020/06/04 18:41:42 tb Exp $ */ 1/* $OpenBSD: tls13_client.c,v 1.66 2020/07/03 04:12:51 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -118,7 +118,7 @@ tls13_client_hello_build(struct tls13_ctx *ctx, CBB *cbb)
118 if (!CBB_add_u8(&compression_methods, 0)) 118 if (!CBB_add_u8(&compression_methods, 0))
119 goto err; 119 goto err;
120 120
121 if (!tlsext_client_build(s, cbb, SSL_TLSEXT_MSG_CH)) 121 if (!tlsext_client_build(s, SSL_TLSEXT_MSG_CH, cbb))
122 goto err; 122 goto err;
123 123
124 if (!CBB_flush(cbb)) 124 if (!CBB_flush(cbb))
@@ -265,7 +265,7 @@ tls13_server_hello_process(struct tls13_ctx *ctx, CBS *cbs)
265 ctx->hs->hrr = 1; 265 ctx->hs->hrr = 1;
266 } 266 }
267 267
268 if (!tlsext_client_parse(s, cbs, &alert_desc, tlsext_msg_type)) { 268 if (!tlsext_client_parse(s, tlsext_msg_type, cbs, &alert_desc)) {
269 ctx->alert = alert_desc; 269 ctx->alert = alert_desc;
270 goto err; 270 goto err;
271 } 271 }
@@ -504,7 +504,7 @@ tls13_server_encrypted_extensions_recv(struct tls13_ctx *ctx, CBS *cbs)
504{ 504{
505 int alert_desc; 505 int alert_desc;
506 506
507 if (!tlsext_client_parse(ctx->ssl, cbs, &alert_desc, SSL_TLSEXT_MSG_EE)) { 507 if (!tlsext_client_parse(ctx->ssl, SSL_TLSEXT_MSG_EE, cbs, &alert_desc)) {
508 ctx->alert = alert_desc; 508 ctx->alert = alert_desc;
509 goto err; 509 goto err;
510 } 510 }
@@ -540,7 +540,7 @@ tls13_server_certificate_request_recv(struct tls13_ctx *ctx, CBS *cbs)
540 if (CBS_len(&cert_request_context) != 0) 540 if (CBS_len(&cert_request_context) != 0)
541 goto err; 541 goto err;
542 542
543 if (!tlsext_client_parse(ctx->ssl, cbs, &alert_desc, SSL_TLSEXT_MSG_CR)) { 543 if (!tlsext_client_parse(ctx->ssl, SSL_TLSEXT_MSG_CR, cbs, &alert_desc)) {
544 ctx->alert = alert_desc; 544 ctx->alert = alert_desc;
545 goto err; 545 goto err;
546 } 546 }
@@ -580,8 +580,8 @@ tls13_server_certificate_recv(struct tls13_ctx *ctx, CBS *cbs)
580 if (!CBS_get_u24_length_prefixed(&cert_list, &cert_data)) 580 if (!CBS_get_u24_length_prefixed(&cert_list, &cert_data))
581 goto err; 581 goto err;
582 582
583 if (!tlsext_client_parse(ctx->ssl, &cert_list, &alert_desc, 583 if (!tlsext_client_parse(ctx->ssl, SSL_TLSEXT_MSG_CT,
584 SSL_TLSEXT_MSG_CT)) { 584 &cert_list, &alert_desc)) {
585 ctx->alert = alert_desc; 585 ctx->alert = alert_desc;
586 goto err; 586 goto err;
587 } 587 }