~indicator-network-developers/wpasupplicant/trunk

« back to all changes in this revision

Viewing changes to src/ap/ieee802_11.c

  • Committer: Jouni Malinen
  • Author(s): Lior David
  • Date: 2019-02-21 10:42:24 UTC
  • Revision ID: git-v1:2c129a1b71c6dcaff7e4db388f4fae303d265437
Fix cipher suite selector default value in RSNE for DMG

According to IEEE Std 802.11-2016, 9.4.2.25 when fields of an RSNE are
not included, the default values are used. The cipher suite defaults
were hardcoded to CCMP in the previous implementation, but the default
is actually different for DMG: GCMP (per 9.4.2.25.2).

It is not possible to find out from the RSNE if the network is non-DMG
or DMG, so callers of wpa_parse_wpa_ie_rsn() need to handle this case
based on context, which can be different for each caller.

In order to fix this issue, add flags to the wpa_ie_data indicating
whether pairwise/group ciphers were included in the RSNE. Callers can
check these flags and fill in the appropriate ciphers. The
wpa_parse_wpa_ie_rsn() function still initializes the ciphers to CCMP by
default so existing callers will not break. This change also fixes some
callers which need to handle the DMG network case.

Signed-off-by: Lior David <liord@codeaurora.org>

Show diffs side-by-side

added added

removed removed

Lines of Context:
1328
1328
        }
1329
1329
 
1330
1330
        res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm,
 
1331
                                  hapd->iface->freq,
1331
1332
                                  elems.rsn_ie - 2, elems.rsn_ie_len + 2,
1332
1333
                                  elems.mdie, elems.mdie_len, NULL, 0);
1333
1334
        resp = wpa_res_to_status_code(res);
2700
2701
                        return WLAN_STATUS_UNSPECIFIED_FAILURE;
2701
2702
                }
2702
2703
                res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm,
 
2704
                                          hapd->iface->freq,
2703
2705
                                          wpa_ie, wpa_ie_len,
2704
2706
                                          elems.mdie, elems.mdie_len,
2705
2707
                                          elems.owe_dh, elems.owe_dh_len);