diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-06-22 17:09:54 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-06-22 17:09:54 +0200 |
commit | 2c78f749a01795b2d789e29b6ab5699af78753dd (patch) | |
tree | df06c9f0d1999e659ab47dfe64ef12b6eed37431 /lib/x509/output.c | |
parent | 9e906cb27f801b92cf15b13d0529f29fc41bfd94 (diff) | |
download | gnutls-2c78f749a01795b2d789e29b6ab5699af78753dd.tar.gz |
x509: print serial number in compact output
Diffstat (limited to 'lib/x509/output.c')
-rw-r--r-- | lib/x509/output.c | 13 |
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; |