Changed Credential MAC Address to be BSSID in AP/Registrar
authorJouni Malinen <jouni.malinen@atheros.com>
Tue, 20 Jan 2009 19:28:31 +0000 (21:28 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 20 Jan 2009 19:28:31 +0000 (21:28 +0200)
WPS spec is not very clear on which MAC address is used here, but BSSID
makes more sense than Enrollee MAC address.

src/wps/wps_registrar.c

index d89cf17..246c1e9 100644 (file)
@@ -905,7 +905,8 @@ static int wps_build_cred_network_key(struct wpabuf *msg,
 static int wps_build_cred_mac_addr(struct wpabuf *msg,
                                   struct wps_credential *cred)
 {
-       wpa_printf(MSG_DEBUG, "WPS:  * MAC Address");
+       wpa_printf(MSG_DEBUG, "WPS:  * MAC Address (" MACSTR ")",
+                  MAC2STR(cred->mac_addr));
        wpabuf_put_be16(msg, ATTR_MAC_ADDR);
        wpabuf_put_be16(msg, ETH_ALEN);
        wpabuf_put_data(msg, cred->mac_addr, ETH_ALEN);
@@ -979,7 +980,8 @@ static int wps_build_cred(struct wps_data *wps, struct wpabuf *msg)
                }
        }
        wps->cred.encr_type = wps->encr_type;
-       os_memcpy(wps->cred.mac_addr, wps->mac_addr_e, ETH_ALEN);
+       /* Set MAC address in the Credential to be the AP's address (BSSID) */
+       os_memcpy(wps->cred.mac_addr, wps->wps->dev.mac_addr, ETH_ALEN);
 
        if (wps->wps->wps_state == WPS_STATE_NOT_CONFIGURED && wps->wps->ap) {
                u8 r[16];