summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-06-22 17:09:54 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-06-22 17:09:54 +0200
commit2c78f749a01795b2d789e29b6ab5699af78753dd (patch)
treedf06c9f0d1999e659ab47dfe64ef12b6eed37431
parent9e906cb27f801b92cf15b13d0529f29fc41bfd94 (diff)
downloadgnutls-2c78f749a01795b2d789e29b6ab5699af78753dd.tar.gz
x509: print serial number in compact output
-rw-r--r--lib/x509/output.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/x509/output.c b/lib/x509/output.c
index eeeb6e999b..09b119b1ff 100644
--- a/lib/x509/output.c
+++ b/lib/x509/output.c
@@ -1830,6 +1830,19 @@ static void print_oneline(gnutls_buffer_st * str, gnutls_x509_crt_t cert)
}
}
+ {
+ char serial[128];
+ size_t serial_size = sizeof(serial);
+
+ err =
+ gnutls_x509_crt_get_serial(cert, serial, &serial_size);
+ if (err >= 0) {
+ adds(str, "serial 0x");
+ _gnutls_buffer_hexprint(str, serial, serial_size);
+ adds(str, ", ");
+ }
+ }
+
/* Key algorithm and size. */
{
unsigned int bits;