summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2002-03-02 00:06:23 +0000
committerbrooks <brooks@FreeBSD.org>2002-03-02 00:06:23 +0000
commit0fa4aee42b6bf42a14ef1b312b3f19cbbf56a8ad (patch)
treef853b85981657eae72fc4adc7bdcf960aad5110f /sys/dev
parent0f9133b440d0bd2b95703650996f60adc10ef0dd (diff)
downloadFreeBSD-src-0fa4aee42b6bf42a14ef1b312b3f19cbbf56a8ad.zip
FreeBSD-src-0fa4aee42b6bf42a14ef1b312b3f19cbbf56a8ad.tar.gz
Make 128-bit WEP (aka 104-bit WEP) work with Prism based cards.
Submitted by: Thomas Skibo <skibo@pacbell.net> MFC after: 3 days
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/wi/if_wi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 317a4bc..dc5ac7c 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -1186,16 +1186,19 @@ wi_write_record(sc, ltv)
case WI_RID_DEFLT_CRYPT_KEYS:
{
int error;
+ int keylen;
struct wi_ltv_str ws;
struct wi_ltv_keys *wk =
(struct wi_ltv_keys *)ltv;
+ keylen = wk->wi_keys[sc->wi_tx_key].wi_keylen;
+
for (i = 0; i < 4; i++) {
- ws.wi_len = 4;
+ bzero(&ws, sizeof(ws));
+ ws.wi_len = (keylen > 5) ? 8 : 4;
ws.wi_type = WI_RID_P2_CRYPT_KEY0 + i;
memcpy(ws.wi_str,
- &wk->wi_keys[i].wi_keydat, 5);
- ws.wi_str[5] = '\0';
+ &wk->wi_keys[i].wi_keydat, keylen);
error = wi_write_record(sc,
(struct wi_ltv_gen *)&ws);
if (error)
OpenPOWER on IntegriCloud