From: Jouni Malinen Date: Wed, 22 Sep 2010 02:36:44 +0000 (-0700) Subject: WPS 2.0: Fix AuthorizedMACs check to accept wildcard address X-Git-Url: http://www.project-moonshot.org/gitweb/?p=libeap.git;a=commitdiff_plain;h=ab98525399f65fb90bb77f48882be1ed9ddacdf9 WPS 2.0: Fix AuthorizedMACs check to accept wildcard address We need to accept both our own address and the ff:ff:ff:ff:ff:ff as an indication of the AP having authorized us. --- diff --git a/src/wps/wps.c b/src/wps/wps.c index 99a73ba..01a2cde 100644 --- a/src/wps/wps.c +++ b/src/wps/wps.c @@ -269,6 +269,7 @@ int wps_is_addr_authorized(const struct wpabuf *msg, const u8 *addr, struct wps_parse_attr attr; unsigned int i; const u8 *pos; + const u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; if (wps_parse_msg(msg, &attr) < 0) return 0; @@ -286,7 +287,8 @@ int wps_is_addr_authorized(const struct wpabuf *msg, const u8 *addr, pos = attr.authorized_macs; for (i = 0; i < attr.authorized_macs_len / ETH_ALEN; i++) { - if (os_memcmp(pos, addr, ETH_ALEN) == 0) + if (os_memcmp(pos, addr, ETH_ALEN) == 0 || + os_memcmp(pos, bcast, ETH_ALEN) == 0) return 1; pos += ETH_ALEN; }