mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
Limit the TX key to a valid range
PR: 39960, 39961 (patches here pointed out problem, but didn't quite fix it)
This commit is contained in:
parent
214c0b3da4
commit
7f2907fd70
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=104147
@ -1268,6 +1268,8 @@ wi_write_record(sc, ltv)
|
||||
ltv = &p2ltv;
|
||||
break;
|
||||
case WI_RID_TX_CRYPT_KEY:
|
||||
if (ltv->wi_val > WI_NLTV_KEYS)
|
||||
return (EINVAL);
|
||||
p2ltv.wi_type = WI_RID_P2_TX_CRYPT_KEY;
|
||||
p2ltv.wi_len = 2;
|
||||
p2ltv.wi_val = ltv->wi_val;
|
||||
@ -1328,6 +1330,10 @@ wi_write_record(sc, ltv)
|
||||
case 11: ltv->wi_val = 5; break; /* 11Mb/s fixed */
|
||||
default: return EINVAL;
|
||||
}
|
||||
case WI_RID_TX_CRYPT_KEY:
|
||||
if (ltv->wi_val > WI_NLTV_KEYS)
|
||||
return (EINVAL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,10 +85,11 @@ struct wi_key {
|
||||
u_int8_t wi_keydat[14];
|
||||
};
|
||||
|
||||
#define WI_NLTV_KEYS 4
|
||||
struct wi_ltv_keys {
|
||||
u_int16_t wi_len;
|
||||
u_int16_t wi_type;
|
||||
struct wi_key wi_keys[4];
|
||||
struct wi_key wi_keys[WI_NLTV_KEYS];
|
||||
};
|
||||
|
||||
struct wi_softc {
|
||||
|
Loading…
Reference in New Issue
Block a user