diff options
-rw-r--r-- | g10/gpg.h | 2 | ||||
-rw-r--r-- | g10/keyid.c | 17 | ||||
-rw-r--r-- | g10/keylist.c | 4 |
3 files changed, 7 insertions, 16 deletions
@@ -50,7 +50,7 @@ /* The maximum length of a formatted fingerprint as returned by * format_hexfingerprint(). */ -#define MAX_FORMATTED_FINGERPRINT_LEN 59 +#define MAX_FORMATTED_FINGERPRINT_LEN 60 /* diff --git a/g10/keyid.c b/g10/keyid.c index 7605cb386..a7a54e07b 100644 --- a/g10/keyid.c +++ b/g10/keyid.c @@ -873,10 +873,10 @@ format_hexfingerprint (const char *fingerprint, char *buffer, size_t buflen) /* The v5 fingerprint is commonly printed truncated to 25 * octets. We accept the truncated as well as the full hex * version here and format it like this: - * B2CCB6 838332 5D61BA C50F9F 5E CD21A8 0AC8C5 2565C8 C52565 + * 19347 BC987 24640 25F99 DF3EC 2E000 0ED98 84892 E1F7B 3EA4C */ hexlen = 50; - space = 8 * 6 + 2 + 8 + 1; + space = 10 * 5 + 9 + 1; } else /* Other fingerprint versions - print as is. */ { @@ -908,18 +908,9 @@ format_hexfingerprint (const char *fingerprint, char *buffer, size_t buflen) } else if (hexlen == 50) /* v5 fingerprint */ { - for (i=j=0; i < 24; i++) + for (i=j=0; i < 50; i++) { - if (i && !(i % 6)) - buffer[j++] = ' '; - buffer[j++] = fingerprint[i]; - } - buffer[j++] = ' '; - buffer[j++] = fingerprint[i++]; - buffer[j++] = fingerprint[i++]; - for (; i < 50; i++) - { - if (!((i-26) % 6)) + if (i && !(i % 5)) buffer[j++] = ' '; buffer[j++] = fingerprint[i]; } diff --git a/g10/keylist.c b/g10/keylist.c index dacc13788..44cbe73bd 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -2059,9 +2059,9 @@ print_fingerprint (ctrl_t ctrl, estream_t override_fp, { if (!i) ; - else if (!(i%8)) + else if (!(i%10)) tty_fprintf (fp, "\n%*s ", (int)strlen(text)+1, ""); - else if (!(i%4)) + else if (!(i%5)) tty_fprintf (fp, " "); else tty_fprintf (fp, " "); |