]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
fuzz: import certificate with and without sanity checks
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 30 Dec 2019 04:35:45 +0000 (05:35 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 3 Jan 2020 09:56:18 +0000 (10:56 +0100)
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
fuzz/gnutls_x509_parser_fuzzer.c

index 9e50d94e1afb913f9c3cba75491940099a450b66..87b09c4f718627c61434c96ec3e6c86679b949af 100644 (file)
@@ -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;