diff options
Diffstat (limited to 'sshconnect2.c')
-rw-r--r-- | sshconnect2.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sshconnect2.c b/sshconnect2.c index 97073e401..18cbbd9f9 100644 --- a/sshconnect2.c +++ b/sshconnect2.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect2.c,v 1.164 2007/05/17 23:53:41 jolan Exp $ */ | 1 | /* $OpenBSD: sshconnect2.c,v 1.166 2008/07/17 08:48:00 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -38,6 +38,9 @@ | |||
38 | #include <stdio.h> | 38 | #include <stdio.h> |
39 | #include <string.h> | 39 | #include <string.h> |
40 | #include <unistd.h> | 40 | #include <unistd.h> |
41 | #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) | ||
42 | #include <vis.h> | ||
43 | #endif | ||
41 | 44 | ||
42 | #include "openbsd-compat/sys-queue.h" | 45 | #include "openbsd-compat/sys-queue.h" |
43 | 46 | ||
@@ -165,7 +168,7 @@ ssh_kex2(char *host, struct sockaddr *hostaddr) | |||
165 | #endif | 168 | #endif |
166 | 169 | ||
167 | if (options.rekey_limit) | 170 | if (options.rekey_limit) |
168 | packet_set_rekey_limit(options.rekey_limit); | 171 | packet_set_rekey_limit((u_int32_t)options.rekey_limit); |
169 | 172 | ||
170 | /* start key exchange */ | 173 | /* start key exchange */ |
171 | kex = kex_setup(myproposal); | 174 | kex = kex_setup(myproposal); |
@@ -429,14 +432,21 @@ input_userauth_error(int type, u_int32_t seq, void *ctxt) | |||
429 | void | 432 | void |
430 | input_userauth_banner(int type, u_int32_t seq, void *ctxt) | 433 | input_userauth_banner(int type, u_int32_t seq, void *ctxt) |
431 | { | 434 | { |
432 | char *msg, *lang; | 435 | char *msg, *raw, *lang; |
436 | u_int len; | ||
433 | 437 | ||
434 | debug3("input_userauth_banner"); | 438 | debug3("input_userauth_banner"); |
435 | msg = packet_get_string(NULL); | 439 | raw = packet_get_string(&len); |
436 | lang = packet_get_string(NULL); | 440 | lang = packet_get_string(NULL); |
437 | if (options.log_level >= SYSLOG_LEVEL_INFO) | 441 | if (options.log_level >= SYSLOG_LEVEL_INFO) { |
442 | if (len > 65536) | ||
443 | len = 65536; | ||
444 | msg = xmalloc(len * 4); /* max expansion from strnvis() */ | ||
445 | strnvis(msg, raw, len * 4, VIS_SAFE|VIS_OCTAL); | ||
438 | fprintf(stderr, "%s", msg); | 446 | fprintf(stderr, "%s", msg); |
439 | xfree(msg); | 447 | xfree(msg); |
448 | } | ||
449 | xfree(raw); | ||
440 | xfree(lang); | 450 | xfree(lang); |
441 | } | 451 | } |
442 | 452 | ||