Home | History | Annotate | Download | only in wpa_supplicant

Lines Matching defs:imsi

159 		if (cred->pcsc || cred->imsi)
171 if (cred->pcsc || cred->imsi)
187 if (cred->domain || cred->pcsc || cred->imsi ||
724 static int plmn_id_match(struct wpabuf *anqp, const char *imsi, int mnc_len)
742 plmn[0] = (imsi[0] - '0') | ((imsi[1] - '0') << 4);
743 plmn[1] = (imsi[2] - '0') | ((imsi[5] - '0') << 4);
744 plmn[2] = (imsi[3] - '0') | ((imsi[4] - '0') << 4);
746 plmn2[0] = (imsi[0] - '0') | ((imsi[1] - '0') << 4);
747 plmn2[1] = (imsi[2] - '0') | 0xf0;
748 plmn2[2] = (imsi[3] - '0') | ((imsi[4] - '0') << 4);
768 wpa_printf(MSG_DEBUG, "Interworking: Matching against MCC/MNC alternatives: %02x:%02x:%02x or %02x:%02x:%02x (IMSI %s, MNC length %d)",
770 imsi, mnc_len);
807 static int build_root_nai(char *nai, size_t nai_len, const char *imsi,
817 * <aka:0|sim:1><IMSI>@wlan.mnc<MNC>.mcc<MCC>.3gppnetwork.org
821 if (imsi == NULL || os_strlen(imsi) > 16) {
822 wpa_printf(MSG_DEBUG, "No valid IMSI available");
825 sep = os_strchr(imsi, '-');
827 plmn_len = sep - imsi;
829 } else if (mnc_len && os_strlen(imsi) >= 3 + mnc_len) {
831 msin = imsi + plmn_len;
842 os_memcpy(pos, imsi, plmn_len);
849 *pos++ = imsi[3];
850 *pos++ = imsi[4];
852 *pos++ = imsi[3];
853 *pos++ = imsi[4];
854 *pos++ = imsi[5];
857 imsi[0], imsi[1], imsi[2]);
863 static int set_root_nai(struct wpa_ssid *ssid, const char *imsi, char prefix)
866 if (build_root_nai(nai, sizeof(nai), imsi, 0, prefix) < 0)
1037 if (!cred->pcsc && set_root_nai(ssid, cred->imsi, prefix) < 0) {
1855 if (wpa_s->imsi[0] && wpa_s->mnc_len)
1858 len = sizeof(wpa_s->imsi) - 1;
1859 if (scard_get_imsi(wpa_s->scard, wpa_s->imsi, &len)) {
1862 wpa_msg(wpa_s, MSG_ERROR, "Could not read IMSI");
1865 wpa_s->imsi[len] = '\0';
1867 wpa_printf(MSG_DEBUG, "SCARD: IMSI %s (MNC length %d)",
1868 wpa_s->imsi, wpa_s->mnc_len);
1893 if (!wpa_s->imsi[0]) {
1896 "Interworking: IMSI not available - try to read again through eap_proxy");
1898 wpa_s->imsi,
1901 wpa_s->imsi[len] = '\0';
1903 "eap_proxy: IMSI %s (MNC length %d)",
1904 wpa_s->imsi, wpa_s->mnc_len);
1907 "eap_proxy: IMSI not available");
1914 const char *imsi;
1923 imsi = wpa_s->imsi;
1929 if (cred->pcsc && wpa_s->mnc_len > 0 && wpa_s->imsi[0]) {
1930 imsi = wpa_s->imsi;
1936 if (cred->imsi == NULL || !cred->imsi[0] ||
1941 sep = os_strchr(cred->imsi, '-');
1943 (sep - cred->imsi != 5 && sep - cred->imsi != 6))
1945 mnc_len = sep - cred->imsi - 3;
1946 os_memcpy(imsi_buf, cred->imsi, 3 + mnc_len);
1948 msin_len = os_strlen(cred->imsi);
1953 imsi = imsi_buf;
1961 ret = plmn_id_match(bss->anqp->anqp_3gpp, imsi, mnc_len);
2184 char *imsi = NULL;
2186 if (cred->imsi)
2187 imsi = cred->imsi;
2192 imsi = wpa_s->imsi;
2197 else if (cred->pcsc && wpa_s->mnc_len > 0 && wpa_s->imsi[0]) {
2198 imsi = wpa_s->imsi;
2203 imsi && build_root_nai(nai, sizeof(nai), imsi, mnc_len, 0) == 0) {