From af51a74ade8bbab5ed49a3560dcb70d89896dc29 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Thu, 14 Sep 2017 09:28:39 +0200 Subject: Provide getters for min/max proto version OpenSSL 1.1.0 made SSL_CTX and SSL structs opaque and introduced a new API to set the minimum and maximum protocol version for SSL_CTX with TLS_method(). Add getters to introspect the configured versions: int SSL_CTX_get_min_proto_version(SSL_CTX *ctx); int SSL_CTX_get_max_proto_version(SSL_CTX *ctx); int SSL_get_min_proto_version(SSL *ssl); int SSL_get_max_proto_version(SSL *ssl); NOTE: The getters do not resolv the version in case when the minimum or maxium version are configured as '0' (meaning auto-select lowest and highst version number). Signed-off-by: Christian Heimes Reviewed-by: Rich Salz Reviewed-by: Ben Kaduk (cherry picked from commit 3edabd3ccb7aac89af5a63cfb2378e33a8be05d7) Updated for new manual page location and TLS 1.3. (Merged from https://github.com/openssl/openssl/pull/4376) --- doc/ssl/SSL_CTX_set_min_proto_version.pod | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/ssl/SSL_CTX_set_min_proto_version.pod b/doc/ssl/SSL_CTX_set_min_proto_version.pod index 3e9fe80b70..ff080e48f9 100644 --- a/doc/ssl/SSL_CTX_set_min_proto_version.pod +++ b/doc/ssl/SSL_CTX_set_min_proto_version.pod @@ -3,7 +3,9 @@ =head1 NAME SSL_CTX_set_min_proto_version, SSL_CTX_set_max_proto_version, -SSL_set_min_proto_version, SSL_set_max_proto_version - Set minimum +SSL_CTX_get_min_proto_version, SSL_CTX_get_max_proto_version, +SSL_set_min_proto_version, SSL_set_max_proto_version, +SSL_get_min_proto_version, SSL_get_max_proto_version - Get and set minimum and maximum supported protocol version =head1 SYNOPSIS @@ -12,12 +14,17 @@ and maximum supported protocol version int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, int version); int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, int version); + int SSL_CTX_get_min_proto_version(SSL_CTX *ctx); + int SSL_CTX_get_max_proto_version(SSL_CTX *ctx); + int SSL_set_min_proto_version(SSL *ssl, int version); int SSL_set_max_proto_version(SSL *ssl, int version); + int SSL_get_min_proto_version(SSL *ssl); + int SSL_get_max_proto_version(SSL *ssl); =head1 DESCRIPTION -The functions set the minimum and maximum supported protocol versions +The functions get or set the minimum and maximum supported protocol versions for the B or B. This works in combination with the options set via L that also make it possible to disable @@ -28,13 +35,18 @@ Setting the minimum or maximum version to 0, will enable protocol versions down to the lowest version, or up to the highest version supported by the library, respectively. +Getters return 0 in case B or B have been configured to +automatically use the lowest or highest version supported by the library. + Currently supported versions are B, B, B, B for TLS and B, B for DTLS. =head1 RETURN VALUES -These functions return 1 on success and 0 on failure. +These setter functions return 1 on success and 0 on failure. The getter +functions return the configured version or 0 for auto-configuration of +lowest or highest protocol, respectively. =head1 NOTES @@ -42,7 +54,8 @@ All these functions are implemented using macros. =head1 HISTORY -The functions were added in OpenSSL 1.1.0 +The setter functions were added in OpenSSL 1.1.0. The getter functions +were added in OpenSSL 1.1.1. =head1 SEE ALSO -- cgit v1.2.3