Lines Matching defs:conf
4207 struct dpp_configuration *conf;
4211 conf = os_zalloc(sizeof(*conf));
4212 if (!conf)
4222 conf->akm = DPP_AKM_PSK;
4224 conf->akm = DPP_AKM_SAE;
4227 conf->akm = DPP_AKM_PSK_SAE;
4230 conf->akm = DPP_AKM_SAE_DPP;
4233 conf->akm = DPP_AKM_PSK_SAE_DPP;
4235 conf->akm = DPP_AKM_DPP;
4239 return conf;
4241 dpp_configuration_free(conf);
4280 int dpp_configuration_valid(const struct dpp_configuration *conf)
4282 if (conf->ssid_len == 0)
4284 if (dpp_akm_psk(conf->akm) && !conf->passphrase && !conf->psk_set)
4286 if (dpp_akm_sae(conf->akm) && !conf->passphrase)
4292 void dpp_configuration_free(struct dpp_configuration *conf)
4294 if (!conf)
4296 str_clear_free(conf->passphrase);
4297 os_free(conf->group_id);
4298 bin_clear_free(conf, sizeof(*conf));
4307 struct dpp_configuration *conf = NULL;
4309 pos = os_strstr(cmd, " conf=sta-");
4314 conf = conf_sta;
4317 pos = os_strstr(cmd, " conf=ap-");
4322 conf = conf_ap;
4325 if (!conf)
4332 conf->ssid_len = end ? (size_t) (end - pos) : os_strlen(pos);
4333 conf->ssid_len /= 2;
4334 if (conf->ssid_len > sizeof(conf->ssid) ||
4335 hexstr2bin(pos, conf->ssid, conf->ssid_len) < 0)
4340 os_memcpy(conf->ssid, "test", 4);
4341 conf->ssid_len = 4;
4357 conf->passphrase = os_zalloc(pass_len + 1);
4358 if (!conf->passphrase ||
4359 hexstr2bin(pos, (u8 *) conf->passphrase, pass_len) < 0)
4366 if (hexstr2bin(pos, conf->psk, PMK_LEN) < 0)
4368 conf->psk_set = 1;
4378 conf->group_id = os_malloc(group_id_len + 1);
4379 if (!conf->group_id)
4381 os_memcpy(conf->group_id, pos, group_id_len);
4382 conf->group_id[group_id_len] = '\0';
4393 conf->netaccesskey_expiry = val;
4396 if (!dpp_configuration_valid(conf))
4413 struct dpp_configurator *conf;
4418 dl_list_for_each(conf, &dpp->configurator,
4420 if (conf->id == id)
4421 return conf;
4441 auth->conf = dpp_configurator_get_id(dpp, atoi(pos));
4442 if (!auth->conf) {
4484 struct dpp_configuration *conf, size_t tailroom)
4487 char ssid[6 * sizeof(conf->ssid) + 1];
4509 (const char *) conf->ssid, conf->ssid_len);
4558 struct dpp_configuration *conf)
4560 if (conf->passphrase && os_strlen(conf->passphrase) < 64) {
4563 json_escape_string(pass, sizeof(pass), conf->passphrase,
4564 os_strlen(conf->passphrase));
4569 } else if (conf->psk_set) {
4570 char psk[2 * sizeof(conf->psk) + 1];
4573 conf->psk, sizeof(conf->psk));
4584 struct dpp_configuration *conf)
4605 if (!auth->conf) {
4610 curve = auth->conf->curve;
4622 akm = conf->akm;
4634 if (conf->group_id)
4635 extra_len += os_strlen(conf->group_id);
4656 conf->group_id ? conf->group_id : "*");
4666 if (conf->netaccesskey_expiry) {
4669 if (os_gmtime(conf->netaccesskey_expiry, &tm) < 0) {
4685 auth->conf->kid, curve->jws_alg);
4701 auth->conf->csign) != 1) {
4748 tailroom += 2 * curve->prime_len * 4 / 3 + os_strlen(auth->conf->kid);
4752 buf = dpp_build_conf_start(auth, conf, tailroom);
4758 dpp_build_legacy_cred_params(buf, conf);
4768 if (dpp_build_jwk(buf, "csign", auth->conf->csign, auth->conf->kid,
4798 struct dpp_configuration *conf)
4802 buf = dpp_build_conf_start(auth, conf, 1000);
4806 wpabuf_printf(buf, "\"cred\":{\"akm\":\"%s\",", dpp_akm_str(conf->akm));
4807 dpp_build_legacy_cred_params(buf, conf);
4820 struct dpp_configuration *conf;
4830 conf = ap ? auth->conf_ap : auth->conf_sta;
4831 if (!conf) {
4838 if (dpp_akm_dpp(conf->akm))
4839 return dpp_build_conf_obj_dpp(auth, ap, conf);
4840 return dpp_build_conf_obj_legacy(auth, ap, conf);
4848 struct wpabuf *conf;
4856 conf = dpp_build_conf_obj(auth, ap);
4857 if (conf) {
4859 wpabuf_head(conf), wpabuf_len(conf));
4861 status = conf ? DPP_STATUS_OK : DPP_STATUS_CONFIGURE_FAILURE;
4866 if (conf)
4867 clear_len += 4 + wpabuf_len(conf);
4910 if (conf) {
4912 wpabuf_put_le16(clear, wpabuf_len(conf));
4913 wpabuf_put_buf(clear, conf);
4962 wpabuf_free(conf);
6152 void dpp_configurator_free(struct dpp_configurator *conf)
6154 if (!conf)
6156 EVP_PKEY_free(conf->csign);
6157 os_free(conf->kid);
6158 os_free(conf);
6162 int dpp_configurator_get_key(const struct dpp_configurator *conf, char *buf,
6169 if (!conf->csign)
6172 eckey = EVP_PKEY_get1_EC_KEY(conf->csign);
6190 struct dpp_configurator *conf;
6196 conf = os_zalloc(sizeof(*conf));
6197 if (!conf)
6201 conf->curve = &dpp_curves[0];
6203 conf->curve = dpp_get_curve_name(curve);
6204 if (!conf->curve) {
6207 os_free(conf);
6212 conf->csign = dpp_set_keypair(&conf->curve, privkey,
6215 conf->csign = dpp_gen_keypair(conf->curve);
6216 if (!conf->csign)
6218 conf->own = 1;
6220 csign_pub = dpp_get_pubkey_point(conf->csign, 1);
6235 conf->kid = (char *) base64_url_encode(kid_hash, sizeof(kid_hash),
6237 if (!conf->kid)
6241 return conf;
6243 dpp_configurator_free(conf);
6244 conf = NULL;
6255 if (!auth->conf) {
6279 dpp_copy_csign(auth, auth->conf->csign);
8619 struct dpp_configurator *conf;
8622 dl_list_for_each(conf, &dpp->configurator, struct dpp_configurator,
8624 if (conf->id > max_id)
8625 max_id = conf->id;
8638 struct dpp_configurator *conf = NULL;
8651 conf = dpp_keygen_configurator(curve, privkey, privkey_len);
8652 if (!conf)
8655 conf->id = dpp_next_configurator_id(dpp);
8656 dl_list_add(&dpp->configurator, &conf->list);
8657 ret = conf->id;
8658 conf = NULL;
8663 dpp_configurator_free(conf);
8670 struct dpp_configurator *conf, *tmp;
8676 dl_list_for_each_safe(conf, tmp, &dpp->configurator,
8678 if (id && conf->id != id)
8681 dl_list_del(&conf->list);
8682 dpp_configurator_free(conf);
8710 struct dpp_configurator *conf;
8712 conf = dpp_configurator_get_id(dpp, id);
8713 if (!conf)
8716 return dpp_configurator_get_key(conf, buf, buflen);