events.c 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133
  1. /*
  2. * WPA Supplicant - Driver event processing
  3. * Copyright (c) 2003-2008, Jouni Malinen <j@w1.fi>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * Alternatively, this software may be distributed under the terms of BSD
  10. * license.
  11. *
  12. * See README and COPYING for more details.
  13. */
  14. #include "includes.h"
  15. #include "common.h"
  16. #include "eapol_supp/eapol_supp_sm.h"
  17. #include "wpa.h"
  18. #include "eloop.h"
  19. #include "drivers/driver.h"
  20. #include "config.h"
  21. #include "l2_packet/l2_packet.h"
  22. #include "wpa_supplicant_i.h"
  23. #include "pcsc_funcs.h"
  24. #include "preauth.h"
  25. #include "pmksa_cache.h"
  26. #include "wpa_ctrl.h"
  27. #include "eap_peer/eap.h"
  28. #include "ctrl_iface_dbus.h"
  29. #include "ieee802_11_defs.h"
  30. #include "blacklist.h"
  31. #include "wpas_glue.h"
  32. #include "wps_supplicant.h"
  33. #include "ibss_rsn.h"
  34. static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s)
  35. {
  36. struct wpa_ssid *ssid;
  37. if (wpa_s->conf->ap_scan == 1 && wpa_s->current_ssid)
  38. return 0;
  39. wpa_printf(MSG_DEBUG, "Select network based on association "
  40. "information");
  41. ssid = wpa_supplicant_get_ssid(wpa_s);
  42. if (ssid == NULL) {
  43. wpa_printf(MSG_INFO, "No network configuration found for the "
  44. "current AP");
  45. return -1;
  46. }
  47. if (ssid->disabled) {
  48. wpa_printf(MSG_DEBUG, "Selected network is disabled");
  49. return -1;
  50. }
  51. wpa_printf(MSG_DEBUG, "Network configuration found for the current "
  52. "AP");
  53. if (ssid->key_mgmt & (WPA_KEY_MGMT_PSK | WPA_KEY_MGMT_IEEE8021X |
  54. WPA_KEY_MGMT_WPA_NONE |
  55. WPA_KEY_MGMT_FT_PSK | WPA_KEY_MGMT_FT_IEEE8021X |
  56. WPA_KEY_MGMT_PSK_SHA256 |
  57. WPA_KEY_MGMT_IEEE8021X_SHA256)) {
  58. u8 wpa_ie[80];
  59. size_t wpa_ie_len = sizeof(wpa_ie);
  60. wpa_supplicant_set_suites(wpa_s, NULL, ssid,
  61. wpa_ie, &wpa_ie_len);
  62. } else {
  63. wpa_supplicant_set_non_wpa_policy(wpa_s, ssid);
  64. }
  65. if (wpa_s->current_ssid && wpa_s->current_ssid != ssid)
  66. eapol_sm_invalidate_cached_session(wpa_s->eapol);
  67. wpa_s->current_ssid = ssid;
  68. wpa_supplicant_rsn_supp_set_config(wpa_s, wpa_s->current_ssid);
  69. wpa_supplicant_initiate_eapol(wpa_s);
  70. return 0;
  71. }
  72. static void wpa_supplicant_stop_countermeasures(void *eloop_ctx,
  73. void *sock_ctx)
  74. {
  75. struct wpa_supplicant *wpa_s = eloop_ctx;
  76. if (wpa_s->countermeasures) {
  77. wpa_s->countermeasures = 0;
  78. wpa_drv_set_countermeasures(wpa_s, 0);
  79. wpa_msg(wpa_s, MSG_INFO, "WPA: TKIP countermeasures stopped");
  80. wpa_supplicant_req_scan(wpa_s, 0, 0);
  81. }
  82. }
  83. void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s)
  84. {
  85. wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
  86. os_memset(wpa_s->bssid, 0, ETH_ALEN);
  87. os_memset(wpa_s->pending_bssid, 0, ETH_ALEN);
  88. eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
  89. eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
  90. if (wpa_key_mgmt_wpa_psk(wpa_s->key_mgmt))
  91. eapol_sm_notify_eap_success(wpa_s->eapol, FALSE);
  92. wpa_s->ap_ies_from_associnfo = 0;
  93. }
  94. static void wpa_find_assoc_pmkid(struct wpa_supplicant *wpa_s)
  95. {
  96. struct wpa_ie_data ie;
  97. int pmksa_set = -1;
  98. size_t i;
  99. if (wpa_sm_parse_own_wpa_ie(wpa_s->wpa, &ie) < 0 ||
  100. ie.pmkid == NULL)
  101. return;
  102. for (i = 0; i < ie.num_pmkid; i++) {
  103. pmksa_set = pmksa_cache_set_current(wpa_s->wpa,
  104. ie.pmkid + i * PMKID_LEN,
  105. NULL, NULL, 0);
  106. if (pmksa_set == 0) {
  107. eapol_sm_notify_pmkid_attempt(wpa_s->eapol, 1);
  108. break;
  109. }
  110. }
  111. wpa_printf(MSG_DEBUG, "RSN: PMKID from assoc IE %sfound from PMKSA "
  112. "cache", pmksa_set == 0 ? "" : "not ");
  113. }
  114. static void wpa_supplicant_event_pmkid_candidate(struct wpa_supplicant *wpa_s,
  115. union wpa_event_data *data)
  116. {
  117. if (data == NULL) {
  118. wpa_printf(MSG_DEBUG, "RSN: No data in PMKID candidate event");
  119. return;
  120. }
  121. wpa_printf(MSG_DEBUG, "RSN: PMKID candidate event - bssid=" MACSTR
  122. " index=%d preauth=%d",
  123. MAC2STR(data->pmkid_candidate.bssid),
  124. data->pmkid_candidate.index,
  125. data->pmkid_candidate.preauth);
  126. pmksa_candidate_add(wpa_s->wpa, data->pmkid_candidate.bssid,
  127. data->pmkid_candidate.index,
  128. data->pmkid_candidate.preauth);
  129. }
  130. static int wpa_supplicant_dynamic_keys(struct wpa_supplicant *wpa_s)
  131. {
  132. if (wpa_s->key_mgmt == WPA_KEY_MGMT_NONE ||
  133. wpa_s->key_mgmt == WPA_KEY_MGMT_WPA_NONE)
  134. return 0;
  135. #ifdef IEEE8021X_EAPOL
  136. if (wpa_s->key_mgmt == WPA_KEY_MGMT_IEEE8021X_NO_WPA &&
  137. wpa_s->current_ssid &&
  138. !(wpa_s->current_ssid->eapol_flags &
  139. (EAPOL_FLAG_REQUIRE_KEY_UNICAST |
  140. EAPOL_FLAG_REQUIRE_KEY_BROADCAST))) {
  141. /* IEEE 802.1X, but not using dynamic WEP keys (i.e., either
  142. * plaintext or static WEP keys). */
  143. return 0;
  144. }
  145. #endif /* IEEE8021X_EAPOL */
  146. return 1;
  147. }
  148. /**
  149. * wpa_supplicant_scard_init - Initialize SIM/USIM access with PC/SC
  150. * @wpa_s: pointer to wpa_supplicant data
  151. * @ssid: Configuration data for the network
  152. * Returns: 0 on success, -1 on failure
  153. *
  154. * This function is called when starting authentication with a network that is
  155. * configured to use PC/SC for SIM/USIM access (EAP-SIM or EAP-AKA).
  156. */
  157. int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
  158. struct wpa_ssid *ssid)
  159. {
  160. #ifdef IEEE8021X_EAPOL
  161. int aka = 0, sim = 0, type;
  162. if (ssid->eap.pcsc == NULL || wpa_s->scard != NULL)
  163. return 0;
  164. if (ssid->eap.eap_methods == NULL) {
  165. sim = 1;
  166. aka = 1;
  167. } else {
  168. struct eap_method_type *eap = ssid->eap.eap_methods;
  169. while (eap->vendor != EAP_VENDOR_IETF ||
  170. eap->method != EAP_TYPE_NONE) {
  171. if (eap->vendor == EAP_VENDOR_IETF) {
  172. if (eap->method == EAP_TYPE_SIM)
  173. sim = 1;
  174. else if (eap->method == EAP_TYPE_AKA)
  175. aka = 1;
  176. }
  177. eap++;
  178. }
  179. }
  180. if (eap_peer_get_eap_method(EAP_VENDOR_IETF, EAP_TYPE_SIM) == NULL)
  181. sim = 0;
  182. if (eap_peer_get_eap_method(EAP_VENDOR_IETF, EAP_TYPE_AKA) == NULL)
  183. aka = 0;
  184. if (!sim && !aka) {
  185. wpa_printf(MSG_DEBUG, "Selected network is configured to use "
  186. "SIM, but neither EAP-SIM nor EAP-AKA are enabled");
  187. return 0;
  188. }
  189. wpa_printf(MSG_DEBUG, "Selected network is configured to use SIM "
  190. "(sim=%d aka=%d) - initialize PCSC", sim, aka);
  191. if (sim && aka)
  192. type = SCARD_TRY_BOTH;
  193. else if (aka)
  194. type = SCARD_USIM_ONLY;
  195. else
  196. type = SCARD_GSM_SIM_ONLY;
  197. wpa_s->scard = scard_init(type);
  198. if (wpa_s->scard == NULL) {
  199. wpa_printf(MSG_WARNING, "Failed to initialize SIM "
  200. "(pcsc-lite)");
  201. return -1;
  202. }
  203. wpa_sm_set_scard_ctx(wpa_s->wpa, wpa_s->scard);
  204. eapol_sm_register_scard_ctx(wpa_s->eapol, wpa_s->scard);
  205. #endif /* IEEE8021X_EAPOL */
  206. return 0;
  207. }
  208. #ifndef CONFIG_NO_SCAN_PROCESSING
  209. static int wpa_supplicant_match_privacy(struct wpa_scan_res *bss,
  210. struct wpa_ssid *ssid)
  211. {
  212. int i, privacy = 0;
  213. if (ssid->mixed_cell)
  214. return 1;
  215. for (i = 0; i < NUM_WEP_KEYS; i++) {
  216. if (ssid->wep_key_len[i]) {
  217. privacy = 1;
  218. break;
  219. }
  220. }
  221. #ifdef IEEE8021X_EAPOL
  222. if ((ssid->key_mgmt & WPA_KEY_MGMT_IEEE8021X_NO_WPA) &&
  223. ssid->eapol_flags & (EAPOL_FLAG_REQUIRE_KEY_UNICAST |
  224. EAPOL_FLAG_REQUIRE_KEY_BROADCAST))
  225. privacy = 1;
  226. #endif /* IEEE8021X_EAPOL */
  227. if (bss->caps & IEEE80211_CAP_PRIVACY)
  228. return privacy;
  229. return !privacy;
  230. }
  231. static int wpa_supplicant_ssid_bss_match(struct wpa_supplicant *wpa_s,
  232. struct wpa_ssid *ssid,
  233. struct wpa_scan_res *bss)
  234. {
  235. struct wpa_ie_data ie;
  236. int proto_match = 0;
  237. const u8 *rsn_ie, *wpa_ie;
  238. int ret;
  239. ret = wpas_wps_ssid_bss_match(wpa_s, ssid, bss);
  240. if (ret >= 0)
  241. return ret;
  242. rsn_ie = wpa_scan_get_ie(bss, WLAN_EID_RSN);
  243. while ((ssid->proto & WPA_PROTO_RSN) && rsn_ie) {
  244. proto_match++;
  245. if (wpa_parse_wpa_ie(rsn_ie, 2 + rsn_ie[1], &ie)) {
  246. wpa_printf(MSG_DEBUG, " skip RSN IE - parse failed");
  247. break;
  248. }
  249. if (!(ie.proto & ssid->proto)) {
  250. wpa_printf(MSG_DEBUG, " skip RSN IE - proto "
  251. "mismatch");
  252. break;
  253. }
  254. if (!(ie.pairwise_cipher & ssid->pairwise_cipher)) {
  255. wpa_printf(MSG_DEBUG, " skip RSN IE - PTK cipher "
  256. "mismatch");
  257. break;
  258. }
  259. if (!(ie.group_cipher & ssid->group_cipher)) {
  260. wpa_printf(MSG_DEBUG, " skip RSN IE - GTK cipher "
  261. "mismatch");
  262. break;
  263. }
  264. if (!(ie.key_mgmt & ssid->key_mgmt)) {
  265. wpa_printf(MSG_DEBUG, " skip RSN IE - key mgmt "
  266. "mismatch");
  267. break;
  268. }
  269. #ifdef CONFIG_IEEE80211W
  270. if (!(ie.capabilities & WPA_CAPABILITY_MFPC) &&
  271. ssid->ieee80211w == IEEE80211W_REQUIRED) {
  272. wpa_printf(MSG_DEBUG, " skip RSN IE - no mgmt frame "
  273. "protection");
  274. break;
  275. }
  276. #endif /* CONFIG_IEEE80211W */
  277. wpa_printf(MSG_DEBUG, " selected based on RSN IE");
  278. return 1;
  279. }
  280. wpa_ie = wpa_scan_get_vendor_ie(bss, WPA_IE_VENDOR_TYPE);
  281. while ((ssid->proto & WPA_PROTO_WPA) && wpa_ie) {
  282. proto_match++;
  283. if (wpa_parse_wpa_ie(wpa_ie, 2 + wpa_ie[1], &ie)) {
  284. wpa_printf(MSG_DEBUG, " skip WPA IE - parse failed");
  285. break;
  286. }
  287. if (!(ie.proto & ssid->proto)) {
  288. wpa_printf(MSG_DEBUG, " skip WPA IE - proto "
  289. "mismatch");
  290. break;
  291. }
  292. if (!(ie.pairwise_cipher & ssid->pairwise_cipher)) {
  293. wpa_printf(MSG_DEBUG, " skip WPA IE - PTK cipher "
  294. "mismatch");
  295. break;
  296. }
  297. if (!(ie.group_cipher & ssid->group_cipher)) {
  298. wpa_printf(MSG_DEBUG, " skip WPA IE - GTK cipher "
  299. "mismatch");
  300. break;
  301. }
  302. if (!(ie.key_mgmt & ssid->key_mgmt)) {
  303. wpa_printf(MSG_DEBUG, " skip WPA IE - key mgmt "
  304. "mismatch");
  305. break;
  306. }
  307. wpa_printf(MSG_DEBUG, " selected based on WPA IE");
  308. return 1;
  309. }
  310. if (proto_match == 0)
  311. wpa_printf(MSG_DEBUG, " skip - no WPA/RSN proto match");
  312. return 0;
  313. }
  314. static struct wpa_scan_res *
  315. wpa_supplicant_select_bss_wpa(struct wpa_supplicant *wpa_s,
  316. struct wpa_ssid *group,
  317. struct wpa_ssid **selected_ssid)
  318. {
  319. struct wpa_ssid *ssid;
  320. struct wpa_scan_res *bss;
  321. size_t i;
  322. struct wpa_blacklist *e;
  323. const u8 *ie;
  324. wpa_printf(MSG_DEBUG, "Try to find WPA-enabled AP");
  325. for (i = 0; i < wpa_s->scan_res->num; i++) {
  326. const u8 *ssid_;
  327. u8 wpa_ie_len, rsn_ie_len, ssid_len;
  328. bss = wpa_s->scan_res->res[i];
  329. ie = wpa_scan_get_ie(bss, WLAN_EID_SSID);
  330. ssid_ = ie ? ie + 2 : (u8 *) "";
  331. ssid_len = ie ? ie[1] : 0;
  332. ie = wpa_scan_get_vendor_ie(bss, WPA_IE_VENDOR_TYPE);
  333. wpa_ie_len = ie ? ie[1] : 0;
  334. ie = wpa_scan_get_ie(bss, WLAN_EID_RSN);
  335. rsn_ie_len = ie ? ie[1] : 0;
  336. wpa_printf(MSG_DEBUG, "%d: " MACSTR " ssid='%s' "
  337. "wpa_ie_len=%u rsn_ie_len=%u caps=0x%x",
  338. (int) i, MAC2STR(bss->bssid),
  339. wpa_ssid_txt(ssid_, ssid_len),
  340. wpa_ie_len, rsn_ie_len, bss->caps);
  341. e = wpa_blacklist_get(wpa_s, bss->bssid);
  342. if (e && e->count > 1) {
  343. wpa_printf(MSG_DEBUG, " skip - blacklisted");
  344. continue;
  345. }
  346. if (wpa_ie_len == 0 && rsn_ie_len == 0) {
  347. wpa_printf(MSG_DEBUG, " skip - no WPA/RSN IE");
  348. continue;
  349. }
  350. for (ssid = group; ssid; ssid = ssid->pnext) {
  351. int check_ssid = 1;
  352. if (ssid->disabled) {
  353. wpa_printf(MSG_DEBUG, " skip - disabled");
  354. continue;
  355. }
  356. #ifdef CONFIG_WPS
  357. if (ssid->ssid_len == 0 &&
  358. wpas_wps_ssid_wildcard_ok(wpa_s, ssid, bss))
  359. check_ssid = 0;
  360. #endif /* CONFIG_WPS */
  361. if (check_ssid &&
  362. (ssid_len != ssid->ssid_len ||
  363. os_memcmp(ssid_, ssid->ssid, ssid_len) != 0)) {
  364. wpa_printf(MSG_DEBUG, " skip - "
  365. "SSID mismatch");
  366. continue;
  367. }
  368. if (ssid->bssid_set &&
  369. os_memcmp(bss->bssid, ssid->bssid, ETH_ALEN) != 0)
  370. {
  371. wpa_printf(MSG_DEBUG, " skip - "
  372. "BSSID mismatch");
  373. continue;
  374. }
  375. if (!wpa_supplicant_ssid_bss_match(wpa_s, ssid, bss))
  376. continue;
  377. wpa_printf(MSG_DEBUG, " selected WPA AP "
  378. MACSTR " ssid='%s'",
  379. MAC2STR(bss->bssid),
  380. wpa_ssid_txt(ssid_, ssid_len));
  381. *selected_ssid = ssid;
  382. return bss;
  383. }
  384. }
  385. return NULL;
  386. }
  387. static struct wpa_scan_res *
  388. wpa_supplicant_select_bss_non_wpa(struct wpa_supplicant *wpa_s,
  389. struct wpa_ssid *group,
  390. struct wpa_ssid **selected_ssid)
  391. {
  392. struct wpa_ssid *ssid;
  393. struct wpa_scan_res *bss;
  394. size_t i;
  395. struct wpa_blacklist *e;
  396. const u8 *ie;
  397. wpa_printf(MSG_DEBUG, "Try to find non-WPA AP");
  398. for (i = 0; i < wpa_s->scan_res->num; i++) {
  399. const u8 *ssid_;
  400. u8 wpa_ie_len, rsn_ie_len, ssid_len;
  401. bss = wpa_s->scan_res->res[i];
  402. ie = wpa_scan_get_ie(bss, WLAN_EID_SSID);
  403. ssid_ = ie ? ie + 2 : (u8 *) "";
  404. ssid_len = ie ? ie[1] : 0;
  405. ie = wpa_scan_get_vendor_ie(bss, WPA_IE_VENDOR_TYPE);
  406. wpa_ie_len = ie ? ie[1] : 0;
  407. ie = wpa_scan_get_ie(bss, WLAN_EID_RSN);
  408. rsn_ie_len = ie ? ie[1] : 0;
  409. wpa_printf(MSG_DEBUG, "%d: " MACSTR " ssid='%s' "
  410. "wpa_ie_len=%u rsn_ie_len=%u caps=0x%x",
  411. (int) i, MAC2STR(bss->bssid),
  412. wpa_ssid_txt(ssid_, ssid_len),
  413. wpa_ie_len, rsn_ie_len, bss->caps);
  414. e = wpa_blacklist_get(wpa_s, bss->bssid);
  415. if (e && e->count > 1) {
  416. wpa_printf(MSG_DEBUG, " skip - blacklisted");
  417. continue;
  418. }
  419. for (ssid = group; ssid; ssid = ssid->pnext) {
  420. int check_ssid = ssid->ssid_len != 0;
  421. if (ssid->disabled) {
  422. wpa_printf(MSG_DEBUG, " skip - disabled");
  423. continue;
  424. }
  425. #ifdef CONFIG_WPS
  426. if (ssid->key_mgmt & WPA_KEY_MGMT_WPS) {
  427. /* Only allow wildcard SSID match if an AP
  428. * advertises active WPS operation that matches
  429. * with our mode. */
  430. check_ssid = 1;
  431. if (ssid->ssid_len == 0 &&
  432. wpas_wps_ssid_wildcard_ok(wpa_s, ssid,
  433. bss))
  434. check_ssid = 0;
  435. }
  436. #endif /* CONFIG_WPS */
  437. if (check_ssid &&
  438. (ssid_len != ssid->ssid_len ||
  439. os_memcmp(ssid_, ssid->ssid, ssid_len) != 0)) {
  440. wpa_printf(MSG_DEBUG, " skip - "
  441. "SSID mismatch");
  442. continue;
  443. }
  444. if (ssid->bssid_set &&
  445. os_memcmp(bss->bssid, ssid->bssid, ETH_ALEN) != 0)
  446. {
  447. wpa_printf(MSG_DEBUG, " skip - "
  448. "BSSID mismatch");
  449. continue;
  450. }
  451. if (!(ssid->key_mgmt & WPA_KEY_MGMT_NONE) &&
  452. !(ssid->key_mgmt & WPA_KEY_MGMT_WPS) &&
  453. !(ssid->key_mgmt & WPA_KEY_MGMT_IEEE8021X_NO_WPA))
  454. {
  455. wpa_printf(MSG_DEBUG, " skip - "
  456. "non-WPA network not allowed");
  457. continue;
  458. }
  459. if ((ssid->key_mgmt &
  460. (WPA_KEY_MGMT_IEEE8021X | WPA_KEY_MGMT_PSK |
  461. WPA_KEY_MGMT_FT_IEEE8021X | WPA_KEY_MGMT_FT_PSK |
  462. WPA_KEY_MGMT_IEEE8021X_SHA256 |
  463. WPA_KEY_MGMT_PSK_SHA256)) &&
  464. (wpa_ie_len != 0 || rsn_ie_len != 0)) {
  465. wpa_printf(MSG_DEBUG, " skip - "
  466. "WPA network");
  467. continue;
  468. }
  469. if (!wpa_supplicant_match_privacy(bss, ssid)) {
  470. wpa_printf(MSG_DEBUG, " skip - "
  471. "privacy mismatch");
  472. continue;
  473. }
  474. if (bss->caps & IEEE80211_CAP_IBSS) {
  475. wpa_printf(MSG_DEBUG, " skip - "
  476. "IBSS (adhoc) network");
  477. continue;
  478. }
  479. wpa_printf(MSG_DEBUG, " selected non-WPA AP "
  480. MACSTR " ssid='%s'",
  481. MAC2STR(bss->bssid),
  482. wpa_ssid_txt(ssid_, ssid_len));
  483. *selected_ssid = ssid;
  484. return bss;
  485. }
  486. }
  487. return NULL;
  488. }
  489. static struct wpa_scan_res *
  490. wpa_supplicant_select_bss(struct wpa_supplicant *wpa_s, struct wpa_ssid *group,
  491. struct wpa_ssid **selected_ssid)
  492. {
  493. struct wpa_scan_res *selected;
  494. wpa_printf(MSG_DEBUG, "Selecting BSS from priority group %d",
  495. group->priority);
  496. /* First, try to find WPA-enabled AP */
  497. selected = wpa_supplicant_select_bss_wpa(wpa_s, group, selected_ssid);
  498. if (selected)
  499. return selected;
  500. /* If no WPA-enabled AP found, try to find non-WPA AP, if configuration
  501. * allows this. */
  502. return wpa_supplicant_select_bss_non_wpa(wpa_s, group, selected_ssid);
  503. }
  504. static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s)
  505. {
  506. int prio, timeout;
  507. struct wpa_scan_res *selected = NULL;
  508. struct wpa_ssid *ssid = NULL;
  509. if (wpa_supplicant_get_scan_results(wpa_s) < 0) {
  510. if (wpa_s->conf->ap_scan == 2)
  511. return;
  512. wpa_printf(MSG_DEBUG, "Failed to get scan results - try "
  513. "scanning again");
  514. timeout = 1;
  515. goto req_scan;
  516. }
  517. /*
  518. * Don't post the results if this was the initial cached
  519. * and there were no results.
  520. */
  521. if (wpa_s->scan_res_tried == 1 && wpa_s->conf->ap_scan == 1 &&
  522. wpa_s->scan_res->num == 0) {
  523. wpa_msg(wpa_s, MSG_DEBUG, "Cached scan results are "
  524. "empty - not posting");
  525. } else {
  526. wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS);
  527. wpa_supplicant_dbus_notify_scan_results(wpa_s);
  528. wpas_wps_notify_scan_results(wpa_s);
  529. }
  530. if ((wpa_s->conf->ap_scan == 2 && !wpas_wps_searching(wpa_s)) ||
  531. wpa_s->disconnected)
  532. return;
  533. while (selected == NULL) {
  534. for (prio = 0; prio < wpa_s->conf->num_prio; prio++) {
  535. selected = wpa_supplicant_select_bss(
  536. wpa_s, wpa_s->conf->pssid[prio], &ssid);
  537. if (selected)
  538. break;
  539. }
  540. if (selected == NULL && wpa_s->blacklist) {
  541. wpa_printf(MSG_DEBUG, "No APs found - clear blacklist "
  542. "and try again");
  543. wpa_blacklist_clear(wpa_s);
  544. wpa_s->blacklist_cleared++;
  545. } else if (selected == NULL) {
  546. break;
  547. }
  548. }
  549. if (selected) {
  550. if (wpas_wps_scan_pbc_overlap(wpa_s, selected, ssid)) {
  551. wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_OVERLAP
  552. "PBC session overlap");
  553. timeout = 10;
  554. goto req_scan;
  555. }
  556. /* Do not trigger new association unless the BSSID has changed
  557. * or if reassociation is requested. If we are in process of
  558. * associating with the selected BSSID, do not trigger new
  559. * attempt. */
  560. if (wpa_s->reassociate ||
  561. (os_memcmp(selected->bssid, wpa_s->bssid, ETH_ALEN) != 0 &&
  562. (wpa_s->wpa_state != WPA_ASSOCIATING ||
  563. os_memcmp(selected->bssid, wpa_s->pending_bssid,
  564. ETH_ALEN) != 0))) {
  565. if (wpa_supplicant_scard_init(wpa_s, ssid)) {
  566. wpa_supplicant_req_scan(wpa_s, 10, 0);
  567. return;
  568. }
  569. wpa_supplicant_associate(wpa_s, selected, ssid);
  570. } else {
  571. wpa_printf(MSG_DEBUG, "Already associated with the "
  572. "selected AP.");
  573. }
  574. rsn_preauth_scan_results(wpa_s->wpa, wpa_s->scan_res);
  575. } else {
  576. wpa_printf(MSG_DEBUG, "No suitable AP found.");
  577. timeout = 5;
  578. goto req_scan;
  579. }
  580. return;
  581. req_scan:
  582. if (wpa_s->scan_res_tried == 1 && wpa_s->conf->ap_scan == 1) {
  583. /*
  584. * Quick recovery if the initial scan results were not
  585. * complete when fetched before the first scan request.
  586. */
  587. wpa_s->scan_res_tried++;
  588. timeout = 0;
  589. }
  590. wpa_supplicant_req_scan(wpa_s, timeout, 0);
  591. }
  592. #endif /* CONFIG_NO_SCAN_PROCESSING */
  593. static void wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s,
  594. union wpa_event_data *data)
  595. {
  596. int l, len, found = 0, wpa_found, rsn_found;
  597. u8 *p;
  598. wpa_printf(MSG_DEBUG, "Association info event");
  599. if (data->assoc_info.req_ies)
  600. wpa_hexdump(MSG_DEBUG, "req_ies", data->assoc_info.req_ies,
  601. data->assoc_info.req_ies_len);
  602. if (data->assoc_info.resp_ies)
  603. wpa_hexdump(MSG_DEBUG, "resp_ies", data->assoc_info.resp_ies,
  604. data->assoc_info.resp_ies_len);
  605. if (data->assoc_info.beacon_ies)
  606. wpa_hexdump(MSG_DEBUG, "beacon_ies",
  607. data->assoc_info.beacon_ies,
  608. data->assoc_info.beacon_ies_len);
  609. p = data->assoc_info.req_ies;
  610. l = data->assoc_info.req_ies_len;
  611. /* Go through the IEs and make a copy of the WPA/RSN IE, if present. */
  612. while (p && l >= 2) {
  613. len = p[1] + 2;
  614. if (len > l) {
  615. wpa_hexdump(MSG_DEBUG, "Truncated IE in assoc_info",
  616. p, l);
  617. break;
  618. }
  619. if ((p[0] == WLAN_EID_VENDOR_SPECIFIC && p[1] >= 6 &&
  620. (os_memcmp(&p[2], "\x00\x50\xF2\x01\x01\x00", 6) == 0)) ||
  621. (p[0] == WLAN_EID_RSN && p[1] >= 2)) {
  622. if (wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, p, len))
  623. break;
  624. found = 1;
  625. wpa_find_assoc_pmkid(wpa_s);
  626. break;
  627. }
  628. l -= len;
  629. p += len;
  630. }
  631. if (!found && data->assoc_info.req_ies)
  632. wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, NULL, 0);
  633. /* WPA/RSN IE from Beacon/ProbeResp */
  634. p = data->assoc_info.beacon_ies;
  635. l = data->assoc_info.beacon_ies_len;
  636. /* Go through the IEs and make a copy of the WPA/RSN IEs, if present.
  637. */
  638. wpa_found = rsn_found = 0;
  639. while (p && l >= 2) {
  640. len = p[1] + 2;
  641. if (len > l) {
  642. wpa_hexdump(MSG_DEBUG, "Truncated IE in beacon_ies",
  643. p, l);
  644. break;
  645. }
  646. if (!wpa_found &&
  647. p[0] == WLAN_EID_VENDOR_SPECIFIC && p[1] >= 6 &&
  648. os_memcmp(&p[2], "\x00\x50\xF2\x01\x01\x00", 6) == 0) {
  649. wpa_found = 1;
  650. wpa_sm_set_ap_wpa_ie(wpa_s->wpa, p, len);
  651. }
  652. if (!rsn_found &&
  653. p[0] == WLAN_EID_RSN && p[1] >= 2) {
  654. rsn_found = 1;
  655. wpa_sm_set_ap_rsn_ie(wpa_s->wpa, p, len);
  656. }
  657. l -= len;
  658. p += len;
  659. }
  660. if (!wpa_found && data->assoc_info.beacon_ies)
  661. wpa_sm_set_ap_wpa_ie(wpa_s->wpa, NULL, 0);
  662. if (!rsn_found && data->assoc_info.beacon_ies)
  663. wpa_sm_set_ap_rsn_ie(wpa_s->wpa, NULL, 0);
  664. if (wpa_found || rsn_found)
  665. wpa_s->ap_ies_from_associnfo = 1;
  666. }
  667. static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
  668. union wpa_event_data *data)
  669. {
  670. u8 bssid[ETH_ALEN];
  671. int ft_completed = wpa_ft_is_completed(wpa_s->wpa);
  672. if (data)
  673. wpa_supplicant_event_associnfo(wpa_s, data);
  674. wpa_supplicant_set_state(wpa_s, WPA_ASSOCIATED);
  675. if (wpa_s->use_client_mlme)
  676. os_memcpy(bssid, wpa_s->bssid, ETH_ALEN);
  677. if (wpa_s->use_client_mlme ||
  678. (wpa_drv_get_bssid(wpa_s, bssid) >= 0 &&
  679. os_memcmp(bssid, wpa_s->bssid, ETH_ALEN) != 0)) {
  680. wpa_msg(wpa_s, MSG_DEBUG, "Associated to a new BSS: BSSID="
  681. MACSTR, MAC2STR(bssid));
  682. os_memcpy(wpa_s->bssid, bssid, ETH_ALEN);
  683. os_memset(wpa_s->pending_bssid, 0, ETH_ALEN);
  684. if (wpa_supplicant_dynamic_keys(wpa_s) && !ft_completed) {
  685. wpa_clear_keys(wpa_s, bssid);
  686. }
  687. if (wpa_supplicant_select_config(wpa_s) < 0) {
  688. wpa_supplicant_disassociate(
  689. wpa_s, WLAN_REASON_DEAUTH_LEAVING);
  690. return;
  691. }
  692. }
  693. wpa_msg(wpa_s, MSG_INFO, "Associated with " MACSTR, MAC2STR(bssid));
  694. if (wpa_s->current_ssid) {
  695. /* When using scanning (ap_scan=1), SIM PC/SC interface can be
  696. * initialized before association, but for other modes,
  697. * initialize PC/SC here, if the current configuration needs
  698. * smartcard or SIM/USIM. */
  699. wpa_supplicant_scard_init(wpa_s, wpa_s->current_ssid);
  700. }
  701. wpa_sm_notify_assoc(wpa_s->wpa, bssid);
  702. l2_packet_notify_auth_start(wpa_s->l2);
  703. /*
  704. * Set portEnabled first to FALSE in order to get EAP state machine out
  705. * of the SUCCESS state and eapSuccess cleared. Without this, EAPOL PAE
  706. * state machine may transit to AUTHENTICATING state based on obsolete
  707. * eapSuccess and then trigger BE_AUTH to SUCCESS and PAE to
  708. * AUTHENTICATED without ever giving chance to EAP state machine to
  709. * reset the state.
  710. */
  711. if (!ft_completed) {
  712. eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
  713. eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
  714. }
  715. if (wpa_key_mgmt_wpa_psk(wpa_s->key_mgmt) || ft_completed)
  716. eapol_sm_notify_eap_success(wpa_s->eapol, FALSE);
  717. /* 802.1X::portControl = Auto */
  718. eapol_sm_notify_portEnabled(wpa_s->eapol, TRUE);
  719. wpa_s->eapol_received = 0;
  720. if (wpa_s->key_mgmt == WPA_KEY_MGMT_NONE ||
  721. wpa_s->key_mgmt == WPA_KEY_MGMT_WPA_NONE) {
  722. wpa_supplicant_cancel_auth_timeout(wpa_s);
  723. wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
  724. } else if (!ft_completed) {
  725. /* Timeout for receiving the first EAPOL packet */
  726. wpa_supplicant_req_auth_timeout(wpa_s, 10, 0);
  727. }
  728. wpa_supplicant_cancel_scan(wpa_s);
  729. if (wpa_s->driver_4way_handshake &&
  730. wpa_key_mgmt_wpa_psk(wpa_s->key_mgmt)) {
  731. /*
  732. * We are done; the driver will take care of RSN 4-way
  733. * handshake.
  734. */
  735. wpa_supplicant_cancel_auth_timeout(wpa_s);
  736. wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
  737. eapol_sm_notify_portValid(wpa_s->eapol, TRUE);
  738. eapol_sm_notify_eap_success(wpa_s->eapol, TRUE);
  739. }
  740. }
  741. static void wpa_supplicant_event_disassoc(struct wpa_supplicant *wpa_s)
  742. {
  743. const u8 *bssid;
  744. if (wpa_s->key_mgmt == WPA_KEY_MGMT_WPA_NONE) {
  745. /*
  746. * At least Host AP driver and a Prism3 card seemed to be
  747. * generating streams of disconnected events when configuring
  748. * IBSS for WPA-None. Ignore them for now.
  749. */
  750. wpa_printf(MSG_DEBUG, "Disconnect event - ignore in "
  751. "IBSS/WPA-None mode");
  752. return;
  753. }
  754. if (wpa_s->wpa_state == WPA_4WAY_HANDSHAKE &&
  755. wpa_key_mgmt_wpa_psk(wpa_s->key_mgmt)) {
  756. wpa_msg(wpa_s, MSG_INFO, "WPA: 4-Way Handshake failed - "
  757. "pre-shared key may be incorrect");
  758. }
  759. if (wpa_s->wpa_state >= WPA_ASSOCIATED)
  760. wpa_supplicant_req_scan(wpa_s, 0, 100000);
  761. bssid = wpa_s->bssid;
  762. if (is_zero_ether_addr(bssid))
  763. bssid = wpa_s->pending_bssid;
  764. wpa_blacklist_add(wpa_s, bssid);
  765. wpa_sm_notify_disassoc(wpa_s->wpa);
  766. wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_DISCONNECTED "- Disconnect event - "
  767. "remove keys");
  768. if (wpa_supplicant_dynamic_keys(wpa_s)) {
  769. wpa_s->keys_cleared = 0;
  770. wpa_clear_keys(wpa_s, wpa_s->bssid);
  771. }
  772. wpa_supplicant_mark_disassoc(wpa_s);
  773. }
  774. #ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
  775. static void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx,
  776. void *sock_ctx)
  777. {
  778. struct wpa_supplicant *wpa_s = eloop_ctx;
  779. if (!wpa_s->pending_mic_error_report)
  780. return;
  781. wpa_printf(MSG_DEBUG, "WPA: Sending pending MIC error report");
  782. wpa_sm_key_request(wpa_s->wpa, 1, wpa_s->pending_mic_error_pairwise);
  783. wpa_s->pending_mic_error_report = 0;
  784. }
  785. #endif /* CONFIG_DELAYED_MIC_ERROR_REPORT */
  786. static void
  787. wpa_supplicant_event_michael_mic_failure(struct wpa_supplicant *wpa_s,
  788. union wpa_event_data *data)
  789. {
  790. int pairwise;
  791. struct os_time t;
  792. wpa_msg(wpa_s, MSG_WARNING, "Michael MIC failure detected");
  793. pairwise = (data && data->michael_mic_failure.unicast);
  794. os_get_time(&t);
  795. if ((wpa_s->last_michael_mic_error &&
  796. t.sec - wpa_s->last_michael_mic_error <= 60) ||
  797. wpa_s->pending_mic_error_report) {
  798. if (wpa_s->pending_mic_error_report) {
  799. /*
  800. * Send the pending MIC error report immediately since
  801. * we are going to start countermeasures and AP better
  802. * do the same.
  803. */
  804. wpa_sm_key_request(wpa_s->wpa, 1,
  805. wpa_s->pending_mic_error_pairwise);
  806. }
  807. /* Send the new MIC error report immediately since we are going
  808. * to start countermeasures and AP better do the same.
  809. */
  810. wpa_sm_key_request(wpa_s->wpa, 1, pairwise);
  811. /* initialize countermeasures */
  812. wpa_s->countermeasures = 1;
  813. wpa_msg(wpa_s, MSG_WARNING, "TKIP countermeasures started");
  814. /*
  815. * Need to wait for completion of request frame. We do not get
  816. * any callback for the message completion, so just wait a
  817. * short while and hope for the best. */
  818. os_sleep(0, 10000);
  819. wpa_drv_set_countermeasures(wpa_s, 1);
  820. wpa_supplicant_deauthenticate(wpa_s,
  821. WLAN_REASON_MICHAEL_MIC_FAILURE);
  822. eloop_cancel_timeout(wpa_supplicant_stop_countermeasures,
  823. wpa_s, NULL);
  824. eloop_register_timeout(60, 0,
  825. wpa_supplicant_stop_countermeasures,
  826. wpa_s, NULL);
  827. /* TODO: mark the AP rejected for 60 second. STA is
  828. * allowed to associate with another AP.. */
  829. } else {
  830. #ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
  831. if (wpa_s->mic_errors_seen) {
  832. /*
  833. * Reduce the effectiveness of Michael MIC error
  834. * reports as a means for attacking against TKIP if
  835. * more than one MIC failure is noticed with the same
  836. * PTK. We delay the transmission of the reports by a
  837. * random time between 0 and 60 seconds in order to
  838. * force the attacker wait 60 seconds before getting
  839. * the information on whether a frame resulted in a MIC
  840. * failure.
  841. */
  842. u8 rval[4];
  843. int sec;
  844. if (os_get_random(rval, sizeof(rval)) < 0)
  845. sec = os_random() % 60;
  846. else
  847. sec = WPA_GET_BE32(rval) % 60;
  848. wpa_printf(MSG_DEBUG, "WPA: Delay MIC error report %d "
  849. "seconds", sec);
  850. wpa_s->pending_mic_error_report = 1;
  851. wpa_s->pending_mic_error_pairwise = pairwise;
  852. eloop_cancel_timeout(
  853. wpa_supplicant_delayed_mic_error_report,
  854. wpa_s, NULL);
  855. eloop_register_timeout(
  856. sec, os_random() % 1000000,
  857. wpa_supplicant_delayed_mic_error_report,
  858. wpa_s, NULL);
  859. } else {
  860. wpa_sm_key_request(wpa_s->wpa, 1, pairwise);
  861. }
  862. #else /* CONFIG_DELAYED_MIC_ERROR_REPORT */
  863. wpa_sm_key_request(wpa_s->wpa, 1, pairwise);
  864. #endif /* CONFIG_DELAYED_MIC_ERROR_REPORT */
  865. }
  866. wpa_s->last_michael_mic_error = t.sec;
  867. wpa_s->mic_errors_seen++;
  868. }
  869. static void
  870. wpa_supplicant_event_interface_status(struct wpa_supplicant *wpa_s,
  871. union wpa_event_data *data)
  872. {
  873. if (os_strcmp(wpa_s->ifname, data->interface_status.ifname) != 0)
  874. return;
  875. switch (data->interface_status.ievent) {
  876. case EVENT_INTERFACE_ADDED:
  877. if (!wpa_s->interface_removed)
  878. break;
  879. wpa_s->interface_removed = 0;
  880. wpa_printf(MSG_DEBUG, "Configured interface was added.");
  881. if (wpa_supplicant_driver_init(wpa_s) < 0) {
  882. wpa_printf(MSG_INFO, "Failed to initialize the driver "
  883. "after interface was added.");
  884. }
  885. break;
  886. case EVENT_INTERFACE_REMOVED:
  887. wpa_printf(MSG_DEBUG, "Configured interface was removed.");
  888. wpa_s->interface_removed = 1;
  889. wpa_supplicant_mark_disassoc(wpa_s);
  890. l2_packet_deinit(wpa_s->l2);
  891. wpa_s->l2 = NULL;
  892. break;
  893. }
  894. }
  895. #ifdef CONFIG_PEERKEY
  896. static void
  897. wpa_supplicant_event_stkstart(struct wpa_supplicant *wpa_s,
  898. union wpa_event_data *data)
  899. {
  900. if (data == NULL)
  901. return;
  902. wpa_sm_stkstart(wpa_s->wpa, data->stkstart.peer);
  903. }
  904. #endif /* CONFIG_PEERKEY */
  905. #ifdef CONFIG_IEEE80211R
  906. static void
  907. wpa_supplicant_event_ft_response(struct wpa_supplicant *wpa_s,
  908. union wpa_event_data *data)
  909. {
  910. if (data == NULL)
  911. return;
  912. if (wpa_ft_process_response(wpa_s->wpa, data->ft_ies.ies,
  913. data->ft_ies.ies_len,
  914. data->ft_ies.ft_action,
  915. data->ft_ies.target_ap) < 0) {
  916. /* TODO: prevent MLME/driver from trying to associate? */
  917. }
  918. }
  919. #endif /* CONFIG_IEEE80211R */
  920. #ifdef CONFIG_IBSS_RSN
  921. static void wpa_supplicant_event_ibss_rsn_start(struct wpa_supplicant *wpa_s,
  922. union wpa_event_data *data)
  923. {
  924. if (data == NULL)
  925. return;
  926. ibss_rsn_start(wpa_s->ibss_rsn, data->ibss_rsn_start.peer);
  927. }
  928. #endif /* CONFIG_IBSS_RSN */
  929. void wpa_supplicant_event(void *ctx, wpa_event_type event,
  930. union wpa_event_data *data)
  931. {
  932. struct wpa_supplicant *wpa_s = ctx;
  933. switch (event) {
  934. case EVENT_ASSOC:
  935. wpa_supplicant_event_assoc(wpa_s, data);
  936. break;
  937. case EVENT_DISASSOC:
  938. wpa_supplicant_event_disassoc(wpa_s);
  939. break;
  940. case EVENT_MICHAEL_MIC_FAILURE:
  941. wpa_supplicant_event_michael_mic_failure(wpa_s, data);
  942. break;
  943. #ifndef CONFIG_NO_SCAN_PROCESSING
  944. case EVENT_SCAN_RESULTS:
  945. wpa_supplicant_event_scan_results(wpa_s);
  946. break;
  947. #endif /* CONFIG_NO_SCAN_PROCESSING */
  948. case EVENT_ASSOCINFO:
  949. wpa_supplicant_event_associnfo(wpa_s, data);
  950. break;
  951. case EVENT_INTERFACE_STATUS:
  952. wpa_supplicant_event_interface_status(wpa_s, data);
  953. break;
  954. case EVENT_PMKID_CANDIDATE:
  955. wpa_supplicant_event_pmkid_candidate(wpa_s, data);
  956. break;
  957. #ifdef CONFIG_PEERKEY
  958. case EVENT_STKSTART:
  959. wpa_supplicant_event_stkstart(wpa_s, data);
  960. break;
  961. #endif /* CONFIG_PEERKEY */
  962. #ifdef CONFIG_IEEE80211R
  963. case EVENT_FT_RESPONSE:
  964. wpa_supplicant_event_ft_response(wpa_s, data);
  965. break;
  966. #endif /* CONFIG_IEEE80211R */
  967. #ifdef CONFIG_IBSS_RSN
  968. case EVENT_IBSS_RSN_START:
  969. wpa_supplicant_event_ibss_rsn_start(wpa_s, data);
  970. break;
  971. #endif /* CONFIG_IBSS_RSN */
  972. default:
  973. wpa_printf(MSG_INFO, "Unknown event %d", event);
  974. break;
  975. }
  976. }