Coverage Report

Created: 2026-10-16 06:12

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