mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
roboswitch: Verify that register read succeeds before comparing result
If wpa_driver_roboswitch_read() fails before such comparison, the values that are being compared are not initialized properly and as such, there is not much point in comparing them either. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
3d91a0470f
commit
a8716d13bf
@ -260,17 +260,17 @@ static int wpa_driver_roboswitch_join(struct wpa_driver_roboswitch_data *drv,
|
|||||||
ROBO_ARLCTRL_CONF, read1, 1);
|
ROBO_ARLCTRL_CONF, read1, 1);
|
||||||
} else {
|
} else {
|
||||||
/* if both multiport addresses are the same we can add */
|
/* if both multiport addresses are the same we can add */
|
||||||
wpa_driver_roboswitch_read(drv, ROBO_ARLCTRL_PAGE,
|
if (wpa_driver_roboswitch_read(drv, ROBO_ARLCTRL_PAGE,
|
||||||
ROBO_ARLCTRL_ADDR_1, read1, 3);
|
ROBO_ARLCTRL_ADDR_1, read1, 3) ||
|
||||||
wpa_driver_roboswitch_read(drv, ROBO_ARLCTRL_PAGE,
|
wpa_driver_roboswitch_read(drv, ROBO_ARLCTRL_PAGE,
|
||||||
ROBO_ARLCTRL_ADDR_2, read2, 3);
|
ROBO_ARLCTRL_ADDR_2, read2, 3) ||
|
||||||
if (os_memcmp(read1, read2, 6) != 0)
|
os_memcmp(read1, read2, 6) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
wpa_driver_roboswitch_read(drv, ROBO_ARLCTRL_PAGE,
|
if (wpa_driver_roboswitch_read(drv, ROBO_ARLCTRL_PAGE,
|
||||||
ROBO_ARLCTRL_VEC_1, read1, 1);
|
ROBO_ARLCTRL_VEC_1, read1, 1) ||
|
||||||
wpa_driver_roboswitch_read(drv, ROBO_ARLCTRL_PAGE,
|
wpa_driver_roboswitch_read(drv, ROBO_ARLCTRL_PAGE,
|
||||||
ROBO_ARLCTRL_VEC_2, read2, 1);
|
ROBO_ARLCTRL_VEC_2, read2, 1) ||
|
||||||
if (read1[0] != read2[0])
|
read1[0] != read2[0])
|
||||||
return -1;
|
return -1;
|
||||||
wpa_driver_roboswitch_write(drv, ROBO_ARLCTRL_PAGE,
|
wpa_driver_roboswitch_write(drv, ROBO_ARLCTRL_PAGE,
|
||||||
ROBO_ARLCTRL_ADDR_1, addr_be16, 3);
|
ROBO_ARLCTRL_ADDR_1, addr_be16, 3);
|
||||||
|
Loading…
Reference in New Issue
Block a user