3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

unit: remove timeout tests from test-sae

The timeout functionality was removed from the core SAE
implementation as it causes issues with kernel behavior.
Because of this the timeout tests are no longer valid,
nor is a few asserts in the end-to-end test.
This commit is contained in:
James Prestwood 2021-04-06 11:29:46 -07:00 committed by Denis Kenzior
parent 6c9f72380d
commit 5b4a7fc377

View File

@ -236,59 +236,6 @@ static size_t setup_assoc_frame(struct associate_frame *frame, uint16_t status)
return sizeof(frame->hdr) + sizeof(frame->assoc); return sizeof(frame->hdr) + sizeof(frame->assoc);
} }
static void test_confirm_timeout(const void *arg)
{
struct test_data *td = l_new(struct test_data, 1);
struct auth_proto *ap = test_initialize(td);
struct authenticate_frame *frame = alloca(
sizeof(struct authenticate_frame) +
sizeof(aa_commit));
size_t len;
int i;
len = setup_auth_frame(frame, aa, 1, 0, aa_commit, sizeof(aa_commit));
assert(auth_proto_rx_authenticate(ap, (uint8_t *)frame, len) == 0);
assert(td->confirm_success);
assert(l_get_le16(td->tx_packet + 4) == 1);
for (i = 1; i < 5; i++) {
assert(auth_proto_auth_timeout(ap));
assert(l_get_le16(td->tx_packet + 4) == i + 1);
}
assert(!auth_proto_auth_timeout(ap));
test_destruct(td);
auth_proto_free(ap);
}
static void test_commit_timeout(const void *arg)
{
struct test_data *td = l_new(struct test_data, 1);
struct auth_proto *ap = test_initialize(td);
uint8_t last_packet[512];
int i;
memcpy(last_packet, td->tx_packet, td->tx_packet_len);
for (i = 0; i < 4; i++) {
assert(auth_proto_auth_timeout(ap));
assert(!memcmp(last_packet, td->tx_packet, td->tx_packet_len));
memcpy(last_packet, td->tx_packet, td->tx_packet_len);
}
assert(!auth_proto_auth_timeout(ap));
test_destruct(td);
auth_proto_free(ap);
}
static void test_clogging(const void *arg) static void test_clogging(const void *arg)
{ {
struct test_data *td = l_new(struct test_data, 1); struct test_data *td = l_new(struct test_data, 1);
@ -575,16 +522,7 @@ static void test_confirm_after_accept(const void *arg)
assert(td1->tx_assoc_called); assert(td1->tx_assoc_called);
/* simulate sm2 not receiving confirm and resending its confirm */ /* sm1 should respond with a confirm, and accept */
ap2->auth_timeout(ap2);
frame_len = setup_auth_frame(frame, aa, 2, 0, td2->tx_packet + 4,
td2->tx_packet_len - 4);
assert(auth_proto_rx_authenticate(ap1, (uint8_t *)frame,
frame_len) == 0);
/* sc should be set to 0xffff */
assert(l_get_u16(td1->tx_packet + 4) == 0xffff);
/* sm1 should respond with a new confirm, and accept */
frame_len = setup_auth_frame(frame, spa, 2, 0, td1->tx_packet + 4, frame_len = setup_auth_frame(frame, spa, 2, 0, td1->tx_packet + 4,
td1->tx_packet_len - 4); td1->tx_packet_len - 4);
assert(auth_proto_rx_authenticate(ap2, (uint8_t *)frame, assert(auth_proto_rx_authenticate(ap2, (uint8_t *)frame,
@ -703,8 +641,6 @@ int main(int argc, char *argv[])
goto done; goto done;
} }
l_test_add("SAE commit timeout", test_commit_timeout, NULL);
l_test_add("SAE confirm timeout", test_confirm_timeout, NULL);
l_test_add("SAE anti-clogging", test_clogging, NULL); l_test_add("SAE anti-clogging", test_clogging, NULL);
l_test_add("SAE early confirm", test_early_confirm, NULL); l_test_add("SAE early confirm", test_early_confirm, NULL);
l_test_add("SAE reflection", test_reflection, NULL); l_test_add("SAE reflection", test_reflection, NULL);