diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-02-17 11:49:48 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-02-17 17:26:38 +0100 |
commit | 8373241529f030f310fa1c122eb09a213b4bacac (patch) | |
tree | 3c93dd3d0153b5ae0e06efc79a44301c2a46833a | |
parent | 35c681a1695c265cfb82b8dfd77e6994102e18a1 (diff) | |
download | gnutls-8373241529f030f310fa1c122eb09a213b4bacac.tar.gz |
x509/output: properly indicate error in Time fields
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | lib/x509/output.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/x509/output.c b/lib/x509/output.c index 194c7bfafe..08f58c9ce1 100644 --- a/lib/x509/output.c +++ b/lib/x509/output.c @@ -1440,7 +1440,7 @@ print_cert(gnutls_buffer_st * str, gnutls_x509_crt_t cert, adds(str, _("\tValidity:\n")); tim = gnutls_x509_crt_get_activation_time(cert); - { + if (tim != -1) { char s[42]; size_t max = sizeof(s); struct tm t; @@ -1455,10 +1455,12 @@ print_cert(gnutls_buffer_st * str, gnutls_x509_crt_t cert, (unsigned long) tim); else addf(str, _("\t\tNot Before: %s\n"), s); + } else { + addf(str, _("\t\tNot Before: %s\n"), _("unknown")); } tim = gnutls_x509_crt_get_expiration_time(cert); - { + if (tim != -1) { char s[42]; size_t max = sizeof(s); struct tm t; @@ -1473,6 +1475,8 @@ print_cert(gnutls_buffer_st * str, gnutls_x509_crt_t cert, (unsigned long) tim); else addf(str, _("\t\tNot After: %s\n"), s); + } else { + addf(str, _("\t\tNot After: %s\n"), _("unknown")); } } |