Fix keyid bit position of encrypted packet to make non-first key usable.

This commit is contained in:
onoe 2001-06-25 12:11:59 +00:00
parent 4fe2f5eda7
commit 3e2b22f383

View File

@ -1,4 +1,4 @@
/* $NetBSD: awi_wep.c,v 1.6 2001/06/25 04:29:19 onoe Exp $ */
/* $NetBSD: awi_wep.c,v 1.7 2001/06/25 12:11:59 onoe Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -348,12 +348,12 @@ awi_wep_encrypt(sc, m0, txflag)
ivp[0] = (iv >> 16) & 0xff;
ivp[1] = (iv >> 8) & 0xff;
ivp[2] = iv & 0xff;
ivp[3] = kid & 0x03; /* clear pad and keyid */
ivp[IEEE80211_WEP_IVLEN] = kid << 6; /* pad and keyid */
noff += IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN;
} else {
ivp = mtod(m, u_int8_t *) + moff;
kid = ivp[IEEE80211_WEP_IVLEN] >> 6;
moff += IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN;
kid = ivp[IEEE80211_WEP_IVLEN] & 0x03;
}
key = sc->sc_wep_key[kid];
keylen = sc->sc_wep_keylen[kid];