From 35c45535ea1812ecc2d2655f068a103e57f3dfb5 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 13 Jun 2008 04:43:15 +1000 Subject: - grunk@cvs.openbsd.org 2008/06/11 22:20:46 [ssh-keygen.c ssh-keygen.1] ssh-keygen would write fingerprints to STDOUT, and random art to STDERR, that is not how it was envisioned. Also correct manpage saying that -v is needed along with -l for it to work. spotted by naddy@ --- ssh-keygen.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ssh-keygen.c') diff --git a/ssh-keygen.c b/ssh-keygen.c index 5d90e7a24..02bd530a0 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keygen.c,v 1.168 2008/06/11 21:38:25 grunk Exp $ */ +/* $OpenBSD: ssh-keygen.c,v 1.169 2008/06/11 22:20:46 grunk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1994 Tatu Ylonen , Espoo, Finland @@ -72,6 +72,8 @@ int change_comment = 0; int quiet = 0; +int log_level = SYSLOG_LEVEL_INFO; + /* Flag indicating that we want to hash a known_hosts file */ int hash_hosts = 0; /* Flag indicating that we want lookup a host in known_hosts file */ @@ -524,7 +526,8 @@ do_fingerprint(struct passwd *pw) fp = key_fingerprint(public, fptype, rep); ra = key_fingerprint(public, fptype, SSH_FP_RANDOMART); printf("%u %s %s\n", key_size(public), fp, comment); - verbose("%s", ra); + if (log_level >= SYSLOG_LEVEL_VERBOSE) + printf("%s\n", ra); key_free(public); xfree(comment); xfree(ra); @@ -588,7 +591,8 @@ do_fingerprint(struct passwd *pw) ra = key_fingerprint(public, fptype, SSH_FP_RANDOMART); printf("%u %s %s\n", key_size(public), fp, comment ? comment : "no comment"); - verbose("%s\n", ra); + if (log_level >= SYSLOG_LEVEL_VERBOSE) + printf("%s\n", ra); xfree(ra); xfree(fp); key_free(public); @@ -1078,7 +1082,6 @@ main(int argc, char **argv) int opt, type, fd, download = 0; u_int32_t memory = 0, generator_wanted = 0, trials = 100; int do_gen_candidates = 0, do_screen_candidates = 0; - int log_level = SYSLOG_LEVEL_INFO; BIGNUM *start = NULL; FILE *f; const char *errstr; -- cgit v1.2.3