summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
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