From 2c78f749a01795b2d789e29b6ab5699af78753dd Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Wed, 22 Jun 2016 17:09:54 +0200 Subject: x509: print serial number in compact output --- lib/x509/output.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; -- cgit v1.2.1