summaryrefslogtreecommitdiff
path: root/serverloop.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2010-01-01 23:53:30 +0000
committerColin Watson <cjwatson@debian.org>2010-01-01 23:53:30 +0000
commitdf03186a4f9e0c2ece398b5c0571cb6263d7a752 (patch)
tree1aab079441dff9615274769b19f2d734ddf508dd /serverloop.c
parent6ad6994c288662fca6949f42bf91fec2aff00bca (diff)
parent99b402ea4c8457b0a3cafff37f5b3410a8dc6476 (diff)
* New upstream release (closes: #536182). Yes, I know 5.3p1 has been out
for a while, but there's no GSSAPI patch available for it yet. - Change the default cipher order to prefer the AES CTR modes and the revised "arcfour256" mode to CBC mode ciphers that are susceptible to CPNI-957037 "Plaintext Recovery Attack Against SSH". - Add countermeasures to mitigate CPNI-957037-style attacks against the SSH protocol's use of CBC-mode ciphers. Upon detection of an invalid packet length or Message Authentication Code, ssh/sshd will continue reading up to the maximum supported packet length rather than immediately terminating the connection. This eliminates most of the known differences in behaviour that leaked information about the plaintext of injected data which formed the basis of this attack (closes: #506115, LP: #379329). - ForceCommand directive now accepts commandline arguments for the internal-sftp server (closes: #524423, LP: #362511). - Add AllowAgentForwarding to available Match keywords list (closes: #540623). - Make ssh(1) send the correct channel number for SSH2_MSG_CHANNEL_SUCCESS and SSH2_MSG_CHANNEL_FAILURE messages to avoid triggering 'Non-public channel' error messages on sshd(8) in openssh-5.1. - Avoid printing 'Non-public channel' warnings in sshd(8), since the ssh(1) has sent incorrect channel numbers since ~2004 (this reverts a behaviour introduced in openssh-5.1; closes: #496017). * Update to GSSAPI patch from http://www.sxw.org.uk/computing/patches/openssh-5.2p1-gsskex-all-20090726.patch, including cascading credentials support (LP: #416958).
Diffstat (limited to 'serverloop.c')
-rw-r--r--serverloop.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/serverloop.c b/serverloop.c
index 6a3e2af10..f6419b592 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: serverloop.c,v 1.153 2008/06/30 12:15:39 djm Exp $ */ 1/* $OpenBSD: serverloop.c,v 1.157 2009/02/12 03:16:01 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
@@ -942,7 +942,7 @@ server_request_direct_tcpip(void)
942{ 942{
943 Channel *c; 943 Channel *c;
944 char *target, *originator; 944 char *target, *originator;
945 int target_port, originator_port; 945 u_short target_port, originator_port;
946 946
947 target = packet_get_string(NULL); 947 target = packet_get_string(NULL);
948 target_port = packet_get_int(); 948 target_port = packet_get_int();
@@ -1095,7 +1095,7 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt)
1095{ 1095{
1096 char *rtype; 1096 char *rtype;
1097 int want_reply; 1097 int want_reply;
1098 int success = 0; 1098 int success = 0, allocated_listen_port = 0;
1099 1099
1100 rtype = packet_get_string(NULL); 1100 rtype = packet_get_string(NULL);
1101 want_reply = packet_get_char(); 1101 want_reply = packet_get_char();
@@ -1117,7 +1117,8 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt)
1117 1117
1118 /* check permissions */ 1118 /* check permissions */
1119 if (!options.allow_tcp_forwarding || 1119 if (!options.allow_tcp_forwarding ||
1120 no_port_forwarding_flag 1120 no_port_forwarding_flag ||
1121 (!want_reply && listen_port == 0)
1121#ifndef NO_IPPORT_RESERVED_CONCEPT 1122#ifndef NO_IPPORT_RESERVED_CONCEPT
1122 || (listen_port < IPPORT_RESERVED && pw->pw_uid != 0) 1123 || (listen_port < IPPORT_RESERVED && pw->pw_uid != 0)
1123#endif 1124#endif
@@ -1127,7 +1128,8 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt)
1127 } else { 1128 } else {
1128 /* Start listening on the port */ 1129 /* Start listening on the port */
1129 success = channel_setup_remote_fwd_listener( 1130 success = channel_setup_remote_fwd_listener(
1130 listen_address, listen_port, options.gateway_ports); 1131 listen_address, listen_port,
1132 &allocated_listen_port, options.gateway_ports);
1131 } 1133 }
1132 xfree(listen_address); 1134 xfree(listen_address);
1133 } else if (strcmp(rtype, "cancel-tcpip-forward") == 0) { 1135 } else if (strcmp(rtype, "cancel-tcpip-forward") == 0) {
@@ -1149,6 +1151,8 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt)
1149 if (want_reply) { 1151 if (want_reply) {
1150 packet_start(success ? 1152 packet_start(success ?
1151 SSH2_MSG_REQUEST_SUCCESS : SSH2_MSG_REQUEST_FAILURE); 1153 SSH2_MSG_REQUEST_SUCCESS : SSH2_MSG_REQUEST_FAILURE);
1154 if (success && allocated_listen_port > 0)
1155 packet_put_int(allocated_listen_port);
1152 packet_send(); 1156 packet_send();
1153 packet_write_wait(); 1157 packet_write_wait();
1154 } 1158 }
@@ -1202,9 +1206,9 @@ server_init_dispatch_20(void)
1202 dispatch_set(SSH2_MSG_CHANNEL_REQUEST, &server_input_channel_req); 1206 dispatch_set(SSH2_MSG_CHANNEL_REQUEST, &server_input_channel_req);
1203 dispatch_set(SSH2_MSG_CHANNEL_WINDOW_ADJUST, &channel_input_window_adjust); 1207 dispatch_set(SSH2_MSG_CHANNEL_WINDOW_ADJUST, &channel_input_window_adjust);
1204 dispatch_set(SSH2_MSG_GLOBAL_REQUEST, &server_input_global_request); 1208 dispatch_set(SSH2_MSG_GLOBAL_REQUEST, &server_input_global_request);
1205 dispatch_set(SSH2_MSG_CHANNEL_SUCCESS, &channel_input_status_confirm);
1206 dispatch_set(SSH2_MSG_CHANNEL_FAILURE, &channel_input_status_confirm);
1207 /* client_alive */ 1209 /* client_alive */
1210 dispatch_set(SSH2_MSG_CHANNEL_SUCCESS, &server_input_keep_alive);
1211 dispatch_set(SSH2_MSG_CHANNEL_FAILURE, &server_input_keep_alive);
1208 dispatch_set(SSH2_MSG_REQUEST_SUCCESS, &server_input_keep_alive); 1212 dispatch_set(SSH2_MSG_REQUEST_SUCCESS, &server_input_keep_alive);
1209 dispatch_set(SSH2_MSG_REQUEST_FAILURE, &server_input_keep_alive); 1213 dispatch_set(SSH2_MSG_REQUEST_FAILURE, &server_input_keep_alive);
1210 /* rekeying */ 1214 /* rekeying */