Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337130
b: refs/heads/master
c: 7c5745c
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Oct 22, 2012
1 parent 276d5b1 commit 5e4b99c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 60ac2e9f7f76f90ba714b46332459eba397989b6
refs/heads/master: 7c5745cc0859b5a628d7c39530a953e3983e6c1c
48 changes: 24 additions & 24 deletions trunk/drivers/staging/csr/data_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,33 @@
int
uf_verify_m4(unifi_priv_t *priv, const unsigned char *packet, unsigned int length)
{
const unsigned char *p = packet;
u16 keyinfo;
const unsigned char *p = packet;
u16 keyinfo;


if (length < (4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 1 + 8)) {
return 1;
}
if (length < (4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 1 + 8)) {
return 1;
}

p += 8;
keyinfo = p[5] << 8 | p[6]; /* big-endian */
if (
(p[0] == 1 || p[0] == 2) /* protocol version 802.1X-2001 (WPA) or -2004 (WPA2) */ &&
p[1] == 3 /* EAPOL-Key */ &&
/* don't bother checking p[2] p[3] (hh ll, packet body length) */
(p[4] == 254 || p[4] == 2) /* descriptor type P802.1i-D3.0 (WPA) or 802.11i-2004 (WPA2) */ &&
((keyinfo & 0x0007) == 1 || (keyinfo & 0x0007) == 2) /* key descriptor version */ &&
(keyinfo & ~0x0207U) == 0x0108 && /* key info for 4/4 or 4/2 -- ignore key desc version and sec bit (since varies in WPA 4/4) */
(p[4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 0] == 0 && /* key data length (2 octets) 0 for 4/4 only */
p[4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 1] == 0)
) {
unifi_trace(priv, UDBG1, "uf_verify_m4: M4 detected \n");
return 0;
}
else
{
return 1;
}
p += 8;
keyinfo = p[5] << 8 | p[6]; /* big-endian */
if (
(p[0] == 1 || p[0] == 2) /* protocol version 802.1X-2001 (WPA) or -2004 (WPA2) */ &&
p[1] == 3 /* EAPOL-Key */ &&
/* don't bother checking p[2] p[3] (hh ll, packet body length) */
(p[4] == 254 || p[4] == 2) /* descriptor type P802.1i-D3.0 (WPA) or 802.11i-2004 (WPA2) */ &&
((keyinfo & 0x0007) == 1 || (keyinfo & 0x0007) == 2) /* key descriptor version */ &&
(keyinfo & ~0x0207U) == 0x0108 && /* key info for 4/4 or 4/2 -- ignore key desc version and sec bit (since varies in WPA 4/4) */
(p[4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 0] == 0 && /* key data length (2 octets) 0 for 4/4 only */
p[4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 1] == 0)
) {
unifi_trace(priv, UDBG1, "uf_verify_m4: M4 detected \n");
return 0;
}
else
{
return 1;
}
}

/*
Expand Down

0 comments on commit 5e4b99c

Please sign in to comment.