aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas Viennot <nicolas@viennot.biz>2013-11-02 22:31:36 -0400
committerAndreas Schneider <asn@cryptomilk.org>2013-11-03 10:52:38 +0100
commit754152aa2244fef75a8e7ed2d97df5bb2a09546c (patch)
tree97b2bad9b8cb595b790c55c75abc1999acc31e34 /src
parent1ef00045dde9a695e6d82fd30ed49eaebcf22095 (diff)
downloadlibssh-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>
Diffstat (limited to 'src')
-rw-r--r--src/messages.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/messages.c b/src/messages.c
index c8e0e094..2c99311d 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);
}