diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-10-07 16:10:19 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2016-10-07 19:09:12 +0200 |
commit | 8a13eac15caf182762c08ea296fc1758344927dd (patch) | |
tree | e72880f45f5c871e8dfd0bebbe1c9f9f0c4c6014 /src | |
parent | 5b675d0a3c9c7afb5e9b2f71721451d7e17d4017 (diff) | |
download | gnutls-8a13eac15caf182762c08ea296fc1758344927dd.tar.gz |
certtool: lift any limits in print_raw()
Diffstat (limited to 'src')
-rw-r--r-- | src/certtool.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/certtool.c b/src/certtool.c index 4ae3b123d9..bf8f62fbb6 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -2759,22 +2759,21 @@ static void print_dn(const char *prefix, const gnutls_datum_t *raw) static void print_raw(const char *prefix, const gnutls_datum_t *raw) { - char data[512]; - size_t data_size; int ret; + gnutls_datum_t tmp; if (raw->data == NULL || raw->size == 0) return; - data_size = sizeof(data); - ret = gnutls_hex_encode(raw, data, &data_size); + ret = gnutls_hex_encode2(raw, &tmp); if (ret < 0) { - fprintf(stderr, "gnutls_hex_encode: %s\n", + fprintf(stderr, "gnutls_hex_encode2: %s\n", gnutls_strerror(ret)); exit(1); } - fprintf(outfile, "%s: %s\n", prefix, data); + fprintf(outfile, "%s: %s\n", prefix, tmp.data); + gnutls_free(tmp.data); } static void print_pkcs7_sig_info(gnutls_pkcs7_signature_info_st *info, common_info_st *cinfo) |