Coverage Report

Created: 2025-08-29 06:25

/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
597
{
18
597
  struct sae_data sae;
19
597
  u16 res;
20
597
  const u8 *token = NULL;
21
597
  size_t token_len = 0;
22
597
  int groups[] = { 19, 0 };
23
24
597
  wpa_fuzzer_set_debug_level();
25
26
597
  if (os_program_init())
27
0
    return 0;
28
29
597
  os_memset(&sae, 0, sizeof(sae));
30
597
  res = sae_parse_commit(&sae, data, size, &token, &token_len, groups, 0,
31
597
             NULL);
32
597
  wpa_printf(MSG_DEBUG, "sae_parse_commit(0): %u", res);
33
597
  sae_clear_data(&sae);
34
597
  res = sae_parse_commit(&sae, data, size, &token, &token_len, groups, 1,
35
597
             NULL);
36
597
  wpa_printf(MSG_DEBUG, "sae_parse_commit(1): %u", res);
37
597
  sae_clear_data(&sae);
38
597
  os_program_deinit();
39
40
597
  return 0;
41
597
}