summaryrefslogtreecommitdiff
path: root/usr/src/cmd/ssh/libssh/common/buffer.c
diff options
context:
space:
mode:
authorJan Pechanec <Jan.Pechanec@Sun.COM>2008-09-12 11:17:27 -0700
committerJan Pechanec <Jan.Pechanec@Sun.COM>2008-09-12 11:17:27 -0700
commitcd7d5faf5bbb52336a6f85578a90b31a648ac3fa (patch)
tree9ac1635ecfe13f31666944f18e771bc4e9e58373 /usr/src/cmd/ssh/libssh/common/buffer.c
parente4da943dc881d5566125b30eda2d8e3dd79a8f59 (diff)
downloadillumos-gate-cd7d5faf5bbb52336a6f85578a90b31a648ac3fa.tar.gz
PSARC/2008/520 SunSSH with the OpenSSL PKCS#11 engine support
6445288 ssh needs to be OpenSSL engine aware 6709963 SunSSH server leaks memory during initialization 6687401 ssh monitor shouldn't try to log remote IP when child closed the pipe 6696629 sshd should remove alarm signal handler after authentication 6674088 userland threshold for hw offloading makes it difficult for SSL and SSH protocols 6728450 6708125 prevents parent to use the Crypto Framework after the fork(2) 6742247 ssh debug output with PACKET_DEBUG code could be more readable
Diffstat (limited to 'usr/src/cmd/ssh/libssh/common/buffer.c')
-rw-r--r--usr/src/cmd/ssh/libssh/common/buffer.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/usr/src/cmd/ssh/libssh/common/buffer.c b/usr/src/cmd/ssh/libssh/common/buffer.c
index 45d6860157..2ec761b7ad 100644
--- a/usr/src/cmd/ssh/libssh/common/buffer.c
+++ b/usr/src/cmd/ssh/libssh/common/buffer.c
@@ -10,11 +10,13 @@
* incompatible with the protocol description in the RFC file, it must be
* called by a name other than "ssh" or "Secure Shell".
*/
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
/* $OpenBSD: buffer.c,v 1.31 2006/08/03 03:34:41 deraadt Exp $ */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "includes.h"
#include "xmalloc.h"
@@ -231,7 +233,6 @@ buffer_ptr(Buffer *buffer)
}
/* Dumps the contents of the buffer to stderr. */
-
void
buffer_dump(Buffer *buffer)
{
@@ -241,9 +242,22 @@ buffer_dump(Buffer *buffer)
for (i = buffer->offset; i < buffer->end; i++) {
fprintf(stderr, "%02x", ucp[i]);
if ((i-buffer->offset)%16==15)
- fprintf(stderr, "\r\n");
+ fprintf(stderr, "\n");
else if ((i-buffer->offset)%2==1)
fprintf(stderr, " ");
}
- fprintf(stderr, "\r\n");
+
+ if (buffer->offset == buffer->end) {
+ /* explicitly state when the buffer is empty */
+ fprintf(stderr, "<EMPTY BUFFER>\n");
+ } else {
+ /* print the terminal '\n' if it wasn't already printed */
+ if ((i - buffer->offset) % 16 != 0)
+ fprintf(stderr, "\n");
+ }
+ /*
+ * We want an extra empty line after the packet dump for better
+ * readability.
+ */
+ fprintf(stderr, "\n");
}