Skip to content

Commit 34dd36f

Browse files
committed
Fixes for CI
1 parent f28b497 commit 34dd36f

3 files changed

Lines changed: 34 additions & 3 deletions

File tree

src/supplicant/test_supplicant_sae.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,14 @@ static int ap_handle_supp_frame(struct fake_ap *a,
118118
if (sae_generate_commit(&a->sae) != 0) return -1;
119119
{
120120
uint8_t commit_body[2 + 3 * SAE_MAX_PRIME_LEN];
121-
size_t clen = 0;
121+
size_t commit_len = 0;
122122
if (sae_serialize_commit(&a->sae, commit_body,
123-
sizeof(commit_body), &clen) != 0) {
123+
sizeof(commit_body),
124+
&commit_len) != 0) {
124125
return -1;
125126
}
126127
if (ap_send_frame(3, 1, a->h2e ? 126U : 0U,
127-
commit_body, clen) != 0) return -1;
128+
commit_body, commit_len) != 0) return -1;
128129
}
129130
a->sent_commit = 1;
130131

src/test/unit/unit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ Suite *wolf_suite(void)
336336
tcase_add_test(tc_utils, test_sock_getsockname_invalid_socket_ids);
337337
tcase_add_test(tc_utils, test_sock_getsockname_icmp_success);
338338
tcase_add_test(tc_utils, test_register_callback_variants);
339+
tcase_add_test(tc_utils, test_register_eapol_handler);
339340
tcase_add_test(tc_utils, test_sock_connect_udp_bound_ip_not_local);
340341
tcase_add_test(tc_utils, test_sock_connect_udp_bound_ip_success);
341342
tcase_add_test(tc_utils, test_sock_connect_udp_primary_fallback);

src/test/unit/unit_tests_dns_dhcp.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,35 @@ START_TEST(test_register_callback_variants)
744744
}
745745
END_TEST
746746

747+
static int test_eapol_cb(void *ctx, unsigned int if_idx,
748+
const uint8_t *frame, uint32_t len)
749+
{
750+
(void)ctx; (void)if_idx; (void)frame; (void)len;
751+
return 0;
752+
}
753+
754+
START_TEST(test_register_eapol_handler)
755+
{
756+
struct wolfIP s;
757+
int sentinel = 0xA5;
758+
759+
wolfIP_init(&s);
760+
761+
/* NULL stack is a no-op (must not crash). */
762+
wolfIP_register_eapol_handler(NULL, test_eapol_cb, &sentinel);
763+
764+
/* Register: handler + ctx stored. */
765+
wolfIP_register_eapol_handler(&s, test_eapol_cb, &sentinel);
766+
ck_assert_ptr_eq((void *)s.eapol_handler, (void *)test_eapol_cb);
767+
ck_assert_ptr_eq(s.eapol_handler_ctx, &sentinel);
768+
769+
/* Unregister: passing NULL handler clears it. */
770+
wolfIP_register_eapol_handler(&s, NULL, NULL);
771+
ck_assert_ptr_eq((void *)s.eapol_handler, NULL);
772+
ck_assert_ptr_eq(s.eapol_handler_ctx, NULL);
773+
}
774+
END_TEST
775+
747776
START_TEST(test_sock_connect_udp_bound_ip_not_local)
748777
{
749778
struct wolfIP s;

0 commit comments

Comments
 (0)