/src/hostap/tests/fuzzing/sae/sae.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * SAE fuzzer |
3 | | * Copyright (c) 2020, Jouni Malinen <j@w1.fi> |
4 | | * |
5 | | * This software may be distributed under the terms of the BSD license. |
6 | | * See README for more details. |
7 | | */ |
8 | | |
9 | | #include "utils/includes.h" |
10 | | |
11 | | #include "utils/common.h" |
12 | | #include "common/sae.h" |
13 | | #include "../fuzzer-common.h" |
14 | | |
15 | | |
16 | | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) |
17 | 611 | { |
18 | 611 | struct sae_data sae; |
19 | 611 | u16 res; |
20 | 611 | const u8 *token = NULL; |
21 | 611 | size_t token_len = 0; |
22 | 611 | int groups[] = { 19, 0 }; |
23 | | |
24 | 611 | wpa_fuzzer_set_debug_level(); |
25 | | |
26 | 611 | if (os_program_init()) |
27 | 0 | return 0; |
28 | | |
29 | 611 | os_memset(&sae, 0, sizeof(sae)); |
30 | 611 | res = sae_parse_commit(&sae, data, size, &token, &token_len, groups, 0, |
31 | 611 | NULL); |
32 | 611 | wpa_printf(MSG_DEBUG, "sae_parse_commit(0): %u", res); |
33 | 611 | sae_clear_data(&sae); |
34 | 611 | res = sae_parse_commit(&sae, data, size, &token, &token_len, groups, 1, |
35 | 611 | NULL); |
36 | 611 | wpa_printf(MSG_DEBUG, "sae_parse_commit(1): %u", res); |
37 | 611 | sae_clear_data(&sae); |
38 | 611 | os_program_deinit(); |
39 | | |
40 | 611 | return 0; |
41 | 611 | } |