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:35:24 +0200 |
commit | 6330a11831b1b9d7947e64dc736ac7fcf12c8fee (patch) | |
tree | a541d4eb75a369b2c35eec925ba3ab0bd7e78ab3 | |
parent | 0291f7471c3ed4bfc4a7333efcb67101e730ff91 (diff) | |
download | gnutls-6330a11831b1b9d7947e64dc736ac7fcf12c8fee.tar.gz |
certtool: allow exporting very long CRLs
-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 7c0b79c949..9427408bb7 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -1620,8 +1620,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); @@ -1634,16 +1634,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) |