From 725b0f1e133495acc35378bd6304ec1d401a761c Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Tue, 20 Jun 2017 14:24:39 +0100 Subject: [PATCH] Make the input parameters for SSL_SESSION_set1_master_key const Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/3670) --- doc/man3/SSL_get_client_random.pod | 2 +- include/openssl/ssl.h | 4 ++-- ssl/ssl_lib.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/man3/SSL_get_client_random.pod b/doc/man3/SSL_get_client_random.pod index d6918f8dbe..83a1027bca 100644 --- a/doc/man3/SSL_get_client_random.pod +++ b/doc/man3/SSL_get_client_random.pod @@ -16,7 +16,7 @@ SSL_SESSION_set1_master_key size_t SSL_get_server_random(const SSL *ssl, unsigned char *out, size_t outlen); size_t SSL_SESSION_get_master_key(const SSL_SESSION *session, unsigned char *out, size_t outlen); - int SSL_SESSION_set1_master_key(SSL_SESSION *sess, unsigned char *in, + int SSL_SESSION_set1_master_key(SSL_SESSION *sess, const unsigned char *in, size_t len); =head1 DESCRIPTION diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index c0d3904a49..75fb1fcc7f 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -1865,8 +1865,8 @@ __owur size_t SSL_get_server_random(const SSL *ssl, unsigned char *out, size_t outlen); __owur size_t SSL_SESSION_get_master_key(const SSL_SESSION *ssl, unsigned char *out, size_t outlen); -__owur int SSL_SESSION_set1_master_key(SSL_SESSION *sess, unsigned char *in, - size_t len); +__owur int SSL_SESSION_set1_master_key(SSL_SESSION *sess, + const unsigned char *in, size_t len); #define SSL_get_ex_new_index(l, p, newf, dupf, freef) \ CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL, l, p, newf, dupf, freef) diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index db14e22350..f9c7b4451b 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -3725,7 +3725,7 @@ 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, +int SSL_SESSION_set1_master_key(SSL_SESSION *sess, const unsigned char *in, size_t len) { if (len > sizeof(sess->master_key)) -- GitLab