View | Details | Raw Unified | Return to bug 2250
Collapse All | Expand All

(-)a/channels.c (-5 / +7 lines)
Lines 1145-1151 channel_decode_socks4(Channel *c, fd_set *readset, fd_set *writeset) Link Here
1145
1145
1146
/* try to decode a socks5 header */
1146
/* try to decode a socks5 header */
1147
#define SSH_SOCKS5_AUTHDONE	0x1000
1147
#define SSH_SOCKS5_AUTHDONE	0x1000
1148
#define SSH_SOCKS5_NOAUTH	0x00
1148
#define SSH_SOCKS5_NOAUTH	0x00	/* NO AUTHENTICATION REQUIRED */
1149
#define SSH_SOCKS5_NOMETHOD	0xff	/* NO ACCEPTABLE METHODS */
1149
#define SSH_SOCKS5_IPV4		0x01
1150
#define SSH_SOCKS5_IPV4		0x01
1150
#define SSH_SOCKS5_DOMAIN	0x03
1151
#define SSH_SOCKS5_DOMAIN	0x03
1151
#define SSH_SOCKS5_IPV6		0x04
1152
#define SSH_SOCKS5_IPV6		0x04
Lines 1186-1200 channel_decode_socks5(Channel *c, fd_set *readset, fd_set *writeset) Link Here
1186
				break;
1187
				break;
1187
			}
1188
			}
1188
		}
1189
		}
1190
		buffer_consume(&c->input, nmethods + 2);
1191
		buffer_put_char(&c->output, 0x05);		/* version */
1192
		buffer_put_char(&c->output, found ? SSH_SOCKS5_NOAUTH :
1193
		    SSH_SOCKS5_NOMETHOD);			/* method */
1194
		FD_SET(c->sock, writeset);
1189
		if (!found) {
1195
		if (!found) {
1190
			debug("channel %d: method SSH_SOCKS5_NOAUTH not found",
1196
			debug("channel %d: method SSH_SOCKS5_NOAUTH not found",
1191
			    c->self);
1197
			    c->self);
1192
			return -1;
1198
			return -1;
1193
		}
1199
		}
1194
		buffer_consume(&c->input, nmethods + 2);
1195
		buffer_put_char(&c->output, 0x05);		/* version */
1196
		buffer_put_char(&c->output, SSH_SOCKS5_NOAUTH);	/* method */
1197
		FD_SET(c->sock, writeset);
1198
		c->flags |= SSH_SOCKS5_AUTHDONE;
1200
		c->flags |= SSH_SOCKS5_AUTHDONE;
1199
		debug2("channel %d: socks5 auth done", c->self);
1201
		debug2("channel %d: socks5 auth done", c->self);
1200
		return 0;				/* need more */
1202
		return 0;				/* need more */

Return to bug 2250