From 5a43d5119eca14838759913d7235d450a5c1a2ed Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Mon, 12 Jun 2017 19:40:11 +0100 Subject: [PATCH] Add SSL_SESSION_set_protocol_version() Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/3670) --- include/openssl/ssl.h | 2 ++ ssl/ssl_sess.c | 6 ++++++ util/libssl.num | 1 + 3 files changed, 9 insertions(+) diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 13dd59c833..0f75509827 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -1506,6 +1506,8 @@ __owur long SSL_SESSION_set_time(SSL_SESSION *s, long t); __owur long SSL_SESSION_get_timeout(const SSL_SESSION *s); __owur long SSL_SESSION_set_timeout(SSL_SESSION *s, long t); __owur int SSL_SESSION_get_protocol_version(const SSL_SESSION *s); +__owur int SSL_SESSION_set_protocol_version(SSL_SESSION *s, int version); + __owur const char *SSL_SESSION_get0_hostname(const SSL_SESSION *s); __owur const SSL_CIPHER *SSL_SESSION_get0_cipher(const SSL_SESSION *s); __owur int SSL_SESSION_set_cipher(SSL_SESSION *s, const SSL_CIPHER *cipher); diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 2b3d2f770a..df992bd2f3 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -858,6 +858,12 @@ int SSL_SESSION_get_protocol_version(const SSL_SESSION *s) return s->ssl_version; } +int SSL_SESSION_set_protocol_version(SSL_SESSION *s, int version) +{ + s->ssl_version = version; + return 1; +} + const SSL_CIPHER *SSL_SESSION_get0_cipher(const SSL_SESSION *s) { return s->cipher; diff --git a/util/libssl.num b/util/libssl.num index db5de71995..ae16d13624 100644 --- a/util/libssl.num +++ b/util/libssl.num @@ -458,3 +458,4 @@ SSL_CTX_set_psk_find_session_callback 458 1_1_1 EXIST::FUNCTION: SSL_CIPHER_get_handshake_digest 459 1_1_1 EXIST::FUNCTION: SSL_SESSION_set1_master_key 460 1_1_1 EXIST::FUNCTION: SSL_SESSION_set_cipher 461 1_1_1 EXIST::FUNCTION: +SSL_SESSION_set_protocol_version 462 1_1_1 EXIST::FUNCTION: -- 2.34.1