summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-04-18 19:30:54 +0100
committerHugo Landau <hlandau@openssl.org>2023-05-12 14:47:11 +0100
commite1dee2e37971e068d6aff25dbfc92ef4db5adbd9 (patch)
treee17fffcc4083baa2e1cd097d3206daaae65d0a21
parent020d0389396d0ee01041188a3d1b211a1d6b6c6a (diff)
downloadopenssl-new-e1dee2e37971e068d6aff25dbfc92ef4db5adbd9.tar.gz
QUIC DISPATCH/APL: Implement SSL_is_connection
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20765)
-rw-r--r--include/openssl/ssl.h.in1
-rw-r--r--ssl/ssl_lib.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/include/openssl/ssl.h.in b/include/openssl/ssl.h.in
index 869a74ae85..1c94f053fd 100644
--- a/include/openssl/ssl.h.in
+++ b/include/openssl/ssl.h.in
@@ -2267,6 +2267,7 @@ __owur int SSL_set_blocking_mode(SSL *s, int blocking);
__owur int SSL_get_blocking_mode(SSL *s);
__owur int SSL_set_initial_peer_addr(SSL *s, const BIO_ADDR *peer_addr);
__owur SSL *SSL_get0_connection(SSL *s);
+__owur int SSL_is_connection(SSL *s);
#define SSL_STREAM_FLAG_UNI (1U << 0)
__owur SSL *SSL_new_stream(SSL *s, uint64_t flags);
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 31905a23d4..29d16107ae 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -7323,6 +7323,11 @@ SSL *SSL_get0_connection(SSL *s)
#endif
}
+int SSL_is_connection(SSL *s)
+{
+ return SSL_get0_connection(s) == s;
+}
+
int SSL_add_expected_rpk(SSL *s, EVP_PKEY *rpk)
{
unsigned char *data = NULL;