diff options
author | jca <> | 2018-03-15 12:27:01 +0000 |
---|---|---|
committer | jca <> | 2018-03-15 12:27:01 +0000 |
commit | 2622410ed251447b1fabb360b33d023a95414339 (patch) | |
tree | e59ff43ff5a8063f6f2c91ce72b8d8fd4f30e897 /src/lib/libssl/ssl_lib.c | |
parent | 465530f1caa501bb0fc3b1adcc54d810ee97b096 (diff) | |
download | openbsd-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.c | 25 |
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 | ||
3026 | int | 3026 | int |
3027 | SSL_CTX_get_min_proto_version(SSL_CTX *ctx) | ||
3028 | { | ||
3029 | return ctx->internal->min_version; | ||
3030 | } | ||
3031 | |||
3032 | int | ||
3027 | SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version) | 3033 | SSL_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 | ||
3033 | int | 3039 | int |
3040 | SSL_CTX_get_max_proto_version(SSL_CTX *ctx) | ||
3041 | { | ||
3042 | return ctx->internal->max_version; | ||
3043 | } | ||
3044 | |||
3045 | int | ||
3034 | SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version) | 3046 | SSL_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 | ||
3040 | int | 3052 | int |
3053 | SSL_get_min_proto_version(SSL *ssl) | ||
3054 | { | ||
3055 | return ssl->internal->min_version; | ||
3056 | } | ||
3057 | |||
3058 | int | ||
3041 | SSL_set_min_proto_version(SSL *ssl, uint16_t version) | 3059 | SSL_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 | } |
3064 | int | ||
3065 | SSL_get_max_proto_version(SSL *ssl) | ||
3066 | { | ||
3067 | return ssl->internal->max_version; | ||
3068 | } | ||
3046 | 3069 | ||
3047 | int | 3070 | int |
3048 | SSL_set_max_proto_version(SSL *ssl, uint16_t version) | 3071 | SSL_set_max_proto_version(SSL *ssl, uint16_t version) |