File: fix-noremotetcp-behavior.patch

package info (click to toggle)
dropbear 2022.83-1%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,216 kB
  • sloc: ansic: 96,944; sh: 4,508; perl: 774; python: 739; makefile: 694; java: 177
file content (39 lines) | stat: -rw-r--r-- 1,226 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: Justin Chen <justin.chen@broadcom.com>
Date: Fri, 8 Sep 2023 11:35:18 -0700
Subject: src: svr-tcpfwd: Fix noremotetcp behavior

If noremotetcp is set, we should still reply with
send_msg_request_failed. This matches the behavior
of !DROPBEAR_SVR_REMOTETCPFWD.

We were seeing keepalive packets being ignored when
the "-k" option was used.

Origin: https://github.com/mkj/dropbear/commit/3cf8344769eda55e26eee53c1898b2c66544f188
Bug-Debian: https://bugs.debian.org/1069768
---
 svr-tcpfwd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/svr-tcpfwd.c b/svr-tcpfwd.c
index 7967cfa..01a76a2 100644
--- a/svr-tcpfwd.c
+++ b/svr-tcpfwd.c
@@ -79,14 +79,14 @@ void recv_msg_global_request_remotetcp() {
 
 	TRACE(("enter recv_msg_global_request_remotetcp"))
 
+	reqname = buf_getstring(ses.payload, &namelen);
+	wantreply = buf_getbool(ses.payload);
+
 	if (svr_opts.noremotetcp || !svr_pubkey_allows_tcpfwd()) {
 		TRACE(("leave recv_msg_global_request_remotetcp: remote tcp forwarding disabled"))
 		goto out;
 	}
 
-	reqname = buf_getstring(ses.payload, &namelen);
-	wantreply = buf_getbool(ses.payload);
-
 	if (namelen > MAX_NAME_LEN) {
 		TRACE(("name len is wrong: %d", namelen))
 		goto out;