summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libssl/tls13_lib.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/libssl/tls13_lib.c b/src/lib/libssl/tls13_lib.c
index 41cb70d818..9d5889ff1e 100644
--- a/src/lib/libssl/tls13_lib.c
+++ b/src/lib/libssl/tls13_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_lib.c,v 1.47 2020/05/21 19:15:54 tb Exp $ */ 1/* $OpenBSD: tls13_lib.c,v 1.48 2020/05/21 19:27:22 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 * Copyright (c) 2019 Bob Beck <beck@openbsd.org> 4 * Copyright (c) 2019 Bob Beck <beck@openbsd.org>
@@ -259,6 +259,8 @@ static ssize_t
259tls13_key_update_recv(struct tls13_ctx *ctx, CBS *cbs) 259tls13_key_update_recv(struct tls13_ctx *ctx, CBS *cbs)
260{ 260{
261 struct tls13_handshake_msg *hs_msg = NULL; 261 struct tls13_handshake_msg *hs_msg = NULL;
262 CBB cbb_hs;
263 CBS cbs_hs;
262 uint8_t alert = TLS13_ALERT_INTERNAL_ERROR; 264 uint8_t alert = TLS13_ALERT_INTERNAL_ERROR;
263 uint8_t key_update_request; 265 uint8_t key_update_request;
264 ssize_t ret; 266 ssize_t ret;
@@ -280,22 +282,19 @@ tls13_key_update_recv(struct tls13_ctx *ctx, CBS *cbs)
280 goto err; 282 goto err;
281 283
282 if (key_update_request == 1) { 284 if (key_update_request == 1) {
283 CBB cbb;
284 CBS cbs; /* XXX */
285
286 if ((hs_msg = tls13_handshake_msg_new()) == NULL) 285 if ((hs_msg = tls13_handshake_msg_new()) == NULL)
287 goto err; 286 goto err;
288 if (!tls13_handshake_msg_start(hs_msg, &cbb, 287 if (!tls13_handshake_msg_start(hs_msg, &cbb_hs,
289 TLS13_MT_KEY_UPDATE)) 288 TLS13_MT_KEY_UPDATE))
290 goto err; 289 goto err;
291 if (!CBB_add_u8(&cbb, 0)) 290 if (!CBB_add_u8(&cbb_hs, 0))
292 goto err; 291 goto err;
293 if (!tls13_handshake_msg_finish(hs_msg)) 292 if (!tls13_handshake_msg_finish(hs_msg))
294 goto err; 293 goto err;
295 294
296 ctx->key_update_request = 1; 295 ctx->key_update_request = 1;
297 tls13_handshake_msg_data(hs_msg, &cbs); 296 tls13_handshake_msg_data(hs_msg, &cbs_hs);
298 ret = tls13_record_layer_phh(ctx->rl, &cbs); 297 ret = tls13_record_layer_phh(ctx->rl, &cbs_hs);
299 298
300 tls13_handshake_msg_free(hs_msg); 299 tls13_handshake_msg_free(hs_msg);
301 hs_msg = NULL; 300 hs_msg = NULL;