From d4016589855156b6afe5e9bc8ef85ce43f27e704 Mon Sep 17 00:00:00 2001 From: Dmitry Kasatkin Date: Mon, 6 Oct 2014 17:25:45 +0100 Subject: [PATCH] KEYS: output last portion of fingerprint in /proc/keys Previous version of KEYS used to output last 4 bytes of fingerprint. Now it outputs 8 last bytes of raw subject, which does not make any visual meaning at all. This patch restores old behavior. Signed-off-by: Dmitry Kasatkin Signed-off-by: David Howells --- crypto/asymmetric_keys/asymmetric_type.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crypto/asymmetric_keys/asymmetric_type.c b/crypto/asymmetric_keys/asymmetric_type.c index 052e944..bcbbbd7 100644 --- a/crypto/asymmetric_keys/asymmetric_type.c +++ b/crypto/asymmetric_keys/asymmetric_type.c @@ -233,14 +233,14 @@ static void asymmetric_key_describe(const struct key *key, struct seq_file *m) seq_puts(m, ": "); subtype->describe(key, m); - if (kids && kids->id[0]) { - kid = kids->id[0]; + if (kids && kids->id[1]) { + kid = kids->id[1]; seq_putc(m, ' '); n = kid->len; p = kid->data; - if (n > 8) { - p += n - 8; - n = 8; + if (n > 4) { + p += n - 4; + n = 4; } seq_printf(m, "%*phN", n, p); } -- 2.7.4