automake build system
[mech_eap.orig] / src / rsn_supp / wpa.c
index 09b1619..9439f97 100644 (file)
@@ -231,6 +231,7 @@ static int wpa_supplicant_get_pmk(struct wpa_sm *sm,
                        wpa_sm_ether_send(sm, sm->bssid, ETH_P_EAPOL,
                                          buf, buflen);
                        os_free(buf);
+                       return -2;
                }
 
                return -1;
@@ -361,6 +362,7 @@ static void wpa_supplicant_process_1_of_4(struct wpa_sm *sm,
        struct wpa_eapol_ie_parse ie;
        struct wpa_ptk *ptk;
        u8 buf[8];
+       int res;
 
        if (wpa_sm_get_network_ctx(sm) == NULL) {
                wpa_printf(MSG_WARNING, "WPA: No SSID info found (msg 1 of "
@@ -388,7 +390,13 @@ static void wpa_supplicant_process_1_of_4(struct wpa_sm *sm,
        }
 #endif /* CONFIG_NO_WPA2 */
 
-       if (wpa_supplicant_get_pmk(sm, src_addr, ie.pmkid))
+       res = wpa_supplicant_get_pmk(sm, src_addr, ie.pmkid);
+       if (res == -2) {
+               wpa_printf(MSG_DEBUG, "RSN: Do not reply to msg 1/4 - "
+                          "requesting full EAP authentication");
+               return;
+       }
+       if (res)
                goto failed;
 
        if (sm->renew_snonce) {
@@ -2548,3 +2556,11 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
        os_memset(&sm->ptk, 0, sizeof(sm->ptk));
        os_memset(&sm->tptk, 0, sizeof(sm->tptk));
 }
+
+
+int wpa_sm_has_ptk(struct wpa_sm *sm)
+{
+       if (sm == NULL)
+               return 0;
+       return sm->ptk_set;
+}