Lines Matching defs:curve

797 	nonce_len = auth->curve->nonce_len;
817 clear_len += 4 + auth->curve->hash_len;
871 wpabuf_put_le16(clear, auth->curve->hash_len);
872 wpabuf_put_data(clear, auth_i, auth->curve->hash_len);
891 if (aes_siv_encrypt(auth->ke, auth->curve->hash_len,
1558 const struct dpp_curve_params *curve)
1571 json_add_string(buf, "crv", curve->jwk_crv);
1574 if (json_add_base64url(buf, "x", pos, curve->prime_len) < 0)
1577 pos += curve->prime_len;
1578 if (json_add_base64url(buf, "y", pos, curve->prime_len) < 0)
1624 static bool dpp_supports_curve(const char *curve, struct dpp_bootstrap_info *bi)
1631 if (os_strcmp(curve, "prime256v1") == 0)
1633 else if (os_strcmp(curve, "secp384r1") == 0)
1635 else if (os_strcmp(curve, "secp521r1") == 0)
1637 else if (os_strcmp(curve, "brainpoolP256r1") == 0)
1639 else if (os_strcmp(curve, "brainpoolP384r1") == 0)
1641 else if (os_strcmp(curve, "brainpoolP512r1") == 0)
1657 const struct dpp_curve_params *curve; /* C-sign-key curve */
1658 const struct dpp_curve_params *nak_curve; /* netAccessKey curve */
1670 curve = auth->conf->curve;
1672 !dpp_supports_curve(curve->name, auth->peer_bi)) {
1674 "DPP: Enrollee does not support C-sign-key curve (%s) - cannot generate config object",
1675 curve->name);
1681 nak_curve = auth->curve;
1684 "DPP: Enrollee does not support netAccessKey curve (%s) - cannot generate config object",
1742 auth->curve != auth->conf->net_access_key_curve &&
1747 "DPP: Enrollee does not support the required netAccessKey curve (%s) - cannot generate config object",
1752 "DPP: Peer protocol key curve (%s) does not match the required netAccessKey curve (%s) - %s",
1753 auth->curve->name,
1800 tailroom += 2 * curve->prime_len * 4 / 3 + os_strlen(auth->conf->kid);
1860 curve) < 0) {
1868 curve) < 0) {
1889 * from the same curve for network introduction to work, so
1890 * hardcode the first used netAccessKey curve for consecutive
1892 * curve to use. */
1894 "DPP: Update Configurator to require netAccessKey curve %s based on first provisioning",
2100 "DPP: Generate a new own protocol key for the curve %s",
2244 if (aes_siv_encrypt(auth->ke, auth->curve->hash_len,
2320 if (aes_siv_decrypt(auth->ke, auth->curve->hash_len,
2337 if (!e_nonce || e_nonce_len != auth->curve->nonce_len) {
2385 if (rx_auth_i_len != auth->curve->hash_len ||
2386 os_memcmp(rx_auth_i, auth_i, auth->curve->hash_len) != 0) {
2392 auth_i, auth->curve->hash_len);
2600 const struct dpp_curve_params *curve;
2620 curve = dpp_get_curve_jwk_crv(token->string);
2621 if (!curve) {
2633 if (wpabuf_len(x) != curve->prime_len) {
2635 "DPP: Unexpected JWK x length %u (expected %u for curve %s)",
2637 (unsigned int) curve->prime_len, curve->name);
2647 if (wpabuf_len(y) != curve->prime_len) {
2649 "DPP: Unexpected JWK y length %u (expected %u for curve %s)",
2651 (unsigned int) curve->prime_len, curve->name);
2655 key = crypto_ec_key_set_pub(curve->ike_group, wpabuf_head(x),
2660 *key_curve = curve;
2757 const struct dpp_curve_params *curve;
2818 key = dpp_parse_jwk(netkey, &curve);
2941 "DPP: C-sign-key and ppKey do not use the same curve");
3337 if (aes_siv_decrypt(auth->ke, auth->curve->hash_len,
3354 if (!e_nonce || e_nonce_len != auth->curve->nonce_len) {
3401 const struct dpp_curve_params *curve;
3418 curve = dpp_get_curve_ike_group(group);
3419 if (!curve) {
3425 new_pe = dpp_gen_keypair(curve);
3434 auth->new_curve = curve;
3548 if (aes_siv_decrypt(auth->ke, auth->curve->hash_len,
3565 if (!e_nonce || e_nonce_len != auth->curve->nonce_len) {
3603 nonce_len = auth->curve->nonce_len;
3635 if (aes_siv_encrypt(auth->ke, auth->curve->hash_len,
3707 if (aes_siv_decrypt(auth->ke, auth->curve->hash_len,
3724 if (!e_nonce || e_nonce_len != auth->curve->nonce_len) {
3825 nonce_len = auth->curve->nonce_len;
3859 if (aes_siv_encrypt(auth->ke, auth->curve->hash_len,
3943 dpp_keygen_configurator(const char *curve, const u8 *privkey,
3952 conf->curve = dpp_get_curve_name(curve);
3953 if (!conf->curve) {
3954 wpa_printf(MSG_INFO, "DPP: Unsupported curve: %s", curve);
3960 conf->csign = dpp_set_keypair(&conf->curve, privkey,
3963 conf->csign = dpp_gen_keypair(conf->curve);
3965 conf->pp_key = dpp_set_keypair(&conf->curve, pp_key,
3968 conf->pp_key = dpp_gen_keypair(conf->curve);
3983 const char *curve, int ap)
3993 auth->curve = dpp_get_curve_name(curve);
3994 if (!auth->curve) {
3995 wpa_printf(MSG_INFO, "DPP: Unsupported curve: %s", curve);
4000 "DPP: Building own configuration/connector with curve %s",
4001 auth->curve->name);
4003 auth->own_protocol_key = dpp_gen_keypair(auth->curve);
4157 const struct dpp_curve_params *curve, *own_curve;
4228 intro->peer_key = dpp_parse_jwk(netkey, &curve);
4235 if (own_curve != curve) {
4238 own_curve->name, curve->name);
4251 if (dpp_derive_pmk(Nx, Nx_len, intro->pmk, curve->hash_len) < 0) {
4255 intro->pmk_len = curve->hash_len;
4258 if (dpp_derive_pmkid(curve, own_key, intro->peer_key, intro->pmkid) <
4265 if (dpp_hpke_suite(curve->ike_group, &intro->kem_id, &intro->kdf_id,
4268 curve->ike_group);
4421 wpa_printf(MSG_DEBUG, "DPP: Unsupported curve '%s'",
4437 char *mac = NULL, *info = NULL, *curve = NULL;
4463 curve = get_param(cmd, " curve=");
4476 if (dpp_keygen(bi, curve, privkey, privkey_len) < 0 ||
4490 os_free(curve);
4565 const char *curve[6] = { "P-256", "P-384", "P-521",
4573 for (i = 0; i < ARRAY_SIZE(curve); i++) {
4576 ret = os_snprintf(pos, end - pos, "%s:", curve[i]);
4604 "curve=%s\n"
4612 bi->curve->name,
4746 if (peer_bi->curve == own_bi->curve)
4750 "DPP: Update own bootstrapping key to match peer curve from NFC handover");
4755 if (dpp_keygen(own_bi, peer_bi->curve->name, NULL, 0) < 0 ||
4793 char *curve;
4801 curve = get_param(cmd, " net_access_key_curve=");
4802 if (curve) {
4803 net_access_key_curve = dpp_get_curve_name(curve);
4807 curve);
4810 os_free(curve);
4813 curve = get_param(cmd, " curve=");
4833 conf = dpp_keygen_configurator(curve, privkey, privkey_len,
4844 os_free(curve);
4858 char *curve;
4865 curve = get_param(cmd, " net_access_key_curve=");
4866 if (curve) {
4869 net_access_key_curve = dpp_get_curve_name(curve);
4870 os_free(curve);
4938 const struct dpp_curve_params *curve, *curve_pp;
4943 curve = dpp_get_curve_ike_group(crypto_ec_key_group(key->csign));
4944 if (!curve) {
4955 if (curve != curve_pp) {
4964 conf->curve = curve;