From b9a2e577b431a54afc045a4dceb787ed50ab955c Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 17 Jan 2009 17:47:25 +0200 Subject: [PATCH] IBSS RSN: Set the PSK based on network configuration --- wpa_supplicant/ibss_rsn.c | 6 ++++++ wpa_supplicant/ibss_rsn.h | 1 + wpa_supplicant/wpa_supplicant.c | 1 + 3 files changed, 8 insertions(+) diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c index 892609b2a..d605defb1 100644 --- a/wpa_supplicant/ibss_rsn.c +++ b/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); +} diff --git a/wpa_supplicant/ibss_rsn.h b/wpa_supplicant/ibss_rsn.h index 13eecef21..43e4d07c7 100644 --- a/wpa_supplicant/ibss_rsn.h +++ b/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 */ diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 6d414713f..be4065452 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/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.