diff options
author | Simon Josefsson <simon@josefsson.org> | 2007-02-13 17:47:05 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2007-02-13 17:47:05 +0000 |
commit | ead6d1772b8b633a55d6b4bd80bf6f40aa237381 (patch) | |
tree | 6ed0ab97fea66697e5d94434d9e1c5a3186f8b1e /src/certtool.c | |
parent | 8d8b3d2a9c00ed23a67b0bc4e2a6cb6b35976fb1 (diff) | |
download | gnutls-ead6d1772b8b633a55d6b4bd80bf6f40aa237381.tar.gz |
No limit on CRL size during verification.
Diffstat (limited to 'src/certtool.c')
-rw-r--r-- | src/certtool.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/src/certtool.c b/src/certtool.c index 720d1d35ff..757fe65143 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -2110,36 +2110,32 @@ verify_crl (void) issuer = load_ca_cert (); fprintf (outfile, "\nCA certificate:\n"); + dn_size = sizeof (dn); ret = gnutls_x509_crt_get_dn (issuer, dn, &dn_size); - if (ret >= 0) - fprintf (outfile, "\tSubject: %s\n\n", dn); + if (ret < 0) + error (EXIT_FAILURE, 0, "crt_get_dn: %s", gnutls_strerror (ret)); - size = fread (buffer, 1, sizeof (buffer) - 1, infile); - buffer[size] = 0; + fprintf (outfile, "\tSubject: %s\n\n", dn); - pem.data = buffer; - pem.size = size; + ret = gnutls_x509_crl_init (&crl); + if (ret < 0) + error (EXIT_FAILURE, 0, "crl_init: %s", gnutls_strerror (ret)); - gnutls_x509_crl_init (&crl); + pem.data = fread_file (infile, &size); + pem.size = size; ret = gnutls_x509_crl_import (crl, &pem, in_cert_format); + free (pem.data); if (ret < 0) - { - fprintf (stderr, "CRL decoding error: %s\n", gnutls_strerror (ret)); - exit (1); - } + error (EXIT_FAILURE, 0, "Import error: %s", gnutls_strerror (ret)); print_crl_info (crl, outfile, 1); - fprintf (outfile, "Verification output: "); ret = gnutls_x509_crl_verify (crl, &issuer, 1, 0, &output); if (ret < 0) - { - fprintf (stderr, "Error in verification: %s\n", gnutls_strerror (ret)); - exit (1); - } + error (EXIT_FAILURE, 0, "Verification error: %s", gnutls_strerror (ret)); if (output & GNUTLS_CERT_INVALID) { @@ -2188,7 +2184,6 @@ verify_crl (void) } fprintf (outfile, "\n"); - } #include <gnutls/pkcs12.h> |