1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-25 01:28:51 -05:00

ssh-libssh: reduce excessive verbose output about pubkey auth

The verbose message "Authentication using SSH public key file" was
printed each time the ssh_userauth_publickey_auto() was called, which
meant each time a packet was transferred over network because the API
operates in non-blocking mode.

This patch makes sure that the verbose message is printed just once
(when the authentication state is entered by the SSH state machine).
This commit is contained in:
Kamil Dudka 2018-08-14 13:14:49 +02:00
parent 9622c350ac
commit 1e843a31a4

View File

@ -618,6 +618,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
sshc->auth_methods = ssh_userauth_list(sshc->ssh_session, NULL); sshc->auth_methods = ssh_userauth_list(sshc->ssh_session, NULL);
if(sshc->auth_methods & SSH_AUTH_METHOD_PUBLICKEY) { if(sshc->auth_methods & SSH_AUTH_METHOD_PUBLICKEY) {
state(conn, SSH_AUTH_PKEY_INIT); state(conn, SSH_AUTH_PKEY_INIT);
infof(data, "Authentication using SSH public key file\n");
} }
else if(sshc->auth_methods & SSH_AUTH_METHOD_GSSAPI_MIC) { else if(sshc->auth_methods & SSH_AUTH_METHOD_GSSAPI_MIC) {
state(conn, SSH_AUTH_GSSAPI); state(conn, SSH_AUTH_GSSAPI);
@ -670,8 +671,6 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
} }
else { else {
infof(data, "Authentication using SSH public key file\n");
rc = ssh_userauth_publickey_auto(sshc->ssh_session, NULL, rc = ssh_userauth_publickey_auto(sshc->ssh_session, NULL,
data->set.ssl.key_passwd); data->set.ssl.key_passwd);
if(rc == SSH_AUTH_AGAIN) { if(rc == SSH_AUTH_AGAIN) {