From: Daniel Golle Date: Thu, 7 Jun 2018 12:39:06 +0000 (+0200) Subject: enumerate chain elements in dump output X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8d598fe3c8c2f44e9aec0b9df6bf07dca0e66316;p=oweals%2Fucert.git enumerate chain elements in dump output Signed-off-by: Daniel Golle This work was sponsored by WIO (wiowireless.com) --- 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; }