aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap/wpa_auth_ft.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-12-05 20:59:20 (GMT)
committerJouni Malinen <j@w1.fi>2014-12-06 10:16:32 (GMT)
commit369d07afc194fe5d96c085672ad960afac312c2a (patch)
treea32114af0423694cdde85f3471cde50016b6e93b /src/ap/wpa_auth_ft.c
parent769676038871f8192bfc3198fd30a39a0c1b3093 (diff)
downloadhostap-369d07afc194fe5d96c085672ad960afac312c2a.zip
hostap-369d07afc194fe5d96c085672ad960afac312c2a.tar.gz
hostap-369d07afc194fe5d96c085672ad960afac312c2a.tar.bz2
FT: Make aes_wrap() call easier to analyze
Using aes_wrap() to initialize a data structure seemed to be too much for some static analyzers to understand. Make it obvious that the target is not just the single struct member. (CID 68111) Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/ap/wpa_auth_ft.c')
-rw-r--r--src/ap/wpa_auth_ft.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ap/wpa_auth_ft.c b/src/ap/wpa_auth_ft.c
index ed881f2..e061b5e 100644
--- a/src/ap/wpa_auth_ft.c
+++ b/src/ap/wpa_auth_ft.c
@@ -1724,6 +1724,8 @@ static void wpa_ft_generate_pmk_r1(struct wpa_authenticator *wpa_auth,
{
struct ft_r0kh_r1kh_push_frame frame, f;
struct os_time now;
+ const u8 *plain;
+ u8 *crypt;
os_memset(&frame, 0, sizeof(frame));
frame.frame_type = RSN_REMOTE_FRAME_TYPE_FT_RRB;
@@ -1746,9 +1748,13 @@ static void wpa_ft_generate_pmk_r1(struct wpa_authenticator *wpa_auth,
WPA_PUT_LE32(f.timestamp, now.sec);
f.pairwise = host_to_le16(pairwise);
os_memset(f.pad, 0, sizeof(f.pad));
+ plain = ((const u8 *) &f) + offsetof(struct ft_r0kh_r1kh_push_frame,
+ timestamp);
+ crypt = ((u8 *) &frame) + offsetof(struct ft_r0kh_r1kh_push_frame,
+ timestamp);
if (aes_wrap(r1kh->key, sizeof(r1kh->key),
(FT_R0KH_R1KH_PUSH_DATA_LEN + 7) / 8,
- f.timestamp, frame.timestamp) < 0)
+ plain, crypt) < 0)
return;
wpa_ft_rrb_send(wpa_auth, r1kh->addr, (u8 *) &frame, sizeof(frame));