~indicator-network-developers/wpasupplicant/trunk

« back to all changes in this revision

Viewing changes to src/ap/wpa_auth_ie.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:
530
530
 
531
531
 
532
532
int wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth,
533
 
                        struct wpa_state_machine *sm,
 
533
                        struct wpa_state_machine *sm, int freq,
534
534
                        const u8 *wpa_ie, size_t wpa_ie_len,
535
535
                        const u8 *mdie, size_t mdie_len,
536
536
                        const u8 *owe_dh, size_t owe_dh_len)
560
560
 
561
561
        if (version == WPA_PROTO_RSN) {
562
562
                res = wpa_parse_wpa_ie_rsn(wpa_ie, wpa_ie_len, &data);
 
563
                if (!data.has_pairwise)
 
564
                        data.pairwise_cipher = wpa_default_rsn_cipher(freq);
 
565
                if (!data.has_group)
 
566
                        data.group_cipher = wpa_default_rsn_cipher(freq);
563
567
 
564
568
                if (wpa_key_mgmt_ft(data.key_mgmt) && !mdie &&
565
569
                    !wpa_key_mgmt_only_ft(data.key_mgmt)) {