summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ssh-keygen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 2a7939bfc..0833ee61d 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1082,6 +1082,7 @@ known_hosts_hash(struct hostkey_foreach_line *l, void *_ctx)
1082 struct known_hosts_ctx *ctx = (struct known_hosts_ctx *)_ctx; 1082 struct known_hosts_ctx *ctx = (struct known_hosts_ctx *)_ctx;
1083 char *hashed, *cp, *hosts, *ohosts; 1083 char *hashed, *cp, *hosts, *ohosts;
1084 int has_wild = l->hosts && strcspn(l->hosts, "*?!") != strlen(l->hosts); 1084 int has_wild = l->hosts && strcspn(l->hosts, "*?!") != strlen(l->hosts);
1085 int was_hashed = l->hosts[0] == HASH_DELIM;
1085 1086
1086 switch (l->status) { 1087 switch (l->status) {
1087 case HKF_STATUS_OK: 1088 case HKF_STATUS_OK:
@@ -1090,8 +1091,7 @@ known_hosts_hash(struct hostkey_foreach_line *l, void *_ctx)
1090 * Don't hash hosts already already hashed, with wildcard 1091 * Don't hash hosts already already hashed, with wildcard
1091 * characters or a CA/revocation marker. 1092 * characters or a CA/revocation marker.
1092 */ 1093 */
1093 if ((l->match & HKF_MATCH_HOST_HASHED) != 0 || 1094 if (was_hashed || has_wild || l->marker != MRK_NONE) {
1094 has_wild || l->marker != MRK_NONE) {
1095 fprintf(ctx->out, "%s\n", l->line); 1095 fprintf(ctx->out, "%s\n", l->line);
1096 if (has_wild && !find_host) { 1096 if (has_wild && !find_host) {
1097 logit("%s:%ld: ignoring host name " 1097 logit("%s:%ld: ignoring host name "