summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2020-10-14 16:49:58 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2020-10-14 16:49:58 +0000
commit22c810907181b48a0bb83fac4985add623c277bd (patch)
treeb66463a4c57003046ace89d9ea63824b39cdcbf8
parent3e6e73e63bccb45841c318b8d4ae37e5ca5f30ea (diff)
Provide SSL_is_dtls().
For now this is #ifdef LIBRESSL_INTERNAL and will be exposed during the next library bump. ok tb@
-rw-r--r--lib/libssl/ssl.h5
-rw-r--r--lib/libssl/ssl_lib.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/libssl/ssl.h b/lib/libssl/ssl.h
index 88039c08d62..a6ac6a1825b 100644
--- a/lib/libssl/ssl.h
+++ b/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/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index b306137c142..399af7c769d 100644
--- a/lib/libssl/ssl_lib.c
+++ b/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.
*
@@ -939,6 +939,12 @@ SSL_connect(SSL *s)
}
int
+SSL_is_dtls(const SSL *s)
+{
+ return s->method->internal->dtls;
+}
+
+int
SSL_is_server(const SSL *s)
{
return s->server;