From: Pauli Date: Tue, 7 Mar 2017 05:36:16 +0000 (+1000) Subject: Use the callbacks from the SSL object instead of the SSL_CTX object X-Git-Tag: OpenSSL_1_0_2l~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5247c0388610bfdcc8f44b777d75ab681120753d;p=openssl Use the callbacks from the SSL object instead of the SSL_CTX object ... in functions dealing with the SSL object rather than the context. Reviewed-by: Rich Salz Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/2870) (cherry picked from commit d61461a7525322d188f9c6e3f90cfc93916cc636) --- diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c index af03d45c2e..fbb85cb21f 100644 --- a/ssl/ssl_rsa.c +++ b/ssl/ssl_rsa.c @@ -102,8 +102,8 @@ int SSL_use_certificate_file(SSL *ssl, const char *file, int type) x = d2i_X509_bio(in, NULL); } else if (type == SSL_FILETYPE_PEM) { j = ERR_R_PEM_LIB; - x = PEM_read_bio_X509(in, NULL, ssl->ctx->default_passwd_callback, - ssl->ctx->default_passwd_callback_userdata); + x = PEM_read_bio_X509(in, NULL, ssl->default_passwd_callback, + ssl->default_passwd_callback_userdata); } else { SSLerr(SSL_F_SSL_USE_CERTIFICATE_FILE, SSL_R_BAD_SSL_FILETYPE); goto end; @@ -261,9 +261,8 @@ int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type) } else if (type == SSL_FILETYPE_PEM) { j = ERR_R_PEM_LIB; rsa = PEM_read_bio_RSAPrivateKey(in, NULL, - ssl->ctx->default_passwd_callback, - ssl-> - ctx->default_passwd_callback_userdata); + ssl->default_passwd_callback, + ssl->default_passwd_callback_userdata); } else { SSLerr(SSL_F_SSL_USE_RSAPRIVATEKEY_FILE, SSL_R_BAD_SSL_FILETYPE); goto end; @@ -335,9 +334,8 @@ int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type) if (type == SSL_FILETYPE_PEM) { j = ERR_R_PEM_LIB; pkey = PEM_read_bio_PrivateKey(in, NULL, - ssl->ctx->default_passwd_callback, - ssl-> - ctx->default_passwd_callback_userdata); + ssl->default_passwd_callback, + ssl->default_passwd_callback_userdata); } else if (type == SSL_FILETYPE_ASN1) { j = ERR_R_ASN1_LIB; pkey = d2i_PrivateKey_bio(in, NULL);