Lines Matching refs:imsi
128 if (cred->pcsc || cred->imsi) in cred_with_3gpp()
140 if (cred->pcsc || cred->imsi) in cred_with_nai_realm()
156 if (cred->domain || cred->pcsc || cred->imsi) in cred_with_domain()
590 static int plmn_id_match(struct wpabuf *anqp, const char *imsi, int mnc_len) in plmn_id_match() argument
597 plmn[0] = (imsi[0] - '0') | ((imsi[1] - '0') << 4); in plmn_id_match()
598 plmn[1] = imsi[2] - '0'; in plmn_id_match()
601 plmn[1] |= (imsi[5] - '0') << 4; in plmn_id_match()
604 plmn[2] = (imsi[3] - '0') | ((imsi[4] - '0') << 4); in plmn_id_match()
653 static int build_root_nai(char *nai, size_t nai_len, const char *imsi, in build_root_nai() argument
667 if (imsi == NULL || os_strlen(imsi) > 16) { in build_root_nai()
671 sep = os_strchr(imsi, '-'); in build_root_nai()
673 plmn_len = sep - imsi; in build_root_nai()
675 } else if (mnc_len && os_strlen(imsi) >= 3 + mnc_len) { in build_root_nai()
677 msin = imsi + plmn_len; in build_root_nai()
688 os_memcpy(pos, imsi, plmn_len); in build_root_nai()
695 *pos++ = imsi[3]; in build_root_nai()
696 *pos++ = imsi[4]; in build_root_nai()
698 *pos++ = imsi[3]; in build_root_nai()
699 *pos++ = imsi[4]; in build_root_nai()
700 *pos++ = imsi[5]; in build_root_nai()
703 imsi[0], imsi[1], imsi[2]); in build_root_nai()
709 static int set_root_nai(struct wpa_ssid *ssid, const char *imsi, char prefix) in set_root_nai() argument
712 if (build_root_nai(nai, sizeof(nai), imsi, 0, prefix) < 0) in set_root_nai()
748 const char *imsi; in interworking_connect_3gpp() local
753 wpa_s->imsi[0]) { in interworking_connect_3gpp()
754 imsi = wpa_s->imsi; in interworking_connect_3gpp()
760 if (cred->imsi == NULL || !cred->imsi[0] || in interworking_connect_3gpp()
764 sep = os_strchr(cred->imsi, '-'); in interworking_connect_3gpp()
766 (sep - cred->imsi != 5 && sep - cred->imsi != 6)) in interworking_connect_3gpp()
768 mnc_len = sep - cred->imsi - 3; in interworking_connect_3gpp()
769 imsi = cred->imsi; in interworking_connect_3gpp()
774 if (plmn_id_match(bss->anqp->anqp_3gpp, imsi, mnc_len)) in interworking_connect_3gpp()
836 if (!cred->pcsc && set_root_nai(ssid, cred->imsi, prefix) < 0) { in interworking_connect_3gpp()
1292 const char *imsi; in interworking_credentials_available_3gpp() local
1297 wpa_s->imsi[0]) { in interworking_credentials_available_3gpp()
1298 imsi = wpa_s->imsi; in interworking_credentials_available_3gpp()
1304 if (cred->imsi == NULL || !cred->imsi[0] || in interworking_credentials_available_3gpp()
1308 sep = os_strchr(cred->imsi, '-'); in interworking_credentials_available_3gpp()
1310 (sep - cred->imsi != 5 && sep - cred->imsi != 6)) in interworking_credentials_available_3gpp()
1312 mnc_len = sep - cred->imsi - 3; in interworking_credentials_available_3gpp()
1313 imsi = cred->imsi; in interworking_credentials_available_3gpp()
1320 ret = plmn_id_match(bss->anqp->anqp_3gpp, imsi, mnc_len); in interworking_credentials_available_3gpp()
1440 char *imsi = NULL; in interworking_home_sp() local
1442 if (cred->imsi) in interworking_home_sp()
1443 imsi = cred->imsi; in interworking_home_sp()
1446 wpa_s->scard && wpa_s->imsi[0]) { in interworking_home_sp()
1447 imsi = wpa_s->imsi; in interworking_home_sp()
1451 if (imsi && build_root_nai(nai, sizeof(nai), imsi, mnc_len, 0) in interworking_home_sp()