]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Remove Label config method
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 8 Sep 2011 13:40:03 +0000 (16:40 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 8 Sep 2011 13:40:03 +0000 (16:40 +0300)
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.

src/p2p/p2p.c
src/p2p/p2p.h
src/p2p/p2p_build.c
src/p2p/p2p_go_neg.c
wpa_supplicant/ctrl_iface.c
wpa_supplicant/dbus/dbus_new_handlers_p2p.c
wpa_supplicant/p2p_supplicant.c

index 9cfee506cbf319faa126a9772a3d8f75cb6e71e3..cd71a244c0722f1f58a1353d94a205b721dc16e2 100644 (file)
@@ -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:
index f56cc9767bca0710fef91a57f012c3ded3fa554f..d01f574547a39202d42d95585013f9b82d0e5d50 100644 (file)
@@ -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
 };
 
 /**
index c34db915216254df014ec4ea973e225337b46fa3..5aba1e11d9e82413f117609147959334af41d4f9 100644 (file)
@@ -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;
index 1c96486a4ed5967ec0ec848e1e297eb88e18657c..be04fadf84d156446d3f61ae93697c370e2c4253 100644 (file)
@@ -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",
index 8b3b4fdb5c27600f9801a6e01c79503650da3a95..a55a52826c4dbe4e4c15e2c502f956f6d8219349 100644 (file)
@@ -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;
                }
        }
index 6583ed95abb12abdc3237e94519b316290cb62a9..06e653e8786313af308044270e5e439e95117004 100644 (file)
@@ -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,
index 400b6cc259b4a318ebc1afa195b8628f19737053..fba8e1e2f8497f4a9a16c44bcbefdff7d74d15f5 100644 (file)
@@ -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;