]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls-cli: allow printing the certificates in OCSP responses when --print-cert is...
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 14 Nov 2014 09:53:31 +0000 (10:53 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 14 Nov 2014 09:53:31 +0000 (10:53 +0100)
src/cli.c

index 5222ad123baf73feb96e7838d44f6c9cbaa3b81d..dc6d99542af87a100d0f27fbade8d2d43df2e754 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1055,6 +1055,7 @@ print_other_info(gnutls_session_t session)
        if (ENABLED_OPT(VERBOSE) && oresp.data) {
                gnutls_ocsp_resp_t r;
                gnutls_datum_t p;
+               unsigned flag;
 
                ret = gnutls_ocsp_resp_init(&r);
                if (ret < 0) {
@@ -1070,9 +1071,12 @@ print_other_info(gnutls_session_t session)
                        return;
                }
 
+               if (print_cert != 0)
+                       flag = GNUTLS_OCSP_PRINT_FULL;
+               else
+                       flag = GNUTLS_OCSP_PRINT_COMPACT;
                ret =
-                   gnutls_ocsp_resp_print(r, GNUTLS_OCSP_PRINT_COMPACT,
-                                          &p);
+                   gnutls_ocsp_resp_print(r, flag, &p);
                gnutls_ocsp_resp_deinit(r);
                fputs((char*)p.data, stdout);
        }