diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2006-09-30 13:29:51 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2006-09-30 13:29:51 +0000 |
commit | 761efaa70c2ed8d35722b7bc234a46bf2457f876 (patch) | |
tree | bba6f2fe7855d7b0095f9dc7720dc27bea4d1fdf /crypto/openssh/msg.c | |
parent | 30c2033ae748d441213eed2e5c3fae760cc8ea61 (diff) | |
download | src-761efaa70c2ed8d35722b7bc234a46bf2457f876.tar.gz src-761efaa70c2ed8d35722b7bc234a46bf2457f876.zip |
Vendor import of OpenSSH 4.4p1.
Notes
Notes:
svn path=/vendor-crypto/openssh/dist/; revision=162852
Diffstat (limited to 'crypto/openssh/msg.c')
-rw-r--r-- | crypto/openssh/msg.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/crypto/openssh/msg.c b/crypto/openssh/msg.c index 3e4c2882c5f4..cd5f98c4f6ce 100644 --- a/crypto/openssh/msg.c +++ b/crypto/openssh/msg.c @@ -1,3 +1,4 @@ +/* $OpenBSD: msg.c,v 1.15 2006/08/03 03:34:42 deraadt Exp $ */ /* * Copyright (c) 2002 Markus Friedl. All rights reserved. * @@ -21,14 +22,23 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #include "includes.h" -RCSID("$OpenBSD: msg.c,v 1.8 2005/05/24 17:32:43 avsm Exp $"); + +#include <sys/types.h> +#include <sys/uio.h> + +#include <errno.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <stdarg.h> #include "buffer.h" -#include "getput.h" #include "log.h" #include "atomicio.h" #include "msg.h" +#include "misc.h" int ssh_msg_send(int fd, u_char type, Buffer *m) @@ -38,7 +48,7 @@ ssh_msg_send(int fd, u_char type, Buffer *m) debug3("ssh_msg_send: type %u", (unsigned int)type & 0xff); - PUT_32BIT(buf, mlen + 1); + put_u32(buf, mlen + 1); buf[4] = type; /* 1st byte of payload is mesg-type */ if (atomicio(vwrite, fd, buf, sizeof(buf)) != sizeof(buf)) { error("ssh_msg_send: write"); @@ -64,7 +74,7 @@ ssh_msg_recv(int fd, Buffer *m) error("ssh_msg_recv: read: header"); return (-1); } - msg_len = GET_32BIT(buf); + msg_len = get_u32(buf); if (msg_len > 256 * 1024) { error("ssh_msg_recv: read: bad msg_len %u", msg_len); return (-1); |