mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
P2P: Remove Label config method
The P2P specification (3.1.4.3) disallows use of the Label configuration method between two P2P devices. This was previously enforced at upper level, but the obsolete code can be removed from wpa_supplicant. This adds a bit more strict enforcement of the policy, but should not result in practical differences since no known P2P implementation uses Label config method.
This commit is contained in:
parent
d8a790b922
commit
07fecd3915
@ -2936,8 +2936,6 @@ static const char * p2p_wps_method_text(enum p2p_wps_method method)
|
||||
switch (method) {
|
||||
case WPS_NOT_READY:
|
||||
return "not-ready";
|
||||
case WPS_PIN_LABEL:
|
||||
return "Label";
|
||||
case WPS_PIN_DISPLAY:
|
||||
return "Display";
|
||||
case WPS_PIN_KEYPAD:
|
||||
|
@ -56,7 +56,7 @@ struct p2p_channels {
|
||||
};
|
||||
|
||||
enum p2p_wps_method {
|
||||
WPS_NOT_READY, WPS_PIN_LABEL, WPS_PIN_DISPLAY, WPS_PIN_KEYPAD, WPS_PBC
|
||||
WPS_NOT_READY, WPS_PIN_DISPLAY, WPS_PIN_KEYPAD, WPS_PBC
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -171,8 +171,6 @@ void p2p_buf_add_device_info(struct wpabuf *buf, struct p2p_data *p2p,
|
||||
if (peer && peer->wps_method != WPS_NOT_READY) {
|
||||
if (peer->wps_method == WPS_PBC)
|
||||
methods |= WPS_CONFIG_PUSHBUTTON;
|
||||
else if (peer->wps_method == WPS_PIN_LABEL)
|
||||
methods |= WPS_CONFIG_LABEL;
|
||||
else if (peer->wps_method == WPS_PIN_DISPLAY ||
|
||||
peer->wps_method == WPS_PIN_KEYPAD)
|
||||
methods |= WPS_CONFIG_DISPLAY | WPS_CONFIG_KEYPAD;
|
||||
|
@ -107,8 +107,6 @@ static int p2p_peer_channels(struct p2p_data *p2p, struct p2p_device *dev,
|
||||
static u16 p2p_wps_method_pw_id(enum p2p_wps_method wps_method)
|
||||
{
|
||||
switch (wps_method) {
|
||||
case WPS_PIN_LABEL:
|
||||
return DEV_PW_DEFAULT;
|
||||
case WPS_PIN_DISPLAY:
|
||||
return DEV_PW_REGISTRAR_SPECIFIED;
|
||||
case WPS_PIN_KEYPAD:
|
||||
@ -124,8 +122,6 @@ static u16 p2p_wps_method_pw_id(enum p2p_wps_method wps_method)
|
||||
static const char * p2p_wps_method_str(enum p2p_wps_method wps_method)
|
||||
{
|
||||
switch (wps_method) {
|
||||
case WPS_PIN_LABEL:
|
||||
return "Label";
|
||||
case WPS_PIN_DISPLAY:
|
||||
return "Display";
|
||||
case WPS_PIN_KEYPAD:
|
||||
@ -516,18 +512,6 @@ void p2p_process_go_neg_req(struct p2p_data *p2p, const u8 *sa,
|
||||
}
|
||||
|
||||
switch (msg.dev_password_id) {
|
||||
case DEV_PW_DEFAULT:
|
||||
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
|
||||
"P2P: PIN from peer Label");
|
||||
if (dev->wps_method != WPS_PIN_KEYPAD) {
|
||||
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
|
||||
"P2P: We have wps_method=%s -> "
|
||||
"incompatible",
|
||||
p2p_wps_method_str(dev->wps_method));
|
||||
status = P2P_SC_FAIL_INCOMPATIBLE_PROV_METHOD;
|
||||
goto fail;
|
||||
}
|
||||
break;
|
||||
case DEV_PW_REGISTRAR_SPECIFIED:
|
||||
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
|
||||
"P2P: PIN from peer Display");
|
||||
@ -543,8 +527,7 @@ void p2p_process_go_neg_req(struct p2p_data *p2p, const u8 *sa,
|
||||
case DEV_PW_USER_SPECIFIED:
|
||||
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
|
||||
"P2P: Peer entered PIN on Keypad");
|
||||
if (dev->wps_method != WPS_PIN_LABEL &&
|
||||
dev->wps_method != WPS_PIN_DISPLAY) {
|
||||
if (dev->wps_method != WPS_PIN_DISPLAY) {
|
||||
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
|
||||
"P2P: We have wps_method=%s -> "
|
||||
"incompatible",
|
||||
@ -899,18 +882,6 @@ void p2p_process_go_neg_resp(struct p2p_data *p2p, const u8 *sa,
|
||||
dev->oper_freq = 0;
|
||||
|
||||
switch (msg.dev_password_id) {
|
||||
case DEV_PW_DEFAULT:
|
||||
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
|
||||
"P2P: PIN from peer Label");
|
||||
if (dev->wps_method != WPS_PIN_KEYPAD) {
|
||||
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
|
||||
"P2P: We have wps_method=%s -> "
|
||||
"incompatible",
|
||||
p2p_wps_method_str(dev->wps_method));
|
||||
status = P2P_SC_FAIL_INCOMPATIBLE_PROV_METHOD;
|
||||
goto fail;
|
||||
}
|
||||
break;
|
||||
case DEV_PW_REGISTRAR_SPECIFIED:
|
||||
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
|
||||
"P2P: PIN from peer Display");
|
||||
@ -926,8 +897,7 @@ void p2p_process_go_neg_resp(struct p2p_data *p2p, const u8 *sa,
|
||||
case DEV_PW_USER_SPECIFIED:
|
||||
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
|
||||
"P2P: Peer entered PIN on Keypad");
|
||||
if (dev->wps_method != WPS_PIN_LABEL &&
|
||||
dev->wps_method != WPS_PIN_DISPLAY) {
|
||||
if (dev->wps_method != WPS_PIN_DISPLAY) {
|
||||
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
|
||||
"P2P: We have wps_method=%s -> "
|
||||
"incompatible",
|
||||
|
@ -2187,9 +2187,7 @@ static int p2p_ctrl_connect(struct wpa_supplicant *wpa_s, char *cmd,
|
||||
wps_method = WPS_PIN_KEYPAD;
|
||||
if (pos) {
|
||||
*pos++ = '\0';
|
||||
if (os_strncmp(pos, "label", 5) == 0)
|
||||
wps_method = WPS_PIN_LABEL;
|
||||
else if (os_strncmp(pos, "display", 7) == 0)
|
||||
if (os_strncmp(pos, "display", 7) == 0)
|
||||
wps_method = WPS_PIN_DISPLAY;
|
||||
}
|
||||
}
|
||||
|
@ -470,8 +470,6 @@ DBusMessage * wpas_dbus_handler_p2p_connect(DBusMessage *message,
|
||||
wps_method = WPS_PBC;
|
||||
else if (!os_strcmp(entry.str_value, "pin"))
|
||||
wps_method = WPS_PIN_DISPLAY;
|
||||
else if (!os_strcmp(entry.str_value, "label"))
|
||||
wps_method = WPS_PIN_LABEL;
|
||||
else if (!os_strcmp(entry.str_value, "display"))
|
||||
wps_method = WPS_PIN_DISPLAY;
|
||||
else if (!os_strcmp(entry.str_value, "keypad"))
|
||||
@ -495,8 +493,7 @@ DBusMessage * wpas_dbus_handler_p2p_connect(DBusMessage *message,
|
||||
/*
|
||||
* Validate the wps_method specified and the pin value.
|
||||
*/
|
||||
if ((!pin || !pin[0]) &&
|
||||
((wps_method == WPS_PIN_LABEL) || (wps_method == WPS_PIN_KEYPAD)))
|
||||
if ((!pin || !pin[0]) && (wps_method == WPS_PIN_KEYPAD))
|
||||
goto inv_args;
|
||||
|
||||
new_pin = wpas_p2p_connect(wpa_s, addr, pin, wps_method,
|
||||
|
@ -2713,7 +2713,6 @@ static void wpas_p2p_scan_res_join(struct wpa_supplicant *wpa_s,
|
||||
wpa_s->pending_pd_before_join = 1;
|
||||
|
||||
switch (wpa_s->pending_join_wps_method) {
|
||||
case WPS_PIN_LABEL:
|
||||
case WPS_PIN_DISPLAY:
|
||||
method = WPS_CONFIG_KEYPAD;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user