From a94866305ad306011ef3cb3dade3f2c6c1c5dec0 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 14 Oct 2020 16:49:57 +0000 Subject: Provide SSL_is_dtls(). For now this is #ifdef LIBRESSL_INTERNAL and will be exposed during the next library bump. ok tb@ --- src/lib/libssl/ssl.h | 5 ++++- src/lib/libssl/ssl_lib.c | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libssl/ssl.h b/src/lib/libssl/ssl.h index 88039c08d6..a6ac6a1825 100644 --- a/src/lib/libssl/ssl.h +++ b/src/lib/libssl/ssl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl.h,v 1.178 2020/09/20 09:42:00 tb Exp $ */ +/* $OpenBSD: ssl.h,v 1.179 2020/10/14 16:49:57 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1457,6 +1457,9 @@ void SSL_free(SSL *ssl); int SSL_up_ref(SSL *ssl); int SSL_accept(SSL *ssl); int SSL_connect(SSL *ssl); +#ifdef LIBRESSL_INTERNAL +int SSL_is_dtls(const SSL *s); +#endif int SSL_is_server(const SSL *s); int SSL_read(SSL *ssl, void *buf, int num); int SSL_peek(SSL *ssl, void *buf, int num); diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index b306137c14..399af7c769 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.235 2020/10/11 02:22:27 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.236 2020/10/14 16:49:57 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -938,6 +938,12 @@ SSL_connect(SSL *s) return (s->method->internal->ssl_connect(s)); } +int +SSL_is_dtls(const SSL *s) +{ + return s->method->internal->dtls; +} + int SSL_is_server(const SSL *s) { -- cgit v1.2.3-55-g6feb