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 a28b06502..f7d34bf02 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); |
@@ -425,14 +428,21 @@ input_userauth_error(int type, u_int32_t seq, void *ctxt) | |||
425 | void | 428 | void |
426 | input_userauth_banner(int type, u_int32_t seq, void *ctxt) | 429 | input_userauth_banner(int type, u_int32_t seq, void *ctxt) |
427 | { | 430 | { |
428 | char *msg, *lang; | 431 | char *msg, *raw, *lang; |
432 | u_int len; | ||
429 | 433 | ||
430 | debug3("input_userauth_banner"); | 434 | debug3("input_userauth_banner"); |
431 | msg = packet_get_string(NULL); | 435 | raw = packet_get_string(&len); |
432 | lang = packet_get_string(NULL); | 436 | lang = packet_get_string(NULL); |
433 | if (options.log_level >= SYSLOG_LEVEL_INFO) | 437 | if (options.log_level >= SYSLOG_LEVEL_INFO) { |
438 | if (len > 65536) | ||
439 | len = 65536; | ||
440 | msg = xmalloc(len * 4); /* max expansion from strnvis() */ | ||
441 | strnvis(msg, raw, len * 4, VIS_SAFE|VIS_OCTAL); | ||
434 | fprintf(stderr, "%s", msg); | 442 | fprintf(stderr, "%s", msg); |
435 | xfree(msg); | 443 | xfree(msg); |
444 | } | ||
445 | xfree(raw); | ||
436 | xfree(lang); | 446 | xfree(lang); |
437 | } | 447 | } |
438 | 448 | ||