From: Matt Caswell Date: Mon, 12 Jun 2017 18:12:04 +0000 (+0100) Subject: Add SSL_SESSION_set_cipher() X-Git-Tag: OpenSSL_1_1_1-pre1~1245 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=1a993d1d56835fdf981988367b4bbc3078101d28 Add SSL_SESSION_set_cipher() Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/3670) --- diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index bf01f60cd3..13dd59c833 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -1508,6 +1508,7 @@ __owur long SSL_SESSION_set_timeout(SSL_SESSION *s, long t); __owur int SSL_SESSION_get_protocol_version(const SSL_SESSION *s); __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); __owur int SSL_SESSION_has_ticket(const SSL_SESSION *s); __owur unsigned long SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s); void SSL_SESSION_get0_ticket(const SSL_SESSION *s, const unsigned char **tick, diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index c7bbc96e4c..2b3d2f770a 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -863,6 +863,12 @@ const SSL_CIPHER *SSL_SESSION_get0_cipher(const SSL_SESSION *s) return s->cipher; } +int SSL_SESSION_set_cipher(SSL_SESSION *s, const SSL_CIPHER *cipher) +{ + s->cipher = cipher; + return 1; +} + const char *SSL_SESSION_get0_hostname(const SSL_SESSION *s) { return s->ext.hostname; diff --git a/util/libssl.num b/util/libssl.num index 25e0750e1a..db5de71995 100644 --- a/util/libssl.num +++ b/util/libssl.num @@ -457,3 +457,4 @@ SSL_CTX_set_psk_use_session_callback 457 1_1_1 EXIST::FUNCTION: 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: