mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
phyp: Reorder keyboard_interactive label in openSSHSession()
Finish changes intended to be part of commit
6c70802374
This commit is contained in:
parent
cabc2cc98f
commit
a32c43d6fe
@ -255,11 +255,6 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
|
|||||||
char *pvtkey = NULL;
|
char *pvtkey = NULL;
|
||||||
char *userhome = virGetUserDirectory(NULL, geteuid());
|
char *userhome = virGetUserDirectory(NULL, geteuid());
|
||||||
struct stat pvt_stat, pub_stat;
|
struct stat pvt_stat, pub_stat;
|
||||||
int i;
|
|
||||||
int hasPassphrase = 0;
|
|
||||||
virConnectCredential creds[] = {
|
|
||||||
{VIR_CRED_PASSPHRASE, "password", "Password", NULL, NULL, 0},
|
|
||||||
};
|
|
||||||
|
|
||||||
if (userhome == NULL)
|
if (userhome == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
@ -324,8 +319,10 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Trying authentication by pubkey */
|
/* Trying authentication by pubkey */
|
||||||
if (stat(pvtkey, &pvt_stat) || stat(pubkey, &pub_stat))
|
if (stat(pvtkey, &pvt_stat) || stat(pubkey, &pub_stat)) {
|
||||||
|
rc = LIBSSH2_ERROR_SOCKET_NONE;
|
||||||
goto keyboard_interactive;
|
goto keyboard_interactive;
|
||||||
|
}
|
||||||
|
|
||||||
while ((rc =
|
while ((rc =
|
||||||
libssh2_userauth_publickey_fromfile(session, username,
|
libssh2_userauth_publickey_fromfile(session, username,
|
||||||
@ -334,10 +331,16 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
|
|||||||
NULL)) ==
|
NULL)) ==
|
||||||
LIBSSH2_ERROR_EAGAIN) ;
|
LIBSSH2_ERROR_EAGAIN) ;
|
||||||
|
|
||||||
|
keyboard_interactive:
|
||||||
if (rc == LIBSSH2_ERROR_SOCKET_NONE
|
if (rc == LIBSSH2_ERROR_SOCKET_NONE
|
||||||
|| rc == LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED
|
|| rc == LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED
|
||||||
|| rc == LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED) {
|
|| rc == LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED) {
|
||||||
keyboard_interactive:
|
int i;
|
||||||
|
int hasPassphrase = 0;
|
||||||
|
|
||||||
|
virConnectCredential creds[] = {
|
||||||
|
{VIR_CRED_PASSPHRASE, "password", "Password", NULL, NULL, 0},
|
||||||
|
};
|
||||||
|
|
||||||
if (!auth || !auth->cb) {
|
if (!auth || !auth->cb) {
|
||||||
PHYP_ERROR(conn, VIR_ERR_AUTH_FAILED,
|
PHYP_ERROR(conn, VIR_ERR_AUTH_FAILED,
|
||||||
|
Loading…
Reference in New Issue
Block a user