From 61a9c69b72dc5ade60fc95ded845bda52ea9b48b Mon Sep 17 00:00:00 2001 From: jsing Date: Thu, 22 Feb 2018 17:30:25 +0000 Subject: [PATCH] Provide SSL_is_server(). --- lib/libssl/Symbols.list | 1 + lib/libssl/ssl.h | 3 ++- lib/libssl/ssl_lib.c | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/libssl/Symbols.list b/lib/libssl/Symbols.list index ad32b98677d..eb00c8d25ad 100644 --- a/lib/libssl/Symbols.list +++ b/lib/libssl/Symbols.list @@ -213,6 +213,7 @@ SSL_get_version SSL_get_wbio SSL_get_wfd SSL_has_matching_session_id +SSL_is_server SSL_library_init SSL_load_client_CA_file SSL_load_error_strings diff --git a/lib/libssl/ssl.h b/lib/libssl/ssl.h index 1b92bde9d41..d65e99363d6 100644 --- a/lib/libssl/ssl.h +++ b/lib/libssl/ssl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl.h,v 1.144 2018/02/22 17:29:24 jsing Exp $ */ +/* $OpenBSD: ssl.h,v 1.145 2018/02/22 17:30:25 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1354,6 +1354,7 @@ void SSL_free(SSL *ssl); int SSL_up_ref(SSL *ssl); int SSL_accept(SSL *ssl); int SSL_connect(SSL *ssl); +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); int SSL_write(SSL *ssl, const void *buf, int num); diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c index aa629a28487..80a2bd7bfc3 100644 --- a/lib/libssl/ssl_lib.c +++ b/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.178 2018/02/22 17:29:25 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.179 2018/02/22 17:30:25 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -940,6 +940,12 @@ SSL_connect(SSL *s) return (s->method->internal->ssl_connect(s)); } +int +SSL_is_server(const SSL *s) +{ + return s->server; +} + long SSL_get_default_timeout(const SSL *s) { -- 2.20.1