From 8d598fe3c8c2f44e9aec0b9df6bf07dca0e66316 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 7 Jun 2018 14:39:06 +0200 Subject: [PATCH] enumerate chain elements in dump output Signed-off-by: Daniel Golle This work was sponsored by WIO (wiowireless.com) --- ucert.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ucert.c b/ucert.c index f4a4b84..4beb499 100644 --- a/ucert.c +++ b/ucert.c @@ -353,14 +353,18 @@ static void cert_dump_blob(struct blob_attr *cert[CERT_ATTR_MAX]) { static int cert_dump(const char *certfile) { struct cert_object *cobj; static LIST_HEAD(certchain); + unsigned int count = 0; if (cert_load(certfile, &certchain)) { fprintf(stderr, "cannot parse cert\n"); return 1; } - list_for_each_entry(cobj, &certchain, list) + list_for_each_entry(cobj, &certchain, list) { + fprintf(stderr, "=== CHAIN ELEMENT %02u ===\n", ++count); cert_dump_blob(cobj->cert); + fprintf(stderr, "========================\n"); + } return 0; } -- 2.25.1