diff options
author | Matt Caswell <matt@openssl.org> | 2017-06-12 18:38:30 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-06-21 14:45:35 +0100 |
commit | 911d63f2611490590e0527ffcd4c95a67cd13a28 (patch) | |
tree | 231855554136c9007215f9f08918187933ed30cb /ssl/ssl_lib.c | |
parent | df894947c4f04dedb0bded25195bc2fc7b2b6915 (diff) |
Add SSL_SESSION_set1_master_key()
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3670)
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r-- | ssl/ssl_lib.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index bcb012f107..db14e22350 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -3725,6 +3725,19 @@ size_t SSL_SESSION_get_master_key(const SSL_SESSION *session, return outlen; } +int SSL_SESSION_set1_master_key(SSL_SESSION *sess, unsigned char *in, + size_t len) +{ + if (len > sizeof(sess->master_key)) + return 0; + + memcpy(sess->master_key, in, len); + sess->master_key_length = len; + + return 1; +} + + int SSL_set_ex_data(SSL *s, int idx, void *arg) { return (CRYPTO_set_ex_data(&s->ex_data, idx, arg)); |