IBSS RSN: Set the PSK based on network configuration
authorJouni Malinen <j@w1.fi>
Sat, 17 Jan 2009 15:47:25 +0000 (17:47 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 17 Jan 2009 15:47:25 +0000 (17:47 +0200)
wpa_supplicant/ibss_rsn.c
wpa_supplicant/ibss_rsn.h
wpa_supplicant/wpa_supplicant.c

index 892609b..d605def 100644 (file)
@@ -446,3 +446,9 @@ int ibss_rsn_rx_eapol(struct ibss_rsn *ibss_rsn, const u8 *src_addr,
 
        return 0;
 }
+
+
+void ibss_rsn_set_psk(struct ibss_rsn *ibss_rsn, const u8 *psk)
+{
+       os_memcpy(ibss_rsn->psk, psk, PMK_LEN);
+}
index 13eecef..43e4d07 100644 (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_rx_eapol(struct ibss_rsn *ibss_rsn, const u8 *src_addr,
                      const u8 *buf, size_t len);
+void ibss_rsn_set_psk(struct ibss_rsn *ibss_rsn, const u8 *psk);
 
 #endif /* IBSS_RSN_H */
index 6d41471..be40654 100644 (file)
@@ -1179,6 +1179,7 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
        } else if (ssid->mode == IEEE80211_MODE_IBSS &&
                   wpa_s->key_mgmt != WPA_KEY_MGMT_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
                 * per-BSSID authentication.