mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 02:38:09 +09:00
keyfiles: Fix build errors with callbacks.
Introduced with the last commit.
This commit is contained in:
@@ -610,9 +610,9 @@ static int pem_get_password(char *buf, int size, int rwflag, void *userdata) {
|
|||||||
ssh_log(session, SSH_LOG_RARE,
|
ssh_log(session, SSH_LOG_RARE,
|
||||||
"Trying to call external authentication function");
|
"Trying to call external authentication function");
|
||||||
|
|
||||||
if (session && session->callbacks && session->callbacks->auth_function) {
|
if (session && session->common.callbacks && session->common.callbacks->auth_function) {
|
||||||
if (session->callbacks->auth_function("Passphrase for private key:", buf, size, 0, 0,
|
if (session->common.callbacks->auth_function("Passphrase for private key:", buf, size, 0, 0,
|
||||||
session->callbacks->userdata) < 0) {
|
session->common.callbacks->userdata) < 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -738,7 +738,7 @@ ssh_private_key privatekey_from_file(ssh_session session, const char *filename,
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
ssh_set_error(session, SSH_FATAL, "Parsing private key %s", filename);
|
ssh_set_error(session, SSH_FATAL, "Parsing private key %s", filename);
|
||||||
#elif defined HAVE_LIBCRYPTO
|
#elif defined HAVE_LIBCRYPTO
|
||||||
if (session->callbacks && session->callbacks->auth_function) {
|
if (session->common.callbacks && session->common.callbacks->auth_function) {
|
||||||
dsa = PEM_read_bio_DSAPrivateKey(bio, NULL, pem_get_password, session);
|
dsa = PEM_read_bio_DSAPrivateKey(bio, NULL, pem_get_password, session);
|
||||||
} else { /* authcb */
|
} else { /* authcb */
|
||||||
/* openssl uses its own callback to get the passphrase here */
|
/* openssl uses its own callback to get the passphrase here */
|
||||||
@@ -779,7 +779,7 @@ ssh_private_key privatekey_from_file(ssh_session session, const char *filename,
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
ssh_set_error(session,SSH_FATAL, "Parsing private key %s", filename);
|
ssh_set_error(session,SSH_FATAL, "Parsing private key %s", filename);
|
||||||
#elif defined HAVE_LIBCRYPTO
|
#elif defined HAVE_LIBCRYPTO
|
||||||
if (session->callbacks && session->callbacks->auth_function) {
|
if (session->common.callbacks && session->common.callbacks->auth_function) {
|
||||||
rsa = PEM_read_bio_RSAPrivateKey(bio, NULL, pem_get_password, session);
|
rsa = PEM_read_bio_RSAPrivateKey(bio, NULL, pem_get_password, session);
|
||||||
} else { /* authcb */
|
} else { /* authcb */
|
||||||
/* openssl uses its own callback to get the passphrase here */
|
/* openssl uses its own callback to get the passphrase here */
|
||||||
|
|||||||
Reference in New Issue
Block a user