WPS ER: Allow Enrollee to be specified with MAC address
wps_er_pbc and wps_er_pin can now be used with both the UUID and MAC Address of the Enrollee. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
c44a19c1f9
commit
e205401c72
4 changed files with 42 additions and 14 deletions
|
@ -793,7 +793,8 @@ void wps_er_refresh(struct wps_er *er);
|
|||
void wps_er_deinit(struct wps_er *er, void (*cb)(void *ctx), void *ctx);
|
||||
void wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id,
|
||||
u16 sel_reg_config_methods);
|
||||
int wps_er_pbc(struct wps_er *er, const u8 *uuid);
|
||||
int wps_er_pbc(struct wps_er *er, const u8 *uuid, const u8 *addr);
|
||||
const u8 * wps_er_get_sta_uuid(struct wps_er *er, const u8 *addr);
|
||||
int wps_er_learn(struct wps_er *er, const u8 *uuid, const u8 *addr,
|
||||
const u8 *pin, size_t pin_len);
|
||||
int wps_er_set_config(struct wps_er *er, const u8 *uuid, const u8 *addr,
|
||||
|
|
|
@ -1558,7 +1558,7 @@ void wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id,
|
|||
}
|
||||
|
||||
|
||||
int wps_er_pbc(struct wps_er *er, const u8 *uuid)
|
||||
int wps_er_pbc(struct wps_er *er, const u8 *uuid, const u8 *addr)
|
||||
{
|
||||
int res;
|
||||
struct wps_er_ap *ap;
|
||||
|
@ -1572,11 +1572,14 @@ int wps_er_pbc(struct wps_er *er, const u8 *uuid)
|
|||
return -2;
|
||||
}
|
||||
|
||||
ap = wps_er_ap_get(er, NULL, uuid, NULL);
|
||||
if (uuid)
|
||||
ap = wps_er_ap_get(er, NULL, uuid, NULL);
|
||||
else
|
||||
ap = NULL;
|
||||
if (ap == NULL) {
|
||||
struct wps_er_sta *sta = NULL;
|
||||
dl_list_for_each(ap, &er->ap, struct wps_er_ap, list) {
|
||||
sta = wps_er_sta_get(ap, NULL, uuid);
|
||||
sta = wps_er_sta_get(ap, addr, uuid);
|
||||
if (sta) {
|
||||
uuid = ap->uuid;
|
||||
break;
|
||||
|
@ -1622,6 +1625,19 @@ static void wps_er_ap_settings_cb(void *ctx, const struct wps_credential *cred)
|
|||
}
|
||||
|
||||
|
||||
const u8 * wps_er_get_sta_uuid(struct wps_er *er, const u8 *addr)
|
||||
{
|
||||
struct wps_er_ap *ap;
|
||||
dl_list_for_each(ap, &er->ap, struct wps_er_ap, list) {
|
||||
struct wps_er_sta *sta;
|
||||
sta = wps_er_sta_get(ap, addr, NULL);
|
||||
if (sta)
|
||||
return sta->uuid;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static void wps_er_http_put_message_cb(void *ctx, struct http_client *c,
|
||||
enum http_client_event event)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue