IBSS RSN: Set the PSK based on network configuration

This commit is contained in:
Jouni Malinen 2009-01-17 17:47:25 +02:00
parent 4691fc7bc8
commit b9a2e577b4
3 changed files with 8 additions and 0 deletions

View file

@ -446,3 +446,9 @@ int ibss_rsn_rx_eapol(struct ibss_rsn *ibss_rsn, const u8 *src_addr,
return 0; return 0;
} }
void ibss_rsn_set_psk(struct ibss_rsn *ibss_rsn, const u8 *psk)
{
os_memcpy(ibss_rsn->psk, psk, PMK_LEN);
}

View file

@ -44,5 +44,6 @@ void ibss_rsn_deinit(struct ibss_rsn *ibss_rsn);
int ibss_rsn_start(struct ibss_rsn *ibss_rsn, const u8 *addr); int ibss_rsn_start(struct ibss_rsn *ibss_rsn, const u8 *addr);
int ibss_rsn_rx_eapol(struct ibss_rsn *ibss_rsn, const u8 *src_addr, int ibss_rsn_rx_eapol(struct ibss_rsn *ibss_rsn, const u8 *src_addr,
const u8 *buf, size_t len); const u8 *buf, size_t len);
void ibss_rsn_set_psk(struct ibss_rsn *ibss_rsn, const u8 *psk);
#endif /* IBSS_RSN_H */ #endif /* IBSS_RSN_H */

View file

@ -1179,6 +1179,7 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
} else if (ssid->mode == IEEE80211_MODE_IBSS && } else if (ssid->mode == IEEE80211_MODE_IBSS &&
wpa_s->key_mgmt != WPA_KEY_MGMT_NONE && wpa_s->key_mgmt != WPA_KEY_MGMT_NONE &&
wpa_s->key_mgmt != WPA_KEY_MGMT_WPA_NONE) { wpa_s->key_mgmt != WPA_KEY_MGMT_WPA_NONE) {
ibss_rsn_set_psk(wpa_s->ibss_rsn, ssid->psk);
/* /*
* RSN IBSS authentication is per-STA and we can disable the * RSN IBSS authentication is per-STA and we can disable the
* per-BSSID authentication. * per-BSSID authentication.