fuzz: Create fuzzers with default and custom crypto plugins

The pa_tnc fuzzer does not rely on any plugins and the pb_tnc fuzzer is
a bit special in that it does use code from the tnccs-20 plugin, but that
doesn't actually have to be loaded as such. The fuzzer directly calls
statically linked code from the plugin.
This commit is contained in:
Tobias Brunner
2026-04-08 15:56:42 +02:00
parent 521c6e05c5
commit 444a1dc0e3
6 changed files with 83 additions and 46 deletions
+1 -6
View File
@@ -31,12 +31,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)
dbg_default_set_level(-1);
library_init(NULL, "fuzz_pa_tnc");
plugin_loader_add_plugindirs(PLUGINDIR, PLUGINS);
if (!lib->plugins->load(lib->plugins, PLUGINS))
{
return 1;
}
libimcv_init(FALSE);
chunk = chunk_create((u_char*)buf, len);
/* Parse incoming PA-TNC message */
@@ -68,7 +64,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)
msg->destroy(msg);
libimcv_deinit();
lib->plugins->unload(lib->plugins);
library_deinit();
return 0;
}