enumerate chain elements in dump output
[oweals/ucert.git] / ucert.c
diff --git a/ucert.c b/ucert.c
index f4a4b843b1f80e3c7d1604ecc4055f47fe515700..4beb4995e02a94512dd4e973e56e4f96d642e57d 100644 (file)
--- 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;
 }