DPP: Add DPP_CONFIGURATOR_SIGN to generate own connector
The DPP Configurator can use this new command to generate its own signed connector for the network that it manages. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
dc7fc09ccd
commit
f522bb2377
5 changed files with 122 additions and 41 deletions
|
@ -4421,6 +4421,50 @@ fail:
|
|||
}
|
||||
|
||||
|
||||
int dpp_configurator_own_config(struct dpp_authentication *auth,
|
||||
const char *curve)
|
||||
{
|
||||
struct wpabuf *conf_obj;
|
||||
int ret = -1;
|
||||
|
||||
if (!auth->conf) {
|
||||
wpa_printf(MSG_DEBUG, "DPP: No configurator specified");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!curve) {
|
||||
auth->curve = &dpp_curves[0];
|
||||
} else {
|
||||
auth->curve = dpp_get_curve_name(curve);
|
||||
if (!auth->curve) {
|
||||
wpa_printf(MSG_INFO, "DPP: Unsupported curve: %s",
|
||||
curve);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Building own configuration/connector with curve %s",
|
||||
auth->curve->name);
|
||||
|
||||
auth->own_protocol_key = dpp_gen_keypair(auth->curve);
|
||||
if (!auth->own_protocol_key)
|
||||
return -1;
|
||||
dpp_copy_netaccesskey(auth);
|
||||
auth->peer_protocol_key = auth->own_protocol_key;
|
||||
dpp_copy_csign(auth, auth->conf->csign);
|
||||
|
||||
conf_obj = dpp_build_conf_obj(auth, 0);
|
||||
if (!conf_obj)
|
||||
goto fail;
|
||||
ret = dpp_parse_conf_obj(auth, wpabuf_head(conf_obj),
|
||||
wpabuf_len(conf_obj));
|
||||
fail:
|
||||
wpabuf_free(conf_obj);
|
||||
auth->peer_protocol_key = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int dpp_compatible_netrole(const char *role1, const char *role2)
|
||||
{
|
||||
return (os_strcmp(role1, "sta") == 0 && os_strcmp(role2, "ap") == 0) ||
|
||||
|
|
|
@ -254,6 +254,8 @@ void dpp_configurator_free(struct dpp_configurator *conf);
|
|||
struct dpp_configurator *
|
||||
dpp_keygen_configurator(const char *curve, const u8 *privkey,
|
||||
size_t privkey_len);
|
||||
int dpp_configurator_own_config(struct dpp_authentication *auth,
|
||||
const char *curve);
|
||||
int dpp_peer_intro(struct dpp_introduction *intro, const char *own_connector,
|
||||
const u8 *net_access_key, size_t net_access_key_len,
|
||||
const u8 *csign_key, size_t csign_key_len,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue