-
Notifications
You must be signed in to change notification settings - Fork 685
Support 11w protected management frames #676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -495,7 +495,8 @@ iwn_attach(struct iwn_softc *sc, struct pci_attach_args *pa) | |
IEEE80211_C_MONITOR | /* monitor mode supported */ | ||
IEEE80211_C_SHSLOT | /* short slot time supported */ | ||
IEEE80211_C_SHPREAMBLE | /* short preamble supported */ | ||
IEEE80211_C_PMGT; /* power saving supported */ | ||
IEEE80211_C_PMGT | /* power saving supported */ | ||
IEEE80211_C_MFP; /* management frame protection 11w supported */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not all of the DVM cards' firmwares support 11w, original
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You made a good point. I quickly checked my N 6205 card, the tlv_feature_flags is 0x0b, and it doesn't include the bit IWN_UCODE_TLV_FLAGS_MFP (1<<2). It looks like the firmware doesn't tell support 11w, and it is actually working on my setup. It is unclear to me what's the best way to determine this feature flag. I'll leave the code for iwn as is without testing the firmware feature flags for now. May be there are some corner cases to be discovered. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I know why the dvm firmware doesn't support 11w. The firmware doesn't support install igtk hw keys. |
||
|
||
/* No optional HT features supported for now, */ | ||
ic->ic_htcaps = 0; | ||
|
@@ -3517,17 +3518,21 @@ iwn_tx(struct iwn_softc *sc, mbuf_t m, struct ieee80211_node *ni) | |
if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { | ||
/* Retrieve key for TX. */ | ||
k = ieee80211_get_txkey(ic, wh, ni); | ||
if (k->k_cipher != IEEE80211_CIPHER_CCMP) { | ||
if ((k->k_flags & IEEE80211_KEY_GROUP) || | ||
(k->k_flags & IEEE80211_KEY_IGTK) || | ||
(k->k_cipher != IEEE80211_CIPHER_CCMP)) { | ||
/* Do software encryption. */ | ||
if ((m = ieee80211_encrypt(ic, m, k)) == NULL) | ||
return ENOBUFS; | ||
/* 802.11 header may have moved. */ | ||
wh = mtod(m, struct ieee80211_frame *); | ||
// totlen = m->m_pkthdr.len; | ||
totlen = mbuf_pkthdr_len(m); | ||
|
||
} else /* HW appends CCMP MIC. */ | ||
k = NULL; /* skip hardware crypto below */ | ||
} else { | ||
/* HW appends CCMP MIC. */ | ||
totlen += IEEE80211_CCMP_HDRLEN; | ||
} | ||
} | ||
|
||
data->totlen = totlen; | ||
|
@@ -5855,6 +5860,7 @@ iwn_set_key(struct ieee80211com *ic, struct ieee80211_node *ni, | |
uint16_t kflags; | ||
|
||
if ((k->k_flags & IEEE80211_KEY_GROUP) || | ||
(k->k_flags & IEEE80211_KEY_IGTK) || | ||
k->k_cipher != IEEE80211_CIPHER_CCMP) | ||
return ieee80211_set_key(ic, ni, k); | ||
|
||
|
@@ -5884,6 +5890,7 @@ iwn_delete_key(struct ieee80211com *ic, struct ieee80211_node *ni, | |
struct iwn_node_info node; | ||
|
||
if ((k->k_flags & IEEE80211_KEY_GROUP) || | ||
(k->k_flags & IEEE80211_KEY_IGTK) || | ||
k->k_cipher != IEEE80211_CIPHER_CCMP) { | ||
/* See comment about other ciphers above. */ | ||
ieee80211_delete_key(ic, ni, k); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is wrong, what about
ieee80211_prf
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of the most confusing part. I didn't read the original 11w specification. I learnt this from reading the wpa_supplicant.
There are 2 major differences compare between HMAC-SHA1 PRF vs HMAC-SHA256 KDF/PRF.
Pairwise key expansion
label, there are differences counting the string length. In SHA1 PRF, the label is taken asPairwise key expansion\0
. In SHA256 PRF, the label is taken asPairwise key expansion
. This one-byte difference is causing incorrect key being generated.