summaryrefslogtreecommitdiff
path: root/misc.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 /misc.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 'misc.c')
-rw-r--r--misc.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/misc.c b/misc.c
index 8b303f16f..143dbf0e2 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.c,v 1.69 2008/06/13 01:38:23 dtucker Exp $ */ 1/* $OpenBSD: misc.c,v 1.71 2009/02/21 19:32:04 tobias Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved. 4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved.
@@ -221,23 +221,19 @@ pwcopy(struct passwd *pw)
221 221
222/* 222/*
223 * Convert ASCII string to TCP/IP port number. 223 * Convert ASCII string to TCP/IP port number.
224 * Port must be >0 and <=65535. 224 * Port must be >=0 and <=65535.
225 * Return 0 if invalid. 225 * Return -1 if invalid.
226 */ 226 */
227int 227int
228a2port(const char *s) 228a2port(const char *s)
229{ 229{
230 long port; 230 long long port;
231 char *endp; 231 const char *errstr;
232
233 errno = 0;
234 port = strtol(s, &endp, 0);
235 if (s == endp || *endp != '\0' ||
236 (errno == ERANGE && (port == LONG_MIN || port == LONG_MAX)) ||
237 port <= 0 || port > 65535)
238 return 0;
239 232
240 return port; 233 port = strtonum(s, 0, 65535, &errstr);
234 if (errstr != NULL)
235 return -1;
236 return (int)port;
241} 237}
242 238
243int 239int
@@ -718,7 +714,8 @@ sanitise_stdfd(void)
718 int nullfd, dupfd; 714 int nullfd, dupfd;
719 715
720 if ((nullfd = dupfd = open(_PATH_DEVNULL, O_RDWR)) == -1) { 716 if ((nullfd = dupfd = open(_PATH_DEVNULL, O_RDWR)) == -1) {
721 fprintf(stderr, "Couldn't open /dev/null: %s", strerror(errno)); 717 fprintf(stderr, "Couldn't open /dev/null: %s\n",
718 strerror(errno));
722 exit(1); 719 exit(1);
723 } 720 }
724 while (++dupfd <= 2) { 721 while (++dupfd <= 2) {
@@ -726,7 +723,7 @@ sanitise_stdfd(void)
726 if (fcntl(dupfd, F_GETFL, 0) >= 0) 723 if (fcntl(dupfd, F_GETFL, 0) >= 0)
727 continue; 724 continue;
728 if (dup2(nullfd, dupfd) == -1) { 725 if (dup2(nullfd, dupfd) == -1) {
729 fprintf(stderr, "dup2: %s", strerror(errno)); 726 fprintf(stderr, "dup2: %s\n", strerror(errno));
730 exit(1); 727 exit(1);
731 } 728 }
732 } 729 }