3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-20 10:52:33 +01:00

unit: Add test for wsc_build_m6

This commit is contained in:
Denis Kenzior 2016-08-31 11:02:33 -05:00
parent 6e9b5c912c
commit 11cb6e5d35

View File

@ -1483,6 +1483,22 @@ static void wsc_test_parse_m6(const void *data)
encrypted.iov_base, encrypted.iov_len)); encrypted.iov_base, encrypted.iov_len));
} }
static void wsc_test_build_m6(const void *data)
{
const struct m6_data *test = data;
uint8_t *out;
size_t out_len;
out = wsc_build_m6(&test->expected, test->expected_encrypted,
test->expected_encrypted_size, &out_len);
assert(out);
assert(out_len == test->len);
assert(!memcmp(test->pdu, out, test->len));
l_free(out);
}
static const uint8_t eap_identity_req[] = { static const uint8_t eap_identity_req[] = {
0x01, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x05, 0x01 0x01, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x05, 0x01
}; };
@ -1710,6 +1726,7 @@ int main(int argc, char *argv[])
l_test_add("/wsc/build/m5 1", wsc_test_build_m5, &m5_data_1); l_test_add("/wsc/build/m5 1", wsc_test_build_m5, &m5_data_1);
l_test_add("/wsc/parse/m6 1", wsc_test_parse_m6, &m6_data_1); l_test_add("/wsc/parse/m6 1", wsc_test_parse_m6, &m6_data_1);
l_test_add("/wsc/build/m6 1", wsc_test_build_m6, &m6_data_1);
l_test_add("/wsc/handshake/PBC Handshake Test", l_test_add("/wsc/handshake/PBC Handshake Test",
wsc_test_pbc_handshake, NULL); wsc_test_pbc_handshake, NULL);