summaryrefslogtreecommitdiff
path: root/ssl
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-04-18 19:30:55 +0100
committerHugo Landau <hlandau@openssl.org>2023-05-12 14:47:12 +0100
commit723cbe8a73fe3644bb4d8f20d475e57f44955b54 (patch)
treeac9407bf6e13d8165a592cedddacea494dc162bc /ssl
parentb89c81e43b88c48d7cb5ce48665bab6c36ae02ac (diff)
downloadopenssl-new-723cbe8a73fe3644bb4d8f20d475e57f44955b54.tar.gz
QUIC CHANNEL: Do not copy terminate cause as it is not modified after termination
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20765)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/quic/quic_channel.c5
-rw-r--r--ssl/quic/quic_tserver.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c
index c689166805..da2436b3c6 100644
--- a/ssl/quic/quic_channel.c
+++ b/ssl/quic/quic_channel.c
@@ -445,9 +445,10 @@ int ossl_quic_channel_is_term_any(const QUIC_CHANNEL *ch)
|| ossl_quic_channel_is_terminated(ch);
}
-QUIC_TERMINATE_CAUSE ossl_quic_channel_get_terminate_cause(const QUIC_CHANNEL *ch)
+const QUIC_TERMINATE_CAUSE *
+ossl_quic_channel_get_terminate_cause(const QUIC_CHANNEL *ch)
{
- return ch->terminate_cause;
+ return ossl_quic_channel_is_term_any(ch) ? &ch->terminate_cause : NULL;
}
int ossl_quic_channel_is_handshake_complete(const QUIC_CHANNEL *ch)
diff --git a/ssl/quic/quic_tserver.c b/ssl/quic/quic_tserver.c
index 12f4516608..17b70eb3a5 100644
--- a/ssl/quic/quic_tserver.c
+++ b/ssl/quic/quic_tserver.c
@@ -169,7 +169,8 @@ int ossl_quic_tserver_is_term_any(const QUIC_TSERVER *srv)
return ossl_quic_channel_is_term_any(srv->ch);
}
-QUIC_TERMINATE_CAUSE ossl_quic_tserver_get_terminate_cause(const QUIC_TSERVER *srv)
+const QUIC_TERMINATE_CAUSE *
+ossl_quic_tserver_get_terminate_cause(const QUIC_TSERVER *srv)
{
return ossl_quic_channel_get_terminate_cause(srv->ch);
}