Lines Matching refs:imsi

163 		if (cred->pcsc || cred->imsi)  in cred_with_3gpp()
175 if (cred->pcsc || cred->imsi) in cred_with_nai_realm()
191 if (cred->domain || cred->pcsc || cred->imsi || in cred_with_domain()
730 static int plmn_id_match(struct wpabuf *anqp, const char *imsi, int mnc_len) in plmn_id_match() argument
748 plmn[0] = (imsi[0] - '0') | ((imsi[1] - '0') << 4); in plmn_id_match()
749 plmn[1] = (imsi[2] - '0') | ((imsi[5] - '0') << 4); in plmn_id_match()
750 plmn[2] = (imsi[3] - '0') | ((imsi[4] - '0') << 4); in plmn_id_match()
752 plmn2[0] = (imsi[0] - '0') | ((imsi[1] - '0') << 4); in plmn_id_match()
753 plmn2[1] = (imsi[2] - '0') | 0xf0; in plmn_id_match()
754 plmn2[2] = (imsi[3] - '0') | ((imsi[4] - '0') << 4); in plmn_id_match()
776 imsi, mnc_len); in plmn_id_match()
813 static int build_root_nai(char *nai, size_t nai_len, const char *imsi, in build_root_nai() argument
827 if (imsi == NULL || os_strlen(imsi) > 16) { in build_root_nai()
831 sep = os_strchr(imsi, '-'); in build_root_nai()
833 plmn_len = sep - imsi; in build_root_nai()
835 } else if (mnc_len && os_strlen(imsi) >= 3 + mnc_len) { in build_root_nai()
837 msin = imsi + plmn_len; in build_root_nai()
848 os_memcpy(pos, imsi, plmn_len); in build_root_nai()
855 *pos++ = imsi[3]; in build_root_nai()
856 *pos++ = imsi[4]; in build_root_nai()
858 *pos++ = imsi[3]; in build_root_nai()
859 *pos++ = imsi[4]; in build_root_nai()
860 *pos++ = imsi[5]; in build_root_nai()
863 imsi[0], imsi[1], imsi[2]); in build_root_nai()
869 static int set_root_nai(struct wpa_ssid *ssid, const char *imsi, char prefix) in set_root_nai() argument
872 if (build_root_nai(nai, sizeof(nai), imsi, 0, prefix) < 0) in set_root_nai()
1044 if (!cred->pcsc && set_root_nai(ssid, cred->imsi, prefix) < 0) { in interworking_connect_3gpp()
1904 if (wpa_s->imsi[0] && wpa_s->mnc_len) in interworking_pcsc_read_imsi()
1907 len = sizeof(wpa_s->imsi) - 1; in interworking_pcsc_read_imsi()
1908 if (scard_get_imsi(wpa_s->scard, wpa_s->imsi, &len)) { in interworking_pcsc_read_imsi()
1914 wpa_s->imsi[len] = '\0'; in interworking_pcsc_read_imsi()
1917 wpa_s->imsi, wpa_s->mnc_len); in interworking_pcsc_read_imsi()
1942 if (!wpa_s->imsi[0]) { in interworking_credentials_available_3gpp()
1947 wpa_s->imsi, in interworking_credentials_available_3gpp()
1950 wpa_s->imsi[len] = '\0'; in interworking_credentials_available_3gpp()
1953 wpa_s->imsi, wpa_s->mnc_len); in interworking_credentials_available_3gpp()
1963 const char *imsi; in interworking_credentials_available_3gpp() local
1972 imsi = wpa_s->imsi; in interworking_credentials_available_3gpp()
1978 if (cred->pcsc && wpa_s->mnc_len > 0 && wpa_s->imsi[0]) { in interworking_credentials_available_3gpp()
1979 imsi = wpa_s->imsi; in interworking_credentials_available_3gpp()
1985 if (cred->imsi == NULL || !cred->imsi[0] || in interworking_credentials_available_3gpp()
1990 sep = os_strchr(cred->imsi, '-'); in interworking_credentials_available_3gpp()
1992 (sep - cred->imsi != 5 && sep - cred->imsi != 6)) in interworking_credentials_available_3gpp()
1994 mnc_len = sep - cred->imsi - 3; in interworking_credentials_available_3gpp()
1995 os_memcpy(imsi_buf, cred->imsi, 3 + mnc_len); in interworking_credentials_available_3gpp()
1997 msin_len = os_strlen(cred->imsi); in interworking_credentials_available_3gpp()
2002 imsi = imsi_buf; in interworking_credentials_available_3gpp()
2010 ret = plmn_id_match(bss->anqp->anqp_3gpp, imsi, mnc_len); in interworking_credentials_available_3gpp()
2233 char *imsi = NULL; in interworking_home_sp_cred() local
2235 if (cred->imsi) in interworking_home_sp_cred()
2236 imsi = cred->imsi; in interworking_home_sp_cred()
2241 imsi = wpa_s->imsi; in interworking_home_sp_cred()
2246 else if (cred->pcsc && wpa_s->mnc_len > 0 && wpa_s->imsi[0]) { in interworking_home_sp_cred()
2247 imsi = wpa_s->imsi; in interworking_home_sp_cred()
2252 imsi && build_root_nai(nai, sizeof(nai), imsi, mnc_len, 0) == 0) { in interworking_home_sp_cred()