summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authorjca <>2018-03-15 12:27:01 +0000
committerjca <>2018-03-15 12:27:01 +0000
commit2622410ed251447b1fabb360b33d023a95414339 (patch)
treee59ff43ff5a8063f6f2c91ce72b8d8fd4f30e897 /src/lib/libssl/ssl_lib.c
parent465530f1caa501bb0fc3b1adcc54d810ee97b096 (diff)
downloadopenbsd-2622410ed251447b1fabb360b33d023a95414339.tar.gz
openbsd-2622410ed251447b1fabb360b33d023a95414339.tar.bz2
openbsd-2622410ed251447b1fabb360b33d023a95414339.zip
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@
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
-rw-r--r--src/lib/libssl/ssl_lib.c25
1 files changed, 24 insertions, 1 deletions
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 @@
1/* $OpenBSD: ssl_lib.c,v 1.179 2018/02/22 17:30:25 jsing Exp $ */ 1/* $OpenBSD: ssl_lib.c,v 1.180 2018/03/15 12:27:01 jca Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -3024,6 +3024,12 @@ SSL_cache_hit(SSL *s)
3024} 3024}
3025 3025
3026int 3026int
3027SSL_CTX_get_min_proto_version(SSL_CTX *ctx)
3028{
3029 return ctx->internal->min_version;
3030}
3031
3032int
3027SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version) 3033SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version)
3028{ 3034{
3029 return ssl_version_set_min(ctx->method, version, 3035 return ssl_version_set_min(ctx->method, version,
@@ -3031,6 +3037,12 @@ SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version)
3031} 3037}
3032 3038
3033int 3039int
3040SSL_CTX_get_max_proto_version(SSL_CTX *ctx)
3041{
3042 return ctx->internal->max_version;
3043}
3044
3045int
3034SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version) 3046SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version)
3035{ 3047{
3036 return ssl_version_set_max(ctx->method, version, 3048 return ssl_version_set_max(ctx->method, version,
@@ -3038,11 +3050,22 @@ SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version)
3038} 3050}
3039 3051
3040int 3052int
3053SSL_get_min_proto_version(SSL *ssl)
3054{
3055 return ssl->internal->min_version;
3056}
3057
3058int
3041SSL_set_min_proto_version(SSL *ssl, uint16_t version) 3059SSL_set_min_proto_version(SSL *ssl, uint16_t version)
3042{ 3060{
3043 return ssl_version_set_min(ssl->method, version, 3061 return ssl_version_set_min(ssl->method, version,
3044 ssl->internal->max_version, &ssl->internal->min_version); 3062 ssl->internal->max_version, &ssl->internal->min_version);
3045} 3063}
3064int
3065SSL_get_max_proto_version(SSL *ssl)
3066{
3067 return ssl->internal->max_version;
3068}
3046 3069
3047int 3070int
3048SSL_set_max_proto_version(SSL *ssl, uint16_t version) 3071SSL_set_max_proto_version(SSL *ssl, uint16_t version)