]> git.ipfire.org Git - thirdparty/strongswan.git/blame - fuzz/fuzz_crls.c
Update copyright headers after acquisition by secunet
[thirdparty/strongswan.git] / fuzz / fuzz_crls.c
CommitLineData
bd6e4bbe
TB
1/*
2 * Copyright (C) 2018 Tobias Brunner
19ef2aec
TB
3 *
4 * Copyright (C) secunet Security Networks AG
bd6e4bbe
TB
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 */
16
17#include <library.h>
18#include <utils/debug.h>
19
20int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)
21{
22 certificate_t *cert;
23 chunk_t chunk;
24
25 dbg_default_set_level(-1);
26 library_init(NULL, "fuzz_crls");
27 plugin_loader_add_plugindirs(PLUGINDIR, PLUGINS);
28 if (!lib->plugins->load(lib->plugins, PLUGINS))
29 {
30 return 1;
31 }
32
33 chunk = chunk_create((u_char*)buf, len);
34 cert = lib->creds->create(lib->creds, CRED_CERTIFICATE, CERT_X509_CRL,
35 BUILD_BLOB, chunk, BUILD_END);
36 DESTROY_IF(cert);
37
38 lib->plugins->unload(lib->plugins);
39 library_deinit();
40 return 0;
41}