diff options
author | Nicolas Viennot <nicolas@viennot.biz> | 2013-11-02 22:31:36 -0400 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2013-11-03 10:52:38 +0100 |
commit | 754152aa2244fef75a8e7ed2d97df5bb2a09546c (patch) | |
tree | 97b2bad9b8cb595b790c55c75abc1999acc31e34 | |
parent | 1ef00045dde9a695e6d82fd30ed49eaebcf22095 (diff) | |
download | libssh-754152aa2244fef75a8e7ed2d97df5bb2a09546c.tar.gz libssh-754152aa2244fef75a8e7ed2d97df5bb2a09546c.tar.xz libssh-754152aa2244fef75a8e7ed2d97df5bb2a09546c.zip |
server: Fix ssh_execute_server_callbacks() client execution
When the public key auth handler is executed and returns SSH_OK,
ssh_execute_server_callbacks() still runs some client callbacks,
which may set rc to SSH_AGAIN, which triggers a default reply on
auth, denying auth.
Signed-off-by: Nicolas Viennot <nicolas@viennot.biz>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r-- | src/messages.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/messages.c b/src/messages.c index c8e0e09..2c99311 100644 --- a/src/messages.c +++ b/src/messages.c @@ -309,10 +309,8 @@ static int ssh_execute_server_callbacks(ssh_session session, ssh_message msg){ if (session->server_callbacks != NULL){ rc = ssh_execute_server_request(session, msg); - } - - /* This one is in fact a client callback... */ - if (session->common.callbacks != NULL) { + } else if (session->common.callbacks != NULL) { + /* This one is in fact a client callback... */ rc = ssh_execute_client_request(session, msg); } |