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 <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2870)
This commit is contained in:
parent
fb68fba05f
commit
d61461a752
1 changed files with 6 additions and 8 deletions
|
@ -55,8 +55,8 @@ int SSL_use_certificate_file(SSL *ssl, const char *file, int type)
|
||||||
x = d2i_X509_bio(in, NULL);
|
x = d2i_X509_bio(in, NULL);
|
||||||
} else if (type == SSL_FILETYPE_PEM) {
|
} else if (type == SSL_FILETYPE_PEM) {
|
||||||
j = ERR_R_PEM_LIB;
|
j = ERR_R_PEM_LIB;
|
||||||
x = PEM_read_bio_X509(in, NULL, ssl->ctx->default_passwd_callback,
|
x = PEM_read_bio_X509(in, NULL, ssl->default_passwd_callback,
|
||||||
ssl->ctx->default_passwd_callback_userdata);
|
ssl->default_passwd_callback_userdata);
|
||||||
} else {
|
} else {
|
||||||
SSLerr(SSL_F_SSL_USE_CERTIFICATE_FILE, SSL_R_BAD_SSL_FILETYPE);
|
SSLerr(SSL_F_SSL_USE_CERTIFICATE_FILE, SSL_R_BAD_SSL_FILETYPE);
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -187,9 +187,8 @@ int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type)
|
||||||
} else if (type == SSL_FILETYPE_PEM) {
|
} else if (type == SSL_FILETYPE_PEM) {
|
||||||
j = ERR_R_PEM_LIB;
|
j = ERR_R_PEM_LIB;
|
||||||
rsa = PEM_read_bio_RSAPrivateKey(in, NULL,
|
rsa = PEM_read_bio_RSAPrivateKey(in, NULL,
|
||||||
ssl->ctx->default_passwd_callback,
|
ssl->default_passwd_callback,
|
||||||
ssl->
|
ssl->default_passwd_callback_userdata);
|
||||||
ctx->default_passwd_callback_userdata);
|
|
||||||
} else {
|
} else {
|
||||||
SSLerr(SSL_F_SSL_USE_RSAPRIVATEKEY_FILE, SSL_R_BAD_SSL_FILETYPE);
|
SSLerr(SSL_F_SSL_USE_RSAPRIVATEKEY_FILE, SSL_R_BAD_SSL_FILETYPE);
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -254,9 +253,8 @@ int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type)
|
||||||
if (type == SSL_FILETYPE_PEM) {
|
if (type == SSL_FILETYPE_PEM) {
|
||||||
j = ERR_R_PEM_LIB;
|
j = ERR_R_PEM_LIB;
|
||||||
pkey = PEM_read_bio_PrivateKey(in, NULL,
|
pkey = PEM_read_bio_PrivateKey(in, NULL,
|
||||||
ssl->ctx->default_passwd_callback,
|
ssl->default_passwd_callback,
|
||||||
ssl->
|
ssl->default_passwd_callback_userdata);
|
||||||
ctx->default_passwd_callback_userdata);
|
|
||||||
} else if (type == SSL_FILETYPE_ASN1) {
|
} else if (type == SSL_FILETYPE_ASN1) {
|
||||||
j = ERR_R_ASN1_LIB;
|
j = ERR_R_ASN1_LIB;
|
||||||
pkey = d2i_PrivateKey_bio(in, NULL);
|
pkey = d2i_PrivateKey_bio(in, NULL);
|
||||||
|
|
Loading…
Reference in a new issue