Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Apr 2008 17:58:18 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 139141 for review
Message-ID:  <200804011758.m31HwIKW090962@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=139141

Change 139141 by sam@sam_ebb on 2008/04/01 17:57:43

	correct handling of tx-only TKIP keys: copy the appropriate
	mic key (was previously masked by hostapd marking group keys
	as tx/rx)

Affected files ...

.. //depot/projects/vap/sys/dev/ath/if_ath.c#54 edit

Differences ...

==== //depot/projects/vap/sys/dev/ath/if_ath.c#54 (text+ko) ====

@@ -2071,7 +2071,7 @@
 			/*
 			 * Room for both TX+RX MIC keys in one key cache
 			 * slot, just set key at the first index; the hal
-			 * will handle the reset.
+			 * will handle the rest.
 			 */
 			memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic));
 #if HAL_ABI_VERSION > 0x06052200
@@ -2080,13 +2080,16 @@
 			KEYPRINTF(sc, k->wk_keyix, hk, mac);
 			return ath_hal_keyset(ah, k->wk_keyix, hk, mac);
 		}
-	} else if (k->wk_flags & IEEE80211_KEY_XR) {
-		/*
-		 * TX/RX key goes at first index.
-		 * The hal handles the MIC keys are index+64.
-		 */
-		memcpy(hk->kv_mic, k->wk_flags & IEEE80211_KEY_XMIT ?
-			k->wk_txmic : k->wk_rxmic, sizeof(hk->kv_mic));
+	} else if (k->wk_flags & IEEE80211_KEY_XMIT) {
+#if HAL_ABI_VERSION > 0x06052200
+		memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic));
+#else
+		memcpy(hk->kv_mic, k->wk_mic, sizeof(hk->kv_mic));
+#endif
+		KEYPRINTF(sc, k->wk_keyix, hk, mac);
+		return ath_hal_keyset(ah, k->wk_keyix, hk, mac);
+	} else if (k->wk_flags & IEEE80211_KEY_RECV) {
+		memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic));
 		KEYPRINTF(sc, k->wk_keyix, hk, mac);
 		return ath_hal_keyset(ah, k->wk_keyix, hk, mac);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804011758.m31HwIKW090962>