summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2020-01-22 04:51:52 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2020-01-22 04:51:52 +0000
commit1d6ae345bd24fef9328ee82bae7aca45080213e3 (patch)
tree005dea9a46e8de8a0ba150fd0df1add3e4cfe07c
parent45a6d2ecaa2ae05ea8d8227b5c6ba2cf6ebc5e49 (diff)
For ssh-keygen -lF only add a space after key fingerprint when there is a
comment. This makes copy-paste of fingerprints into ssh easier. OK djm@
-rw-r--r--usr.bin/ssh/ssh-keygen.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c
index c8dde084f71..fbf31f2a95d 100644
--- a/usr.bin/ssh/ssh-keygen.c
+++ b/usr.bin/ssh/ssh-keygen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.384 2020/01/21 11:06:09 djm Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.385 2020/01/22 04:51:51 claudio Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1241,8 +1241,10 @@ known_hosts_find_delete(struct hostkey_foreach_line *l, void *_ctx)
if (fp == NULL || ra == NULL)
fatal("%s: sshkey_fingerprint failed",
__func__);
- mprintf("%s %s %s %s\n", ctx->host,
- sshkey_type(l->key), fp, l->comment);
+ mprintf("%s %s %s%s%s\n", ctx->host,
+ sshkey_type(l->key), fp,
+ l->comment[0] ? " " : "",
+ l->comment);
if (log_level_get() >= SYSLOG_LEVEL_VERBOSE)
printf("%s\n", ra);
free(ra);