From 1724862da277d62e9335ade34ebf5ebcf274666e Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sun, 17 Jul 2022 15:49:20 +0000 Subject: Pass SSL pointer to tls13_ctx_new(). struct tls13_ctx already knows about SSL's and this way tls13_ctx_new() can set up various pointers, rather than duplicating this in tls13_legacy_accept() and tls13_legacy_connect(). ok tb@ --- src/lib/libssl/tls13_lib.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lib/libssl/tls13_lib.c') diff --git a/src/lib/libssl/tls13_lib.c b/src/lib/libssl/tls13_lib.c index 20d3a38412..8b8ea7f01b 100644 --- a/src/lib/libssl/tls13_lib.c +++ b/src/lib/libssl/tls13_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_lib.c,v 1.63 2022/02/05 14:54:10 jsing Exp $ */ +/* $OpenBSD: tls13_lib.c,v 1.64 2022/07/17 15:49:20 jsing Exp $ */ /* * Copyright (c) 2018, 2019 Joel Sing * Copyright (c) 2019 Bob Beck @@ -382,14 +382,16 @@ static const struct tls13_record_layer_callbacks rl_callbacks = { }; struct tls13_ctx * -tls13_ctx_new(int mode) +tls13_ctx_new(int mode, SSL *ssl) { struct tls13_ctx *ctx = NULL; if ((ctx = calloc(sizeof(struct tls13_ctx), 1)) == NULL) goto err; + ctx->hs = &ssl->s3->hs; ctx->mode = mode; + ctx->ssl = ssl; if ((ctx->rl = tls13_record_layer_new(&rl_callbacks, ctx)) == NULL) goto err; @@ -401,6 +403,8 @@ tls13_ctx_new(int mode) ctx->middlebox_compat = 1; + ssl->internal->tls13 = ctx; + return ctx; err: -- cgit v1.2.3-55-g6feb