]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
when printing a certificate request also print its signature algorithm
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 20 Sep 2014 23:55:18 +0000 (01:55 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 20 Sep 2014 23:55:18 +0000 (01:55 +0200)
lib/x509/output.c

index d3eca0d6aa84139017e0cd9849b2b05a4577b9a4..87c96f72f9eb2f5a89ec693fb85b0cd69c53b5d0 100644 (file)
@@ -2179,7 +2179,6 @@ print_crq(gnutls_buffer_st * str, gnutls_x509_crq_t cert,
                }
        }
 
-       /* SubjectPublicKeyInfo. */
        {
                int err;
                unsigned int bits;
@@ -2190,6 +2189,18 @@ print_crq(gnutls_buffer_st * str, gnutls_x509_crq_t cert,
                             gnutls_strerror(err));
                else
                        print_crq_pubkey(str, cert, format);
+
+               err = gnutls_x509_crq_get_signature_algorithm(cert);
+               if (err < 0)
+                       addf(str, "error: get_signature_algorithm: %s\n",
+                            gnutls_strerror(err));
+               else {
+                       const char *name =
+                           gnutls_sign_algorithm_get_name(err);
+                       if (name == NULL)
+                               name = _("unknown");
+                       addf(str, _("\tSignature Algorithm: %s\n"), name);
+               }
        }
 
        /* parse attributes */