Coverage Report

Created: 2024-11-25 06:27

/src/gnutls/fuzz/fuzzer.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright(c) 2017 Free Software Foundation, Inc.
3
 *
4
 * GnuTLS is free software: you can redistribute it and/or modify
5
 * it under the terms of the GNU Lesser General Public License as published by
6
 * the Free Software Foundation, either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * GnuTLS is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General Public License
15
 * along with gnutls.  If not, see <https://www.gnu.org/licenses/>.
16
 */
17
18
#include <stddef.h> // size_t
19
#include <stdint.h> // uint8_t
20
#include <gnutls/gnutls.h>
21
22
#if defined __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
23
#pragma GCC diagnostic ignored "-Wvla-larger-than="
24
#endif
25
26
#ifdef __cplusplus
27
extern "C"
28
#endif
29
#define VERS_STR \
30
  "-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2:+VERS-TLS1.1:+VERS-TLS1.0:+VERS-SSL3.0"
31
  int
32
  LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
33
34
static void __attribute__((constructor)) init(void)
35
2
{
36
2
  gnutls_global_init();
37
2
}
38
39
static void __attribute__((destructor)) deinit(void)
40
0
{
41
0
  gnutls_global_deinit();
42
0
}