mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
auth: Fix return status for ssh_userauth_agent()
BUG: https://red.libssh.org/issues/201
Return SSH_AUTH_DENIED instead of SSH_AUTH_ERROR when the provided agent
offers no public keys.
Signed-off-by: Peter Volpe <pvolpe@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit dc9c4d22ab)
This commit is contained in:
committed by
Andreas Schneider
parent
f3620bbbad
commit
83387f957f
@@ -786,6 +786,11 @@ int ssh_userauth_agent(ssh_session session,
|
||||
state = session->agent_state;
|
||||
if (state->pubkey == NULL)
|
||||
state->pubkey = ssh_agent_get_first_ident(session, &state->comment);
|
||||
|
||||
if (state->pubkey == NULL) {
|
||||
return SSH_AUTH_DENIED;
|
||||
}
|
||||
|
||||
while (state->pubkey != NULL) {
|
||||
if(state->state == SSH_AGENT_STATE_NONE){
|
||||
SSH_LOG(SSH_LOG_DEBUG,
|
||||
|
||||
Reference in New Issue
Block a user