From 2622410ed251447b1fabb360b33d023a95414339 Mon Sep 17 00:00:00 2001 From: jca <> Date: Thu, 15 Mar 2018 12:27:01 +0000 Subject: Provide SSL_CTX_get_min_proto_version and SSL_CTX_get_max_proto_version We already provided the setters, so also provide the getters like OpenSSL does. Addition prompted by the use of those functions in recent openvpn releases. manpage diff from schwarze@ (thanks!) with input from jsing@, ok tb@ jsing@ --- src/lib/libssl/ssl_lib.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/lib/libssl/ssl_lib.c') diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 80a2bd7bfc..067f0edde4 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.179 2018/02/22 17:30:25 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.180 2018/03/15 12:27:01 jca Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -3023,6 +3023,12 @@ SSL_cache_hit(SSL *s) return (s->internal->hit); } +int +SSL_CTX_get_min_proto_version(SSL_CTX *ctx) +{ + return ctx->internal->min_version; +} + int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version) { @@ -3030,6 +3036,12 @@ SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version) ctx->internal->max_version, &ctx->internal->min_version); } +int +SSL_CTX_get_max_proto_version(SSL_CTX *ctx) +{ + return ctx->internal->max_version; +} + int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version) { @@ -3037,12 +3049,23 @@ SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version) ctx->internal->min_version, &ctx->internal->max_version); } +int +SSL_get_min_proto_version(SSL *ssl) +{ + return ssl->internal->min_version; +} + int SSL_set_min_proto_version(SSL *ssl, uint16_t version) { return ssl_version_set_min(ssl->method, version, ssl->internal->max_version, &ssl->internal->min_version); } +int +SSL_get_max_proto_version(SSL *ssl) +{ + return ssl->internal->max_version; +} int SSL_set_max_proto_version(SSL *ssl, uint16_t version) -- cgit v1.2.3-55-g6feb