From: Hugo Landau Date: Tue, 18 Apr 2023 18:30:54 +0000 (+0100) Subject: QUIC DISPATCH/APL: Implement SSL_is_connection X-Git-Tag: openssl-3.2.0-alpha1~864 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e1dee2e37971e068d6aff25dbfc92ef4db5adbd9;p=thirdparty%2Fopenssl.git QUIC DISPATCH/APL: Implement SSL_is_connection Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/20765) --- diff --git a/include/openssl/ssl.h.in b/include/openssl/ssl.h.in index 869a74ae850..1c94f053fd4 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 31905a23d42..29d16107aec 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;