diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2019-12-30 05:35:45 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2020-01-03 10:56:18 +0100 |
commit | 91e811383c4b1849852ebcfc14fde382b083a779 (patch) | |
tree | 8e2ad06ae24479f4e6ffa2999b6e1e018cdcce21 | |
parent | af83068ffc2b3533d9195b1f59132551f6027976 (diff) | |
download | gnutls-91e811383c4b1849852ebcfc14fde382b083a779.tar.gz |
fuzz: import certificate with and without sanity checks
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rw-r--r-- | fuzz/gnutls_x509_parser_fuzzer.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fuzz/gnutls_x509_parser_fuzzer.c b/fuzz/gnutls_x509_parser_fuzzer.c index 9e50d94e1a..87b09c4f71 100644 --- a/fuzz/gnutls_x509_parser_fuzzer.c +++ b/fuzz/gnutls_x509_parser_fuzzer.c @@ -43,6 +43,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) assert(ret >= 0); gnutls_free(out.data); } + gnutls_x509_crt_deinit(crt); + + ret = gnutls_x509_crt_init(&crt); + assert(ret >= 0); + + gnutls_x509_crt_set_flags(crt, GNUTLS_X509_CRT_FLAG_IGNORE_SANITY); + gnutls_x509_crt_import(crt, &raw, GNUTLS_X509_FMT_DER); gnutls_x509_crt_deinit(crt); return 0; |