Lines Matching refs:cred

2246 void wpa_config_free_cred(struct wpa_cred *cred)  in wpa_config_free_cred()  argument
2250 os_free(cred->realm); in wpa_config_free_cred()
2251 str_clear_free(cred->username); in wpa_config_free_cred()
2252 str_clear_free(cred->password); in wpa_config_free_cred()
2253 os_free(cred->ca_cert); in wpa_config_free_cred()
2254 os_free(cred->client_cert); in wpa_config_free_cred()
2255 os_free(cred->private_key); in wpa_config_free_cred()
2256 str_clear_free(cred->private_key_passwd); in wpa_config_free_cred()
2257 os_free(cred->imsi); in wpa_config_free_cred()
2258 str_clear_free(cred->milenage); in wpa_config_free_cred()
2259 for (i = 0; i < cred->num_domain; i++) in wpa_config_free_cred()
2260 os_free(cred->domain[i]); in wpa_config_free_cred()
2261 os_free(cred->domain); in wpa_config_free_cred()
2262 os_free(cred->domain_suffix_match); in wpa_config_free_cred()
2263 os_free(cred->eap_method); in wpa_config_free_cred()
2264 os_free(cred->phase1); in wpa_config_free_cred()
2265 os_free(cred->phase2); in wpa_config_free_cred()
2266 os_free(cred->excluded_ssid); in wpa_config_free_cred()
2267 os_free(cred->roaming_partner); in wpa_config_free_cred()
2268 os_free(cred->provisioning_sp); in wpa_config_free_cred()
2269 for (i = 0; i < cred->num_req_conn_capab; i++) in wpa_config_free_cred()
2270 os_free(cred->req_conn_capab_port[i]); in wpa_config_free_cred()
2271 os_free(cred->req_conn_capab_port); in wpa_config_free_cred()
2272 os_free(cred->req_conn_capab_proto); in wpa_config_free_cred()
2273 os_free(cred); in wpa_config_free_cred()
2303 struct wpa_cred *cred, *cprev; in wpa_config_free() local
2313 cred = config->cred; in wpa_config_free()
2314 while (cred) { in wpa_config_free()
2315 cprev = cred; in wpa_config_free()
2316 cred = cred->next; in wpa_config_free()
2781 static int wpa_config_set_cred_req_conn_capab(struct wpa_cred *cred, in wpa_config_set_cred_req_conn_capab() argument
2790 proto = os_realloc_array(cred->req_conn_capab_proto, in wpa_config_set_cred_req_conn_capab()
2791 cred->num_req_conn_capab + 1, sizeof(u8)); in wpa_config_set_cred_req_conn_capab()
2794 cred->req_conn_capab_proto = proto; in wpa_config_set_cred_req_conn_capab()
2796 port = os_realloc_array(cred->req_conn_capab_port, in wpa_config_set_cred_req_conn_capab()
2797 cred->num_req_conn_capab + 1, sizeof(int *)); in wpa_config_set_cred_req_conn_capab()
2800 cred->req_conn_capab_port = port; in wpa_config_set_cred_req_conn_capab()
2802 proto[cred->num_req_conn_capab] = atoi(value); in wpa_config_set_cred_req_conn_capab()
2806 port[cred->num_req_conn_capab] = NULL; in wpa_config_set_cred_req_conn_capab()
2807 cred->num_req_conn_capab++; in wpa_config_set_cred_req_conn_capab()
2838 port[cred->num_req_conn_capab] = ports; in wpa_config_set_cred_req_conn_capab()
2839 cred->num_req_conn_capab++; in wpa_config_set_cred_req_conn_capab()
2844 int wpa_config_set_cred(struct wpa_cred *cred, const char *var, in wpa_config_set_cred() argument
2851 cred->temporary = atoi(value); in wpa_config_set_cred()
2856 cred->priority = atoi(value); in wpa_config_set_cred()
2864 cred->sp_priority = prio; in wpa_config_set_cred()
2869 cred->pcsc = atoi(value); in wpa_config_set_cred()
2882 os_free(cred->eap_method); in wpa_config_set_cred()
2883 cred->eap_method = os_malloc(sizeof(*cred->eap_method)); in wpa_config_set_cred()
2884 if (cred->eap_method == NULL) in wpa_config_set_cred()
2886 os_memcpy(cred->eap_method, &method, sizeof(method)); in wpa_config_set_cred()
2892 str_clear_free(cred->password); in wpa_config_set_cred()
2893 cred->password = os_strdup(value); in wpa_config_set_cred()
2894 cred->ext_password = 1; in wpa_config_set_cred()
2899 cred->update_identifier = atoi(value); in wpa_config_set_cred()
2904 cred->min_dl_bandwidth_home = atoi(value); in wpa_config_set_cred()
2909 cred->min_ul_bandwidth_home = atoi(value); in wpa_config_set_cred()
2914 cred->min_dl_bandwidth_roaming = atoi(value); in wpa_config_set_cred()
2919 cred->min_ul_bandwidth_roaming = atoi(value); in wpa_config_set_cred()
2924 cred->max_bss_load = atoi(value); in wpa_config_set_cred()
2929 return wpa_config_set_cred_req_conn_capab(cred, value); in wpa_config_set_cred()
2932 cred->ocsp = atoi(value); in wpa_config_set_cred()
2937 cred->sim_num = atoi(value); in wpa_config_set_cred()
2949 os_free(cred->realm); in wpa_config_set_cred()
2950 cred->realm = val; in wpa_config_set_cred()
2955 str_clear_free(cred->username); in wpa_config_set_cred()
2956 cred->username = val; in wpa_config_set_cred()
2961 str_clear_free(cred->password); in wpa_config_set_cred()
2962 cred->password = val; in wpa_config_set_cred()
2963 cred->ext_password = 0; in wpa_config_set_cred()
2968 os_free(cred->ca_cert); in wpa_config_set_cred()
2969 cred->ca_cert = val; in wpa_config_set_cred()
2974 os_free(cred->client_cert); in wpa_config_set_cred()
2975 cred->client_cert = val; in wpa_config_set_cred()
2980 os_free(cred->private_key); in wpa_config_set_cred()
2981 cred->private_key = val; in wpa_config_set_cred()
2986 str_clear_free(cred->private_key_passwd); in wpa_config_set_cred()
2987 cred->private_key_passwd = val; in wpa_config_set_cred()
2992 os_free(cred->imsi); in wpa_config_set_cred()
2993 cred->imsi = val; in wpa_config_set_cred()
2998 str_clear_free(cred->milenage); in wpa_config_set_cred()
2999 cred->milenage = val; in wpa_config_set_cred()
3004 os_free(cred->domain_suffix_match); in wpa_config_set_cred()
3005 cred->domain_suffix_match = val; in wpa_config_set_cred()
3011 new_domain = os_realloc_array(cred->domain, in wpa_config_set_cred()
3012 cred->num_domain + 1, in wpa_config_set_cred()
3018 new_domain[cred->num_domain++] = val; in wpa_config_set_cred()
3019 cred->domain = new_domain; in wpa_config_set_cred()
3024 os_free(cred->phase1); in wpa_config_set_cred()
3025 cred->phase1 = val; in wpa_config_set_cred()
3030 os_free(cred->phase2); in wpa_config_set_cred()
3031 cred->phase2 = val; in wpa_config_set_cred()
3036 if (len < 3 || len > sizeof(cred->roaming_consortium)) { in wpa_config_set_cred()
3043 os_memcpy(cred->roaming_consortium, val, len); in wpa_config_set_cred()
3044 cred->roaming_consortium_len = len; in wpa_config_set_cred()
3050 if (len < 3 || len > sizeof(cred->required_roaming_consortium)) in wpa_config_set_cred()
3058 os_memcpy(cred->required_roaming_consortium, val, len); in wpa_config_set_cred()
3059 cred->required_roaming_consortium_len = len; in wpa_config_set_cred()
3074 e = os_realloc_array(cred->excluded_ssid, in wpa_config_set_cred()
3075 cred->num_excluded_ssid + 1, in wpa_config_set_cred()
3081 cred->excluded_ssid = e; in wpa_config_set_cred()
3083 e = &cred->excluded_ssid[cred->num_excluded_ssid++]; in wpa_config_set_cred()
3096 p = os_realloc_array(cred->roaming_partner, in wpa_config_set_cred()
3097 cred->num_roaming_partner + 1, in wpa_config_set_cred()
3103 cred->roaming_partner = p; in wpa_config_set_cred()
3105 p = &cred->roaming_partner[cred->num_roaming_partner]; in wpa_config_set_cred()
3143 cred->num_roaming_partner++; in wpa_config_set_cred()
3150 os_free(cred->provisioning_sp); in wpa_config_set_cred()
3151 cred->provisioning_sp = val; in wpa_config_set_cred()
3192 char * wpa_config_get_cred_no_key(struct wpa_cred *cred, const char *var) in wpa_config_get_cred_no_key() argument
3195 return alloc_int_str(cred->temporary); in wpa_config_get_cred_no_key()
3198 return alloc_int_str(cred->priority); in wpa_config_get_cred_no_key()
3201 return alloc_int_str(cred->sp_priority); in wpa_config_get_cred_no_key()
3204 return alloc_int_str(cred->pcsc); in wpa_config_get_cred_no_key()
3207 if (!cred->eap_method) in wpa_config_get_cred_no_key()
3209 return alloc_strdup(eap_get_name(cred->eap_method[0].vendor, in wpa_config_get_cred_no_key()
3210 cred->eap_method[0].method)); in wpa_config_get_cred_no_key()
3214 return alloc_int_str(cred->update_identifier); in wpa_config_get_cred_no_key()
3217 return alloc_int_str(cred->min_dl_bandwidth_home); in wpa_config_get_cred_no_key()
3220 return alloc_int_str(cred->min_ul_bandwidth_home); in wpa_config_get_cred_no_key()
3223 return alloc_int_str(cred->min_dl_bandwidth_roaming); in wpa_config_get_cred_no_key()
3226 return alloc_int_str(cred->min_ul_bandwidth_roaming); in wpa_config_get_cred_no_key()
3229 return alloc_int_str(cred->max_bss_load); in wpa_config_get_cred_no_key()
3236 if (!cred->num_req_conn_capab) in wpa_config_get_cred_no_key()
3244 for (i = 0; i < cred->num_req_conn_capab; i++) { in wpa_config_get_cred_no_key()
3249 cred->req_conn_capab_proto[i]); in wpa_config_get_cred_no_key()
3254 ports = cred->req_conn_capab_port[i]; in wpa_config_get_cred_no_key()
3273 return alloc_int_str(cred->ocsp); in wpa_config_get_cred_no_key()
3276 return alloc_strdup(cred->realm); in wpa_config_get_cred_no_key()
3279 return alloc_strdup(cred->username); in wpa_config_get_cred_no_key()
3282 if (!cred->password) in wpa_config_get_cred_no_key()
3288 return alloc_strdup(cred->ca_cert); in wpa_config_get_cred_no_key()
3291 return alloc_strdup(cred->client_cert); in wpa_config_get_cred_no_key()
3294 return alloc_strdup(cred->private_key); in wpa_config_get_cred_no_key()
3297 if (!cred->private_key_passwd) in wpa_config_get_cred_no_key()
3303 return alloc_strdup(cred->imsi); in wpa_config_get_cred_no_key()
3306 if (!(cred->milenage)) in wpa_config_get_cred_no_key()
3312 return alloc_strdup(cred->domain_suffix_match); in wpa_config_get_cred_no_key()
3319 if (!cred->num_domain) in wpa_config_get_cred_no_key()
3328 for (i = 0; i < cred->num_domain; i++) { in wpa_config_get_cred_no_key()
3330 i > 0 ? "\n" : "", cred->domain[i]); in wpa_config_get_cred_no_key()
3340 return alloc_strdup(cred->phase1); in wpa_config_get_cred_no_key()
3343 return alloc_strdup(cred->phase2); in wpa_config_get_cred_no_key()
3349 if (!cred->roaming_consortium_len) in wpa_config_get_cred_no_key()
3351 buflen = cred->roaming_consortium_len * 2 + 1; in wpa_config_get_cred_no_key()
3355 wpa_snprintf_hex(buf, buflen, cred->roaming_consortium, in wpa_config_get_cred_no_key()
3356 cred->roaming_consortium_len); in wpa_config_get_cred_no_key()
3364 if (!cred->required_roaming_consortium_len) in wpa_config_get_cred_no_key()
3366 buflen = cred->required_roaming_consortium_len * 2 + 1; in wpa_config_get_cred_no_key()
3370 wpa_snprintf_hex(buf, buflen, cred->required_roaming_consortium, in wpa_config_get_cred_no_key()
3371 cred->required_roaming_consortium_len); in wpa_config_get_cred_no_key()
3379 if (!cred->num_excluded_ssid) in wpa_config_get_cred_no_key()
3388 for (i = 0; i < cred->num_excluded_ssid; i++) { in wpa_config_get_cred_no_key()
3392 e = &cred->excluded_ssid[i]; in wpa_config_get_cred_no_key()
3408 if (!cred->num_roaming_partner) in wpa_config_get_cred_no_key()
3417 for (i = 0; i < cred->num_roaming_partner; i++) { in wpa_config_get_cred_no_key()
3421 p = &cred->roaming_partner[i]; in wpa_config_get_cred_no_key()
3435 return alloc_strdup(cred->provisioning_sp); in wpa_config_get_cred_no_key()
3443 struct wpa_cred *cred; in wpa_config_get_cred() local
3445 cred = config->cred; in wpa_config_get_cred()
3446 while (cred) { in wpa_config_get_cred()
3447 if (id == cred->id) in wpa_config_get_cred()
3449 cred = cred->next; in wpa_config_get_cred()
3452 return cred; in wpa_config_get_cred()
3459 struct wpa_cred *cred, *last = NULL; in wpa_config_add_cred() local
3462 cred = config->cred; in wpa_config_add_cred()
3463 while (cred) { in wpa_config_add_cred()
3464 if (cred->id > id) in wpa_config_add_cred()
3465 id = cred->id; in wpa_config_add_cred()
3466 last = cred; in wpa_config_add_cred()
3467 cred = cred->next; in wpa_config_add_cred()
3471 cred = os_zalloc(sizeof(*cred)); in wpa_config_add_cred()
3472 if (cred == NULL) in wpa_config_add_cred()
3474 cred->id = id; in wpa_config_add_cred()
3475 cred->sim_num = DEFAULT_USER_SELECTED_SIM; in wpa_config_add_cred()
3477 last->next = cred; in wpa_config_add_cred()
3479 config->cred = cred; in wpa_config_add_cred()
3481 return cred; in wpa_config_add_cred()
3487 struct wpa_cred *cred, *prev = NULL; in wpa_config_remove_cred() local
3489 cred = config->cred; in wpa_config_remove_cred()
3490 while (cred) { in wpa_config_remove_cred()
3491 if (id == cred->id) in wpa_config_remove_cred()
3493 prev = cred; in wpa_config_remove_cred()
3494 cred = cred->next; in wpa_config_remove_cred()
3497 if (cred == NULL) in wpa_config_remove_cred()
3501 prev->next = cred->next; in wpa_config_remove_cred()
3503 config->cred = cred->next; in wpa_config_remove_cred()
3505 wpa_config_free_cred(cred); in wpa_config_remove_cred()