From 18cc64311c3a934715ac1f0133c3821b198e2a62 Mon Sep 17 00:00:00 2001 From: Christopher Wellons Date: Sun, 26 Mar 2017 12:24:05 -0400 Subject: [PATCH] Simplify fingerprint command output. --- src/enchive.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/enchive.c b/src/enchive.c index fa7cf02..0f44e35 100644 --- a/src/enchive.c +++ b/src/enchive.c @@ -911,7 +911,6 @@ print_fingerprint(const u8 *key) sha256_init(sha); sha256_update(sha, key, 32); sha256_final(sha, hash); - fputs("keyid: ", stdout); for (i = 0; i < 16; i += 4) { unsigned long chunk = ((unsigned long)hash[i + 0] << 24) | @@ -920,7 +919,6 @@ print_fingerprint(const u8 *key) ((unsigned long)hash[i + 3] << 0); printf("%s%08lx", i ? "-" : "", chunk); } - putchar('\n'); } enum command { @@ -1071,7 +1069,9 @@ command_keygen(struct optparse *options) compute_public(public, secret); if (fingerprint) { + fputs("keyid: ", stdout); print_fingerprint(public); + putchar('\n'); } write_seckey(secfile, secret, protect ? key_derive_iterations : 0); @@ -1100,6 +1100,7 @@ command_fingerprint(struct optparse *options) pubfile = default_pubfile(); load_pubkey(pubfile, public); print_fingerprint(public); + putchar('\n'); } static void