DPP2: Extend connector matching for reconfiguration
Allow the same helper functions to be used with reconfiguration connector. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
961435097b
commit
92492dd3ac
2 changed files with 11 additions and 6 deletions
|
@ -6415,7 +6415,8 @@ static int dpp_compatible_netrole(const char *role1, const char *role2)
|
|||
|
||||
static int dpp_connector_compatible_group(struct json_token *root,
|
||||
const char *group_id,
|
||||
const char *net_role)
|
||||
const char *net_role,
|
||||
bool reconfig)
|
||||
{
|
||||
struct json_token *groups, *token;
|
||||
|
||||
|
@ -6439,7 +6440,9 @@ static int dpp_connector_compatible_group(struct json_token *root,
|
|||
os_strcmp(id->string, group_id) != 0)
|
||||
continue;
|
||||
|
||||
if (dpp_compatible_netrole(role->string, net_role))
|
||||
if (reconfig && os_strcmp(net_role, "configurator") == 0)
|
||||
return 1;
|
||||
if (!reconfig && dpp_compatible_netrole(role->string, net_role))
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -6447,8 +6450,8 @@ static int dpp_connector_compatible_group(struct json_token *root,
|
|||
}
|
||||
|
||||
|
||||
static int dpp_connector_match_groups(struct json_token *own_root,
|
||||
struct json_token *peer_root)
|
||||
int dpp_connector_match_groups(struct json_token *own_root,
|
||||
struct json_token *peer_root, bool reconfig)
|
||||
{
|
||||
struct json_token *groups, *token;
|
||||
|
||||
|
@ -6478,7 +6481,7 @@ static int dpp_connector_match_groups(struct json_token *own_root,
|
|||
"DPP: peer connector group: groupId='%s' netRole='%s'",
|
||||
id->string, role->string);
|
||||
if (dpp_connector_compatible_group(own_root, id->string,
|
||||
role->string)) {
|
||||
role->string, reconfig)) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Compatible group/netRole in own connector");
|
||||
return 1;
|
||||
|
@ -6570,7 +6573,7 @@ dpp_peer_intro(struct dpp_introduction *intro, const char *own_connector,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (!dpp_connector_match_groups(own_root, root)) {
|
||||
if (!dpp_connector_match_groups(own_root, root, false)) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Peer connector does not include compatible group netrole with own connector");
|
||||
ret = DPP_STATUS_NO_MATCH;
|
||||
|
|
|
@ -34,6 +34,8 @@ struct wpabuf * dpp_build_conn_status(enum dpp_status_error result,
|
|||
const u8 *ssid, size_t ssid_len,
|
||||
const char *channel_list);
|
||||
struct json_token * dpp_parse_own_connector(const char *own_connector);
|
||||
int dpp_connector_match_groups(struct json_token *own_root,
|
||||
struct json_token *peer_root, bool reconfig);
|
||||
|
||||
/* dpp_crypto.c */
|
||||
|
||||
|
|
Loading…
Reference in a new issue