diff options
-rw-r--r-- | src/certtool.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/certtool.c b/src/certtool.c index d830216925..c8f81edad8 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -939,7 +939,7 @@ static void print_certificate_info(gnutls_x509_crt crt, FILE * out, { int ret; unsigned int i, indx, j, version; - unsigned int critical, key_usage; + unsigned int critical, key_usage, bits; time_t tim; char serial[40]; size_t serial_size = sizeof(serial), dn_size, size; @@ -1010,13 +1010,15 @@ static void print_certificate_info(gnutls_x509_crt crt, FILE * out, /* Public key algorithm */ fprintf(out, "Subject Public Key Info:\n"); - ret = gnutls_x509_crt_get_pk_algorithm(crt, NULL); + ret = gnutls_x509_crt_get_pk_algorithm(crt, &bits); fprintf(out, "\tPublic Key Algorithm: "); cprint = gnutls_pk_algorithm_get_name(ret); if (cprint == NULL) cprint = UNKNOWN; - fprintf(out, "%s\n", cprint); + fprintf(out, "%s", cprint); + if (bits) fprintf(out, " (%u bits)", bits); + fprintf(out, "\n"); if (version >= 3) |