From bcb15b6a03bc19d4fe146ce1d46e5554233232e9 Mon Sep 17 00:00:00 2001 From: tb <> Date: Thu, 7 Jan 2021 16:26:31 +0000 Subject: Rename two local variables ssl to s for consistency In our tls13_* files, we use SSL *s for local variables and SSL *ssl for function arguments. This is odd, but probably the result of finger memory. We intended to use ssl everywhere. Be that as it may, all local variables except in two functions ended up being called s, so align the two outliers with that. As noted by jsing, this is not ideal either as in tls13_legacy_servername_process() the ssl_ctx is now inconsistent. Renaming all s to ssl is a substantial amount of unnecessary churn at a moment that isn't ideal, so we have to live with that. ok bcook inoguchi jsing --- src/lib/libssl/tls13_legacy.c | 8 ++++---- src/lib/libssl/tls13_server.c | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libssl/tls13_legacy.c b/src/lib/libssl/tls13_legacy.c index 8aa806aa45..bacd11b950 100644 --- a/src/lib/libssl/tls13_legacy.c +++ b/src/lib/libssl/tls13_legacy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_legacy.c,v 1.20 2021/01/04 19:19:12 tb Exp $ */ +/* $OpenBSD: tls13_legacy.c,v 1.21 2021/01/07 16:26:31 tb Exp $ */ /* * Copyright (c) 2018, 2019 Joel Sing * @@ -515,14 +515,14 @@ tls13_legacy_servername_process(struct tls13_ctx *ctx, uint8_t *alert) int legacy_alert = SSL_AD_UNRECOGNIZED_NAME; int ret = SSL_TLSEXT_ERR_NOACK; SSL_CTX *ssl_ctx = ctx->ssl->ctx; - SSL *ssl = ctx->ssl; + SSL *s = ctx->ssl; if (ssl_ctx->internal->tlsext_servername_callback == NULL) - ssl_ctx = ssl->initial_ctx; + ssl_ctx = s->initial_ctx; if (ssl_ctx->internal->tlsext_servername_callback == NULL) return 1; - ret = ssl_ctx->internal->tlsext_servername_callback(ssl, &legacy_alert, + ret = ssl_ctx->internal->tlsext_servername_callback(s, &legacy_alert, ssl_ctx->internal->tlsext_servername_arg); if (ret == SSL_TLSEXT_ERR_ALERT_FATAL || diff --git a/src/lib/libssl/tls13_server.c b/src/lib/libssl/tls13_server.c index f929e132a8..2062d4956c 100644 --- a/src/lib/libssl/tls13_server.c +++ b/src/lib/libssl/tls13_server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_server.c,v 1.67 2021/01/06 20:15:35 tb Exp $ */ +/* $OpenBSD: tls13_server.c,v 1.68 2021/01/07 16:26:31 tb Exp $ */ /* * Copyright (c) 2019, 2020 Joel Sing * Copyright (c) 2020 Bob Beck @@ -99,7 +99,7 @@ tls13_client_hello_is_legacy(CBS *cbs) int tls13_client_hello_required_extensions(struct tls13_ctx *ctx) { - SSL *ssl = ctx->ssl; + SSL *s = ctx->ssl; /* * RFC 8446, section 9.2. If the ClientHello has supported_versions @@ -111,10 +111,10 @@ tls13_client_hello_required_extensions(struct tls13_ctx *ctx) * If we got no pre_shared_key, then signature_algorithms and * supported_groups must both be present. */ - if (!tlsext_extension_seen(ssl, TLSEXT_TYPE_pre_shared_key)) { - if (!tlsext_extension_seen(ssl, TLSEXT_TYPE_signature_algorithms)) + if (!tlsext_extension_seen(s, TLSEXT_TYPE_pre_shared_key)) { + if (!tlsext_extension_seen(s, TLSEXT_TYPE_signature_algorithms)) return 0; - if (!tlsext_extension_seen(ssl, TLSEXT_TYPE_supported_groups)) + if (!tlsext_extension_seen(s, TLSEXT_TYPE_supported_groups)) return 0; } @@ -122,8 +122,8 @@ tls13_client_hello_required_extensions(struct tls13_ctx *ctx) * supported_groups and key_share must either both be present or * both be absent. */ - if (tlsext_extension_seen(ssl, TLSEXT_TYPE_supported_groups) != - tlsext_extension_seen(ssl, TLSEXT_TYPE_key_share)) + if (tlsext_extension_seen(s, TLSEXT_TYPE_supported_groups) != + tlsext_extension_seen(s, TLSEXT_TYPE_key_share)) return 0; /* -- cgit v1.2.3-55-g6feb