Lines Matching refs:ssid
126 static int wpa_config_validate_network(struct wpa_ssid *ssid, int line) in wpa_config_validate_network() argument
130 if (ssid->passphrase) { in wpa_config_validate_network()
131 if (ssid->psk_set) { in wpa_config_validate_network()
136 wpa_config_update_psk(ssid); in wpa_config_validate_network()
139 if ((ssid->group_cipher & WPA_CIPHER_CCMP) && in wpa_config_validate_network()
140 !(ssid->pairwise_cipher & WPA_CIPHER_CCMP) && in wpa_config_validate_network()
141 !(ssid->pairwise_cipher & WPA_CIPHER_NONE)) { in wpa_config_validate_network()
146 ssid->group_cipher &= ~WPA_CIPHER_CCMP; in wpa_config_validate_network()
149 if (ssid->mode == WPAS_MODE_MESH && in wpa_config_validate_network()
150 (ssid->key_mgmt != WPA_KEY_MGMT_NONE && in wpa_config_validate_network()
151 ssid->key_mgmt != WPA_KEY_MGMT_SAE)) { in wpa_config_validate_network()
164 struct wpa_ssid *ssid; in wpa_config_read_network() local
170 ssid = os_zalloc(sizeof(*ssid)); in wpa_config_read_network()
171 if (ssid == NULL) in wpa_config_read_network()
173 dl_list_init(&ssid->psk_list); in wpa_config_read_network()
174 ssid->id = id; in wpa_config_read_network()
176 wpa_config_set_network_defaults(ssid); in wpa_config_read_network()
202 if (wpa_config_set(ssid, pos, pos2, *line) < 0) in wpa_config_read_network()
212 errors += wpa_config_validate_network(ssid, *line); in wpa_config_read_network()
215 wpa_config_free_ssid(ssid); in wpa_config_read_network()
216 ssid = NULL; in wpa_config_read_network()
219 return ssid; in wpa_config_read_network()
367 struct wpa_ssid *ssid, *tail, *head; in wpa_config_read() local
384 tail = head = config->ssid; in wpa_config_read()
402 ssid = wpa_config_read_network(f, &line, id++); in wpa_config_read()
403 if (ssid == NULL) { in wpa_config_read()
410 head = tail = ssid; in wpa_config_read()
412 tail->next = ssid; in wpa_config_read()
413 tail = ssid; in wpa_config_read()
415 if (wpa_config_add_prio_network(config, ssid)) { in wpa_config_read()
456 config->ssid = head; in wpa_config_read()
474 static void write_str(FILE *f, const char *field, struct wpa_ssid *ssid) in write_str() argument
476 char *value = wpa_config_get(ssid, field); in write_str()
492 static void write_bssid(FILE *f, struct wpa_ssid *ssid) in write_bssid() argument
494 char *value = wpa_config_get(ssid, "bssid"); in write_bssid()
502 static void write_psk(FILE *f, struct wpa_ssid *ssid) in write_psk() argument
506 if (ssid->mem_only_psk) in write_psk()
509 value = wpa_config_get(ssid, "psk"); in write_psk()
517 static void write_proto(FILE *f, struct wpa_ssid *ssid) in write_proto() argument
521 if (ssid->proto == DEFAULT_PROTO) in write_proto()
524 value = wpa_config_get(ssid, "proto"); in write_proto()
533 static void write_key_mgmt(FILE *f, struct wpa_ssid *ssid) in write_key_mgmt() argument
537 if (ssid->key_mgmt == DEFAULT_KEY_MGMT) in write_key_mgmt()
540 value = wpa_config_get(ssid, "key_mgmt"); in write_key_mgmt()
549 static void write_pairwise(FILE *f, struct wpa_ssid *ssid) in write_pairwise() argument
553 if (ssid->pairwise_cipher == DEFAULT_PAIRWISE) in write_pairwise()
556 value = wpa_config_get(ssid, "pairwise"); in write_pairwise()
565 static void write_group(FILE *f, struct wpa_ssid *ssid) in write_group() argument
569 if (ssid->group_cipher == DEFAULT_GROUP) in write_group()
572 value = wpa_config_get(ssid, "group"); in write_group()
581 static void write_auth_alg(FILE *f, struct wpa_ssid *ssid) in write_auth_alg() argument
585 if (ssid->auth_alg == 0) in write_auth_alg()
588 value = wpa_config_get(ssid, "auth_alg"); in write_auth_alg()
598 static void write_eap(FILE *f, struct wpa_ssid *ssid) in write_eap() argument
602 value = wpa_config_get(ssid, "eap"); in write_eap()
613 static void write_wep_key(FILE *f, int idx, struct wpa_ssid *ssid) in write_wep_key() argument
621 value = wpa_config_get(ssid, field); in write_wep_key()
631 static void write_go_p2p_dev_addr(FILE *f, struct wpa_ssid *ssid) in write_go_p2p_dev_addr() argument
633 char *value = wpa_config_get(ssid, "go_p2p_dev_addr"); in write_go_p2p_dev_addr()
640 static void write_p2p_client_list(FILE *f, struct wpa_ssid *ssid) in write_p2p_client_list() argument
642 char *value = wpa_config_get(ssid, "p2p_client_list"); in write_p2p_client_list()
650 static void write_psk_list(FILE *f, struct wpa_ssid *ssid) in write_psk_list() argument
655 dl_list_for_each(psk, &ssid->psk_list, struct psk_list_entry, list) { in write_psk_list()
665 static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid) in wpa_config_write_network() argument
669 #define STR(t) write_str(f, #t, ssid) in wpa_config_write_network()
670 #define INT(t) write_int(f, #t, ssid->t, 0) in wpa_config_write_network()
671 #define INTe(t) write_int(f, #t, ssid->eap.t, 0) in wpa_config_write_network()
672 #define INT_DEF(t, def) write_int(f, #t, ssid->t, def) in wpa_config_write_network()
673 #define INT_DEFe(t, def) write_int(f, #t, ssid->eap.t, def) in wpa_config_write_network()
675 STR(ssid); in wpa_config_write_network()
677 write_bssid(f, ssid); in wpa_config_write_network()
678 write_str(f, "bssid_blacklist", ssid); in wpa_config_write_network()
679 write_str(f, "bssid_whitelist", ssid); in wpa_config_write_network()
680 write_psk(f, ssid); in wpa_config_write_network()
682 write_proto(f, ssid); in wpa_config_write_network()
683 write_key_mgmt(f, ssid); in wpa_config_write_network()
685 write_pairwise(f, ssid); in wpa_config_write_network()
686 write_group(f, ssid); in wpa_config_write_network()
687 write_auth_alg(f, ssid); in wpa_config_write_network()
692 write_eap(f, ssid); in wpa_config_write_network()
736 write_wep_key(f, i, ssid); in wpa_config_write_network()
753 write_int(f, "proactive_key_caching", ssid->proactive_key_caching, -1); in wpa_config_write_network()
760 write_int(f, "ieee80211w", ssid->ieee80211w, in wpa_config_write_network()
765 write_go_p2p_dev_addr(f, ssid); in wpa_config_write_network()
766 write_p2p_client_list(f, ssid); in wpa_config_write_network()
767 write_psk_list(f, ssid); in wpa_config_write_network()
778 write_int(f, "mac_addr", ssid->mac_addr, -1); in wpa_config_write_network()
884 fprintf(f, "%02x", e->ssid[j]); in wpa_config_write_cred()
1347 struct wpa_ssid *ssid; in wpa_config_write() local
1381 for (ssid = config->ssid; ssid; ssid = ssid->next) { in wpa_config_write()
1382 if (ssid->key_mgmt == WPA_KEY_MGMT_WPS || ssid->temporary) in wpa_config_write()
1384 if (wpa_key_mgmt_wpa_psk(ssid->key_mgmt) && !ssid->psk_set && in wpa_config_write()
1385 !ssid->passphrase) in wpa_config_write()
1388 wpa_config_write_network(f, ssid); in wpa_config_write()