mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
wpa_supplicant: Add new blacklist tests
This change adds some barebones tests for new blacklisting functionality to wpas_module_tests.c. The tests ensure some basic functionality for the functions wpa_blacklist_is_blacklisted() and wpa_blacklist_update(). Signed-off-by: Kevin Lund <kglund@google.com> Signed-off-by: Brian Norris <briannorris@chromium.org>
This commit is contained in:
parent
164b8dd8e4
commit
bbbb3c04ef
@ -59,6 +59,23 @@ static int wpas_blacklist_module_tests(void)
|
||||
wpa_blacklist_add(&wpa_s, (u8 *) "333333") < 0)
|
||||
goto fail;
|
||||
|
||||
wpa_blacklist_clear(&wpa_s);
|
||||
|
||||
if (wpa_blacklist_add(&wpa_s, (u8 *) "111111") < 0 ||
|
||||
wpa_blacklist_add(&wpa_s, (u8 *) "222222") < 0 ||
|
||||
wpa_blacklist_add(&wpa_s, (u8 *) "333333") < 0 ||
|
||||
wpa_blacklist_add(&wpa_s, (u8 *) "444444") < 0 ||
|
||||
!wpa_blacklist_is_blacklisted(&wpa_s, (u8 *) "111111") ||
|
||||
wpa_blacklist_del(&wpa_s, (u8 *) "111111") < 0 ||
|
||||
wpa_blacklist_is_blacklisted(&wpa_s, (u8 *) "111111") ||
|
||||
wpa_blacklist_add(&wpa_s, (u8 *) "111111") < 0)
|
||||
goto fail;
|
||||
|
||||
wpa_blacklist_update(&wpa_s);
|
||||
|
||||
if (!wpa_blacklist_is_blacklisted(&wpa_s, (u8 *) "111111"))
|
||||
goto fail;
|
||||
|
||||
ret = 0;
|
||||
fail:
|
||||
wpa_blacklist_clear(&wpa_s);
|
||||
|
Loading…
Reference in New Issue
Block a user