summaryrefslogtreecommitdiff
path: root/bufaux.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2010-03-31 10:46:28 +0100
committerColin Watson <cjwatson@debian.org>2010-03-31 10:46:28 +0100
commitefd3d4522636ae029488c2e9730b60c88e257d2e (patch)
tree31e02ac3f16090ce8c53448677356b2b7f423683 /bufaux.c
parentbbec4db36d464ea1d464a707625125f9fd5c7b5e (diff)
parentd1a87e462e1db89f19cd960588d0c6b287cb5ccc (diff)
* New upstream release (LP: #535029).
- After a transition period of about 10 years, this release disables SSH protocol 1 by default. Clients and servers that need to use the legacy protocol must explicitly enable it in ssh_config / sshd_config or on the command-line. - Remove the libsectok/OpenSC-based smartcard code and add support for PKCS#11 tokens. This support is enabled by default in the Debian packaging, since it now doesn't involve additional library dependencies (closes: #231472, LP: #16918). - Add support for certificate authentication of users and hosts using a new, minimal OpenSSH certificate format (closes: #482806). - Added a 'netcat mode' to ssh(1): "ssh -W host:port ...". - Add the ability to revoke keys in sshd(8) and ssh(1). (For the Debian package, this overlaps with the key blacklisting facility added in openssh 1:4.7p1-9, but with different file formats and slightly different scopes; for the moment, I've roughly merged the two.) - Various multiplexing improvements, including support for requesting port-forwardings via the multiplex protocol (closes: #360151). - Allow setting an explicit umask on the sftp-server(8) commandline to override whatever default the user has (closes: #496843). - Many sftp client improvements, including tab-completion, more options, and recursive transfer support for get/put (LP: #33378). The old mget/mput commands never worked properly and have been removed (closes: #270399, #428082). - Do not prompt for a passphrase if we fail to open a keyfile, and log the reason why the open failed to debug (closes: #431538). - Prevent sftp from crashing when given a "-" without a command. Also, allow whitespace to follow a "-" (closes: #531561).
Diffstat (limited to 'bufaux.c')
-rw-r--r--bufaux.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/bufaux.c b/bufaux.c
index cd9a35ded..4ef19c454 100644
--- a/bufaux.c
+++ b/bufaux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bufaux.c,v 1.46 2008/06/10 23:21:34 dtucker Exp $ */ 1/* $OpenBSD: bufaux.c,v 1.48 2010/02/02 22:49:34 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
@@ -166,7 +166,10 @@ buffer_get_string_ret(Buffer *buffer, u_int *length_ptr)
166 u_int len; 166 u_int len;
167 167
168 /* Get the length. */ 168 /* Get the length. */
169 len = buffer_get_int(buffer); 169 if (buffer_get_int_ret(&len, buffer) != 0) {
170 error("buffer_get_string_ret: cannot extract length");
171 return (NULL);
172 }
170 if (len > 256 * 1024) { 173 if (len > 256 * 1024) {
171 error("buffer_get_string_ret: bad string length %u", len); 174 error("buffer_get_string_ret: bad string length %u", len);
172 return (NULL); 175 return (NULL);
@@ -198,14 +201,17 @@ buffer_get_string(Buffer *buffer, u_int *length_ptr)
198} 201}
199 202
200void * 203void *
201buffer_get_string_ptr(Buffer *buffer, u_int *length_ptr) 204buffer_get_string_ptr_ret(Buffer *buffer, u_int *length_ptr)
202{ 205{
203 void *ptr; 206 void *ptr;
204 u_int len; 207 u_int len;
205 208
206 len = buffer_get_int(buffer); 209 if (buffer_get_int_ret(&len, buffer) != 0)
207 if (len > 256 * 1024) 210 return NULL;
208 fatal("buffer_get_string_ptr: bad string length %u", len); 211 if (len > 256 * 1024) {
212 error("buffer_get_string_ptr: bad string length %u", len);
213 return NULL;
214 }
209 ptr = buffer_ptr(buffer); 215 ptr = buffer_ptr(buffer);
210 buffer_consume(buffer, len); 216 buffer_consume(buffer, len);
211 if (length_ptr) 217 if (length_ptr)
@@ -213,6 +219,16 @@ buffer_get_string_ptr(Buffer *buffer, u_int *length_ptr)
213 return (ptr); 219 return (ptr);
214} 220}
215 221
222void *
223buffer_get_string_ptr(Buffer *buffer, u_int *length_ptr)
224{
225 void *ret;
226
227 if ((ret = buffer_get_string_ptr_ret(buffer, length_ptr)) == NULL)
228 fatal("buffer_get_string_ptr: buffer error");
229 return (ret);
230}
231
216/* 232/*
217 * Stores and arbitrary binary string in the buffer. 233 * Stores and arbitrary binary string in the buffer.
218 */ 234 */