diff --git a/ssl/ssl_quic.c b/ssl/ssl_quic.c index 4107c9a04802e..1dd29394a486b 100644 --- a/ssl/ssl_quic.c +++ b/ssl/ssl_quic.c @@ -179,8 +179,8 @@ int SSL_set_quic_method(SSL *ssl, const SSL_QUIC_METHOD *quic_method) int quic_set_encryption_secrets(SSL *ssl, OSSL_ENCRYPTION_LEVEL level) { - uint8_t *read_secret = NULL; - uint8_t *write_secret = NULL; + uint8_t *c2s_secret = NULL; + uint8_t *s2c_secret = NULL; size_t len; const EVP_MD *md; static const unsigned char zeros[EVP_MAX_MD_SIZE]; @@ -191,15 +191,15 @@ int quic_set_encryption_secrets(SSL *ssl, OSSL_ENCRYPTION_LEVEL level) /* secrets from the POV of the client */ switch (level) { case ssl_encryption_early_data: - write_secret = ssl->early_secret; + s2c_secret = ssl->early_secret; break; case ssl_encryption_handshake: - read_secret = ssl->client_finished_secret; - write_secret = ssl->server_finished_secret; + c2s_secret = ssl->client_finished_secret; + s2c_secret = ssl->server_finished_secret; break; case ssl_encryption_application: - read_secret = ssl->client_app_traffic_secret; - write_secret = ssl->server_app_traffic_secret; + c2s_secret = ssl->client_app_traffic_secret; + s2c_secret = ssl->server_app_traffic_secret; break; default: return 1; @@ -226,21 +226,21 @@ int quic_set_encryption_secrets(SSL *ssl, OSSL_ENCRYPTION_LEVEL level) } /* In some cases, we want to set the secret only when BOTH are non-zero */ - if (read_secret != NULL && write_secret != NULL - && !memcmp(read_secret, zeros, len) - && !memcmp(write_secret, zeros, len)) + if (c2s_secret != NULL && s2c_secret != NULL + && !memcmp(c2s_secret, zeros, len) + && !memcmp(s2c_secret, zeros, len)) return 1; if (ssl->server) { - if (!ssl->quic_method->set_encryption_secrets(ssl, level, read_secret, - write_secret, len)) { + if (!ssl->quic_method->set_encryption_secrets(ssl, level, c2s_secret, + s2c_secret, len)) { SSLfatal(ssl, SSL_AD_INTERNAL_ERROR, SSL_F_QUIC_SET_ENCRYPTION_SECRETS, ERR_R_INTERNAL_ERROR); return 0; } } else { - if (!ssl->quic_method->set_encryption_secrets(ssl, level, write_secret, - read_secret, len)) { + if (!ssl->quic_method->set_encryption_secrets(ssl, level, s2c_secret, + c2s_secret, len)) { SSLfatal(ssl, SSL_AD_INTERNAL_ERROR, SSL_F_QUIC_SET_ENCRYPTION_SECRETS, ERR_R_INTERNAL_ERROR); return 0;