diff options
| author | jsing <> | 2022-07-17 15:49:20 +0000 |
|---|---|---|
| committer | jsing <> | 2022-07-17 15:49:20 +0000 |
| commit | aa01620723c4a62e50c3f8ec40f18389e2240ca8 (patch) | |
| tree | 799ce4082b0a88dbd46501888f2190cfcc8e2109 /src/lib/libssl/tls13_legacy.c | |
| parent | 051cc88e1fc78696049654a4cba5a6e33648121a (diff) | |
| download | openbsd-aa01620723c4a62e50c3f8ec40f18389e2240ca8.tar.gz openbsd-aa01620723c4a62e50c3f8ec40f18389e2240ca8.tar.bz2 openbsd-aa01620723c4a62e50c3f8ec40f18389e2240ca8.zip | |
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@
Diffstat (limited to 'src/lib/libssl/tls13_legacy.c')
| -rw-r--r-- | src/lib/libssl/tls13_legacy.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/lib/libssl/tls13_legacy.c b/src/lib/libssl/tls13_legacy.c index 27e030fa77..545f2cd978 100644 --- a/src/lib/libssl/tls13_legacy.c +++ b/src/lib/libssl/tls13_legacy.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls13_legacy.c,v 1.37 2022/02/06 16:08:14 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_legacy.c,v 1.38 2022/07/17 15:49:20 jsing 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 | * |
| @@ -414,14 +414,10 @@ tls13_legacy_accept(SSL *ssl) | |||
| 414 | int ret; | 414 | int ret; |
| 415 | 415 | ||
| 416 | if (ctx == NULL) { | 416 | if (ctx == NULL) { |
| 417 | if ((ctx = tls13_ctx_new(TLS13_HS_SERVER)) == NULL) { | 417 | if ((ctx = tls13_ctx_new(TLS13_HS_SERVER, ssl)) == NULL) { |
| 418 | SSLerror(ssl, ERR_R_INTERNAL_ERROR); /* XXX */ | 418 | SSLerror(ssl, ERR_R_INTERNAL_ERROR); /* XXX */ |
| 419 | return -1; | 419 | return -1; |
| 420 | } | 420 | } |
| 421 | ssl->internal->tls13 = ctx; | ||
| 422 | ctx->ssl = ssl; | ||
| 423 | ctx->hs = &ssl->s3->hs; | ||
| 424 | |||
| 425 | if (!tls13_server_init(ctx)) { | 421 | if (!tls13_server_init(ctx)) { |
| 426 | if (ERR_peek_error() == 0) | 422 | if (ERR_peek_error() == 0) |
| 427 | SSLerror(ssl, ERR_R_INTERNAL_ERROR); /* XXX */ | 423 | SSLerror(ssl, ERR_R_INTERNAL_ERROR); /* XXX */ |
| @@ -450,14 +446,10 @@ tls13_legacy_connect(SSL *ssl) | |||
| 450 | int ret; | 446 | int ret; |
| 451 | 447 | ||
| 452 | if (ctx == NULL) { | 448 | if (ctx == NULL) { |
| 453 | if ((ctx = tls13_ctx_new(TLS13_HS_CLIENT)) == NULL) { | 449 | if ((ctx = tls13_ctx_new(TLS13_HS_CLIENT, ssl)) == NULL) { |
| 454 | SSLerror(ssl, ERR_R_INTERNAL_ERROR); /* XXX */ | 450 | SSLerror(ssl, ERR_R_INTERNAL_ERROR); /* XXX */ |
| 455 | return -1; | 451 | return -1; |
| 456 | } | 452 | } |
| 457 | ssl->internal->tls13 = ctx; | ||
| 458 | ctx->ssl = ssl; | ||
| 459 | ctx->hs = &ssl->s3->hs; | ||
| 460 | |||
| 461 | if (!tls13_client_init(ctx)) { | 453 | if (!tls13_client_init(ctx)) { |
| 462 | if (ERR_peek_error() == 0) | 454 | if (ERR_peek_error() == 0) |
| 463 | SSLerror(ssl, ERR_R_INTERNAL_ERROR); /* XXX */ | 455 | SSLerror(ssl, ERR_R_INTERNAL_ERROR); /* XXX */ |
