Browse Source

IBSS RSN: Set the PSK based on network configuration

Jouni Malinen 16 years ago
parent
commit
b9a2e577b4
3 changed files with 8 additions and 0 deletions
  1. 6 0
      wpa_supplicant/ibss_rsn.c
  2. 1 0
      wpa_supplicant/ibss_rsn.h
  3. 1 0
      wpa_supplicant/wpa_supplicant.c

+ 6 - 0
wpa_supplicant/ibss_rsn.c

@@ -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);
+}

+ 1 - 0
wpa_supplicant/ibss_rsn.h

@@ -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 */

+ 1 - 0
wpa_supplicant/wpa_supplicant.c

@@ -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.