]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Interworking: Init scard when a credential requires SIM access
authorJean Trivelly <jean.trivelly@intel.com>
Fri, 28 Mar 2014 13:41:36 +0000 (14:41 +0100)
committerJouni Malinen <j@w1.fi>
Mon, 31 Mar 2014 20:35:08 +0000 (23:35 +0300)
When an ANQP fetch is triggered and ANQP_3GPP_CELLULAR_NETWORK info is
required, initialize scard to be ready when comparing ANQP and
credentials.

Signed-off-by: Jean Trivelly <jean.trivelly@intel.com>
wpa_supplicant/events.c
wpa_supplicant/interworking.c

index e9a4a8cb446753b80eb42e9e28c6cd252fb46f65..3a6d42769b79da0e67dd527df876eb6d284baa04 100644 (file)
@@ -303,11 +303,11 @@ int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
 #ifdef PCSC_FUNCS
        int aka = 0, sim = 0;
 
-       if (ssid->eap.pcsc == NULL || wpa_s->scard != NULL ||
-           wpa_s->conf->external_sim)
+       if ((ssid != NULL && ssid->eap.pcsc == NULL) ||
+           wpa_s->scard != NULL || wpa_s->conf->external_sim)
                return 0;
 
-       if (ssid->eap.eap_methods == NULL) {
+       if (ssid == NULL || ssid->eap.eap_methods == NULL) {
                sim = 1;
                aka = 1;
        } else {
index 662e7293539b71f5c6e4652c7909688358ff7136..bb96113320c3b8d56da1f9e30b42332f450bf50c 100644 (file)
@@ -260,8 +260,10 @@ static int interworking_anqp_send_req(struct wpa_supplicant *wpa_s,
                info_ids[num_info_ids++] = ANQP_IP_ADDR_TYPE_AVAILABILITY;
        if (all || cred_with_nai_realm(wpa_s))
                info_ids[num_info_ids++] = ANQP_NAI_REALM;
-       if (all || cred_with_3gpp(wpa_s))
+       if (all || cred_with_3gpp(wpa_s)) {
                info_ids[num_info_ids++] = ANQP_3GPP_CELLULAR_NETWORK;
+               wpa_supplicant_scard_init(wpa_s, NULL);
+       }
        if (all || cred_with_domain(wpa_s))
                info_ids[num_info_ids++] = ANQP_DOMAIN_NAME;
        wpa_hexdump(MSG_DEBUG, "Interworking: ANQP Query info",