Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1264fc04 authored by James Ketrenos's avatar James Ketrenos Committed by Jeff Garzik
Browse files

[PATCH] ieee80211: Fix TKIP, repeated fragmentation problem, and payload_size reporting



tree 8428e9f510e6ad6c77baec89cb57374842abf733
parent d78bfd3ddae9c422dd350159110f9c4d7cfc50de
author Liu Hong <hong.liu@intel.com> 1124446520 -0500
committer James Ketrenos <jketreno@linux.intel.com> 1127313183 -0500

Fix TKIP, repeated fragmentation problem, and payload_size reporting

1. TKIP encryption
    Originally, TKIP encryption issues msdu + mpdu encryption on every
    fragment. Change the behavior to msdu encryption on the whole
    packet, then mpdu encryption on every fragment.

2. Avoid repeated fragmentation when !host_encrypt.
    We only need do fragmentation when using host encryption. Otherwise
    we only need pass the whole packet to driver, letting driver do the
    fragmentation.

3. change the txb->payload_size to correct value
    FW will use this value to determine whether to do fragmentation. If
    we pass the wrong value, fw may cut on the wrong bound which will
    make decryption fail when we do host encryption.

NOTE:  This requires changing drivers (hostap) that have
extra_prefix_len used within them (structure member name change).

Signed-off-by: default avatarHong Liu <liu.hong@intel.com>
Signed-off-by: default avatarJames Ketrenos <jketreno@linux.intel.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 3f552bbf
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -724,7 +724,9 @@ struct ieee80211_device {

	/* If the host performs {en,de}cryption, then set to 1 */
	int host_encrypt;
	int host_encrypt_msdu;
	int host_decrypt;
	int host_open_frag;
	int ieee802_1x;		/* is IEEE 802.1X used */

	/* WPA data */
+2 −1
Original line number Diff line number Diff line
@@ -63,7 +63,8 @@ struct ieee80211_crypto_ops {
	 * extra_postfix_len; encrypt need not use all this space, but
	 * the result must start at the beginning of the buffer and correct
	 * length must be returned */
	int extra_prefix_len, extra_postfix_len;
	int extra_mpdu_prefix_len, extra_mpdu_postfix_len;
	int extra_msdu_prefix_len, extra_msdu_postfix_len;

	struct module *owner;
};
+2 −2
Original line number Diff line number Diff line
@@ -221,8 +221,8 @@ static struct ieee80211_crypto_ops ieee80211_crypt_null = {
	.decrypt_msdu = NULL,
	.set_key = NULL,
	.get_key = NULL,
	.extra_prefix_len = 0,
	.extra_postfix_len = 0,
	.extra_mpdu_prefix_len = 0,
	.extra_mpdu_postfix_len = 0,
	.owner = THIS_MODULE,
};

+2 −2
Original line number Diff line number Diff line
@@ -436,8 +436,8 @@ static struct ieee80211_crypto_ops ieee80211_crypt_ccmp = {
	.set_key = ieee80211_ccmp_set_key,
	.get_key = ieee80211_ccmp_get_key,
	.print_stats = ieee80211_ccmp_print_stats,
	.extra_prefix_len = CCMP_HDR_LEN,
	.extra_postfix_len = CCMP_MIC_LEN,
	.extra_mpdu_prefix_len = CCMP_HDR_LEN,
	.extra_mpdu_postfix_len = CCMP_MIC_LEN,
	.owner = THIS_MODULE,
};

+3 −2
Original line number Diff line number Diff line
@@ -690,8 +690,9 @@ static struct ieee80211_crypto_ops ieee80211_crypt_tkip = {
	.set_key = ieee80211_tkip_set_key,
	.get_key = ieee80211_tkip_get_key,
	.print_stats = ieee80211_tkip_print_stats,
	.extra_prefix_len = 4 + 4,	/* IV + ExtIV */
	.extra_postfix_len = 8 + 4,	/* MIC + ICV */
	.extra_mpdu_prefix_len = 4 + 4,	/* IV + ExtIV */
	.extra_mpdu_postfix_len = 4,	/* ICV */
	.extra_msdu_postfix_len = 8,	/* MIC */
	.owner = THIS_MODULE,
};

Loading