From c946b51766d8d82a2eea8f8c205ca78a649ba27e Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Mon, 20 May 2019 13:43:57 +0000 Subject: [PATCH] Display profile, MS template and requested issuer if available Include more optional fields in the getcert list output. https://pagure.io/certmonger/issue/117 Signed-off-by: Rob Crittenden --- src/getcert.c | 18 ++++++++++++++++++ tests/028-dbus/expected.out | 1 + 2 files changed, 19 insertions(+) diff --git a/src/getcert.c b/src/getcert.c index ddb28de203ba98d1d6e58630c658e14c9b3bbde3..ecadad9be712b41e34b2f0a8a9b0d692bd92d40c 100644 --- a/src/getcert.c +++ b/src/getcert.c @@ -3882,6 +3882,24 @@ list(const char *argv0, int argc, const char **argv) printf("\t\t%s\n", as[j]); } } + s1 = query_prop_s(bus, requests[i], CM_DBUS_REQUEST_INTERFACE, + CM_DBUS_PROP_TEMPLATE_PROFILE, + verbose, globals.tctx); + if (s1 != NULL && strlen(s1) > 0) { + printf(_("\tprofile: %s\n"), s1); + } + s1 = query_prop_s(bus, requests[i], CM_DBUS_REQUEST_INTERFACE, + CM_DBUS_PROP_TEMPLATE_MS_CERTIFICATE_TEMPLATE, + verbose, globals.tctx); + if (s1 != NULL && strlen(s1) > 0) { + printf(_("\tms v2 template: %s\n"), s1); + } + s1 = query_prop_s(bus, requests[i], CM_DBUS_REQUEST_INTERFACE, + CM_DBUS_PROP_TEMPLATE_ISSUER, + verbose, globals.tctx); + if (s1 != NULL && strlen(s1) > 0) { + printf(_("\tissuer handle: %s\n"), s1); + } printf(_("\tpre-save command: %s\n"), query_prop_s(bus, requests[i], CM_DBUS_REQUEST_INTERFACE, CM_DBUS_PROP_CERT_PRESAVE_COMMAND, verbose, globals.tctx)); diff --git a/tests/028-dbus/expected.out b/tests/028-dbus/expected.out index ca3179e6c232b54bb7fdf83b4bc84a90fafa87e4..805e123c40a8800df171329e1badece0d7eb24d5 100644 --- a/tests/028-dbus/expected.out +++ b/tests/028-dbus/expected.out @@ -17,6 +17,7 @@ Request ID 'Buddy': key usage: digitalSignature,dataEncipherment eku: id-kp-serverAuth certificate template/profile: SomeProfileName + profile: SomeProfileName pre-save command: echo Pre post-save command: echo Post track: yes -- 2.20.1