From: Nikos Mavrogiannopoulos Date: Mon, 30 Dec 2019 04:35:45 +0000 (+0100) Subject: fuzz: import certificate with and without sanity checks X-Git-Tag: 3.6.12~32^2~1 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=91e811383c4b1849852ebcfc14fde382b083a779;p=thirdparty%2Fgnutls.git fuzz: import certificate with and without sanity checks Signed-off-by: Nikos Mavrogiannopoulos --- 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;