diff options
-rw-r--r-- | ssh-agent.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/ssh-agent.c b/ssh-agent.c index d24a63089..e1fd1f3f6 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-agent.c,v 1.263 2020/08/27 01:06:18 djm Exp $ */ | 1 | /* $OpenBSD: ssh-agent.c,v 1.264 2020/09/18 08:16:38 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -852,8 +852,10 @@ send: | |||
852 | } | 852 | } |
853 | #endif /* ENABLE_PKCS11 */ | 853 | #endif /* ENABLE_PKCS11 */ |
854 | 854 | ||
855 | /* dispatch incoming messages */ | 855 | /* |
856 | 856 | * dispatch incoming message. | |
857 | * returns 1 on success, 0 for incomplete messages or -1 on error. | ||
858 | */ | ||
857 | static int | 859 | static int |
858 | process_message(u_int socknum) | 860 | process_message(u_int socknum) |
859 | { | 861 | { |
@@ -907,7 +909,7 @@ process_message(u_int socknum) | |||
907 | /* send a fail message for all other request types */ | 909 | /* send a fail message for all other request types */ |
908 | send_status(e, 0); | 910 | send_status(e, 0); |
909 | } | 911 | } |
910 | return 0; | 912 | return 1; |
911 | } | 913 | } |
912 | 914 | ||
913 | switch (type) { | 915 | switch (type) { |
@@ -951,7 +953,7 @@ process_message(u_int socknum) | |||
951 | send_status(e, 0); | 953 | send_status(e, 0); |
952 | break; | 954 | break; |
953 | } | 955 | } |
954 | return 0; | 956 | return 1; |
955 | } | 957 | } |
956 | 958 | ||
957 | static void | 959 | static void |
@@ -1042,7 +1044,12 @@ handle_conn_read(u_int socknum) | |||
1042 | if ((r = sshbuf_put(sockets[socknum].input, buf, len)) != 0) | 1044 | if ((r = sshbuf_put(sockets[socknum].input, buf, len)) != 0) |
1043 | fatal("%s: buffer error: %s", __func__, ssh_err(r)); | 1045 | fatal("%s: buffer error: %s", __func__, ssh_err(r)); |
1044 | explicit_bzero(buf, sizeof(buf)); | 1046 | explicit_bzero(buf, sizeof(buf)); |
1045 | process_message(socknum); | 1047 | for (;;) { |
1048 | if ((r = process_message(socknum)) == -1) | ||
1049 | return -1; | ||
1050 | else if (r == 0) | ||
1051 | break; | ||
1052 | } | ||
1046 | return 0; | 1053 | return 0; |
1047 | } | 1054 | } |
1048 | 1055 | ||