]> andersk Git - gssapi-openssh.git/blobdiff - openssh/sshconnect2.c
Import of OpenSSH 5.1p1
[gssapi-openssh.git] / openssh / sshconnect2.c
index 208df078cde3ac5c5e35d439748e300083ad5b36..389bec9e43b47dcf9eb9e12f4ff3a692e3941fe1 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.164 2007/05/17 23:53:41 jolan Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.166 2008/07/17 08:48:00 djm Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -38,6 +38,9 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
+#if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H)
+#include <vis.h>
+#endif
 
 #include "openbsd-compat/sys-queue.h"
 
@@ -130,7 +133,7 @@ ssh_kex2(char *host, struct sockaddr *hostaddr)
                    options.hostkeyalgorithms;
 
        if (options.rekey_limit)
-               packet_set_rekey_limit(options.rekey_limit);
+               packet_set_rekey_limit((u_int32_t)options.rekey_limit);
 
        /* start key exchange */
        kex = kex_setup(myproposal);
@@ -374,14 +377,21 @@ input_userauth_error(int type, u_int32_t seq, void *ctxt)
 void
 input_userauth_banner(int type, u_int32_t seq, void *ctxt)
 {
-       char *msg, *lang;
+       char *msg, *raw, *lang;
+       u_int len;
 
        debug3("input_userauth_banner");
-       msg = packet_get_string(NULL);
+       raw = packet_get_string(&len);
        lang = packet_get_string(NULL);
-       if (options.log_level >= SYSLOG_LEVEL_INFO)
+       if (options.log_level >= SYSLOG_LEVEL_INFO) {
+               if (len > 65536)
+                       len = 65536;
+               msg = xmalloc(len * 4); /* max expansion from strnvis() */
+               strnvis(msg, raw, len * 4, VIS_SAFE|VIS_OCTAL);
                fprintf(stderr, "%s", msg);
-       xfree(msg);
+               xfree(msg);
+       }
+       xfree(raw);
        xfree(lang);
 }
 
This page took 0.050444 seconds and 4 git commands to generate.