/src/gnutls/fuzz/fuzzer.h
Line | Count | Source |
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 | 22.9k | "-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2:+VERS-TLS1.1:+VERS-TLS1.0:+VERS-SSL3.0" |
31 | | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); |
32 | | |
33 | | static void __attribute__((constructor)) init(void) |
34 | 52 | { |
35 | 52 | gnutls_global_init(); |
36 | 52 | } gnutls_set_trust_file_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_base64_encoder_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_srp_client_fuzzer.c:init Line | Count | Source | 34 | 1 | { | 35 | 1 | gnutls_global_init(); | 36 | 1 | } |
gnutls_server_rawpk_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_ocsp_req_parser_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_pkcs7_parser_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_reverse_idna_parser_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_base64_decoder_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_ocsp_resp_parser_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_dn_parser_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_pkcs8_key_parser_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_idna_parser_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_client_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_x509_crl_parser_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_handshake_server_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_psk_client_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_x509_crq_parser_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_server_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_pkcs12_key_parser_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_x509_parser_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_handshake_client_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_psk_server_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_private_key_parser_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_ext_raw_parse_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_srp_server_fuzzer.c:init Line | Count | Source | 34 | 1 | { | 35 | 1 | gnutls_global_init(); | 36 | 1 | } |
gnutls_client_rawpk_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
gnutls_x509_verify_fuzzer.c:init Line | Count | Source | 34 | 2 | { | 35 | 2 | gnutls_global_init(); | 36 | 2 | } |
|
37 | | |
38 | | static void __attribute__((destructor)) deinit(void) |
39 | 0 | { |
40 | 0 | gnutls_global_deinit(); |
41 | 0 | } Unexecuted instantiation: gnutls_set_trust_file_fuzzer.c:deinit Unexecuted instantiation: gnutls_base64_encoder_fuzzer.c:deinit Unexecuted instantiation: gnutls_srp_client_fuzzer.c:deinit Unexecuted instantiation: gnutls_server_rawpk_fuzzer.c:deinit Unexecuted instantiation: gnutls_ocsp_req_parser_fuzzer.c:deinit Unexecuted instantiation: gnutls_pkcs7_parser_fuzzer.c:deinit Unexecuted instantiation: gnutls_reverse_idna_parser_fuzzer.c:deinit Unexecuted instantiation: gnutls_base64_decoder_fuzzer.c:deinit Unexecuted instantiation: gnutls_ocsp_resp_parser_fuzzer.c:deinit Unexecuted instantiation: gnutls_dn_parser_fuzzer.c:deinit Unexecuted instantiation: gnutls_pkcs8_key_parser_fuzzer.c:deinit Unexecuted instantiation: gnutls_idna_parser_fuzzer.c:deinit Unexecuted instantiation: gnutls_client_fuzzer.c:deinit Unexecuted instantiation: gnutls_x509_crl_parser_fuzzer.c:deinit Unexecuted instantiation: gnutls_handshake_server_fuzzer.c:deinit Unexecuted instantiation: gnutls_psk_client_fuzzer.c:deinit Unexecuted instantiation: gnutls_x509_crq_parser_fuzzer.c:deinit Unexecuted instantiation: gnutls_server_fuzzer.c:deinit Unexecuted instantiation: gnutls_pkcs12_key_parser_fuzzer.c:deinit Unexecuted instantiation: gnutls_x509_parser_fuzzer.c:deinit Unexecuted instantiation: gnutls_handshake_client_fuzzer.c:deinit Unexecuted instantiation: gnutls_psk_server_fuzzer.c:deinit Unexecuted instantiation: gnutls_private_key_parser_fuzzer.c:deinit Unexecuted instantiation: gnutls_ext_raw_parse_fuzzer.c:deinit Unexecuted instantiation: gnutls_srp_server_fuzzer.c:deinit Unexecuted instantiation: gnutls_client_rawpk_fuzzer.c:deinit Unexecuted instantiation: gnutls_x509_verify_fuzzer.c:deinit |