diff options
author | Kurt Roeckx <kurt@roeckx.be> | 2015-12-06 17:56:41 +0100 |
---|---|---|
committer | Viktor Dukhovni <openssl-users@dukhovni.org> | 2016-01-02 10:47:52 -0500 |
commit | 7946ab33cecce60afcc00afc8fc18f31f9e66bff (patch) | |
tree | fa178fbc42a649e87e201820cc11796dc3c7d6de /ssl/ssl_lib.c | |
parent | 1e0784ff95cd69090e26e2205bfec6305038db56 (diff) |
Add support for minimum and maximum protocol version
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r-- | ssl/ssl_lib.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 7f4bca058b..cfc73de9ca 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -293,6 +293,8 @@ SSL *SSL_new(SSL_CTX *ctx) RECORD_LAYER_init(&s->rlayer, s); s->options = ctx->options; + s->min_proto_version = ctx->min_proto_version; + s->max_proto_version = ctx->max_proto_version; s->mode = ctx->mode; s->max_cert_list = ctx->max_cert_list; s->references = 1; @@ -1198,6 +1200,12 @@ long SSL_ctrl(SSL *s, int cmd, long larg, void *parg) return 1; else return 0; + case SSL_CTRL_SET_MIN_PROTO_VERSION: + s->min_proto_version = larg; + return 1; + case SSL_CTRL_SET_MAX_PROTO_VERSION: + s->max_proto_version = larg; + return 1; default: return (s->method->ssl_ctrl(s, cmd, larg, parg)); } @@ -1314,6 +1322,12 @@ long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) return (ctx->cert->cert_flags |= larg); case SSL_CTRL_CLEAR_CERT_FLAGS: return (ctx->cert->cert_flags &= ~larg); + case SSL_CTRL_SET_MIN_PROTO_VERSION: + ctx->min_proto_version = larg; + return 1; + case SSL_CTRL_SET_MAX_PROTO_VERSION: + ctx->max_proto_version = larg; + return 1; default: return (ctx->method->ssl_ctx_ctrl(ctx, cmd, larg, parg)); } @@ -1794,6 +1808,8 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth) goto err; ret->method = meth; + ret->min_proto_version = 0; + ret->max_proto_version = 0; ret->session_cache_mode = SSL_SESS_CACHE_SERVER; ret->session_cache_size = SSL_SESSION_CACHE_MAX_SIZE_DEFAULT; /* We take the system default. */ |