diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-08-21 11:34:39 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-08-21 11:34:39 +0200 |
commit | e8c8adf4ca622b0601e146b53f077ba3499fc861 (patch) | |
tree | e1aa1cb059acee15074e06f8d69691a1f390d95b /src | |
parent | 858d9449b181cfd146423e41e9719cd5866c80d0 (diff) | |
download | gnutls-e8c8adf4ca622b0601e146b53f077ba3499fc861.tar.gz |
certtool: allow exporting very long CRLs
Diffstat (limited to 'src')
-rw-r--r-- | src/certtool.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/certtool.c b/src/certtool.c index 0ab0d846bc..d94af73ecb 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -1688,8 +1688,8 @@ print_certificate_info(gnutls_x509_crt_t crt, FILE * out, unsigned int all) static void print_crl_info(gnutls_x509_crl_t crl, FILE * out) { gnutls_datum_t data; + gnutls_datum_t cout; int ret; - size_t size; if (outcert_format == GNUTLS_X509_FMT_PEM) { ret = gnutls_x509_crl_print(crl, full_format, &data); @@ -1702,16 +1702,15 @@ static void print_crl_info(gnutls_x509_crl_t crl, FILE * out) gnutls_free(data.data); } - size = lbuffer_size; ret = - gnutls_x509_crl_export(crl, outcert_format, lbuffer, - &size); + gnutls_x509_crl_export2(crl, outcert_format, &cout); if (ret < 0) { fprintf(stderr, "crl_export: %s\n", gnutls_strerror(ret)); exit(1); } - fwrite(lbuffer, 1, size, outfile); + fwrite(cout.data, 1, cout.size, outfile); + gnutls_free(cout.data); } void crl_info(void) |