RSNO: Support over two octets of RSNXOE capabilities
The RSNXE generation function was extended to support this earlier, but that update was missed from the RSNXOE variant. Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
parent
8b2ddfdbb6
commit
bb61f6cb95
1 changed files with 11 additions and 6 deletions
|
@ -547,15 +547,20 @@ static int wpa_write_rsnxe_override(struct wpa_auth_config *conf, u8 *buf,
|
||||||
size_t len)
|
size_t len)
|
||||||
{
|
{
|
||||||
u8 *pos = buf;
|
u8 *pos = buf;
|
||||||
u16 capab;
|
u32 capab, tmp;
|
||||||
size_t flen;
|
size_t flen;
|
||||||
|
|
||||||
capab = rsnxe_capab(conf, conf->rsn_override_key_mgmt |
|
capab = rsnxe_capab(conf, conf->rsn_override_key_mgmt |
|
||||||
conf->rsn_override_key_mgmt_2);
|
conf->rsn_override_key_mgmt_2);
|
||||||
|
|
||||||
flen = (capab & 0xff00) ? 2 : 1;
|
|
||||||
if (!capab)
|
if (!capab)
|
||||||
return 0; /* no supported extended RSN capabilities */
|
return 0; /* no supported extended RSN capabilities */
|
||||||
|
tmp = capab;
|
||||||
|
flen = 0;
|
||||||
|
while (tmp) {
|
||||||
|
flen++;
|
||||||
|
tmp >>= 8;
|
||||||
|
}
|
||||||
if (len < 2 + flen)
|
if (len < 2 + flen)
|
||||||
return -1;
|
return -1;
|
||||||
capab |= flen - 1; /* bit 0-3 = Field length (n - 1) */
|
capab |= flen - 1; /* bit 0-3 = Field length (n - 1) */
|
||||||
|
@ -565,10 +570,10 @@ static int wpa_write_rsnxe_override(struct wpa_auth_config *conf, u8 *buf,
|
||||||
WPA_PUT_BE32(pos, RSNXE_OVERRIDE_IE_VENDOR_TYPE);
|
WPA_PUT_BE32(pos, RSNXE_OVERRIDE_IE_VENDOR_TYPE);
|
||||||
pos += 4;
|
pos += 4;
|
||||||
|
|
||||||
*pos++ = capab & 0x00ff;
|
while (capab) {
|
||||||
capab >>= 8;
|
*pos++ = capab & 0xff;
|
||||||
if (capab)
|
capab >>= 8;
|
||||||
*pos++ = capab;
|
}
|
||||||
|
|
||||||
return pos - buf;
|
return pos - buf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue