skip to content

In hostapd, how can TKIP stay enabled through wpa_pairwise, rsn_pairwise or the group cipher, and what removes it for good?

level: seniorimportance: should knowfreq 12%

answer

  1. WPA2 pairwise copies the WPA default
  2. group cipher follows the pairwise lists
  3. group rekey default depends on cipher
  4. build option removes TKIP entirely

basics

~20 s

In hostapd, wpa_pairwise defaults to TKIP and rsn_pairwise copies it, so a WPA2 section left untouched offers TKIP, and TKIP in any enabled list becomes the group cipher too. Set rsn_pairwise=CCMP, or build with CONFIG_NO_TKIP=y.

solid answer

~30 s

In hostapd.conf, `wpa_pairwise` (for WPA version 1) defaults to TKIP, and `rsn_pairwise` takes the `wpa_pairwise` value when unset, so `wpa=2` with no cipher lines offers TKIP in the default build. The group cipher is chosen automatically from the enabled pairwise lists: if any contains TKIP, the group cipher is TKIP, which also changes the `wpa_group_rekey` default from 86400 to 600 seconds. So a mixed `wpa=3` SSID gives even CCMP clients a TKIP group key. Set `rsn_pairwise=CCMP`, drop WPA version 1, or build with `CONFIG_NO_TKIP=y` (hostapd 2.10) to remove TKIP.

code

ini · 10 lines
ini
# hostapd's settings: WPA and WPA2 together, kept for a legacy device
ssid=corp-example
wpa=3
wpa_key_mgmt=WPA-PSK
wpa_passphrase=placeholder-passphrase-1
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
# Group cipher is chosen automatically: the enabled WPA (v1) list
# contains TKIP, so TKIP is the group cipher and wpa_group_rekey
# defaults to 600 seconds, even for WPA2 clients using CCMP.

go deeper

for a junior

Know that hostapd can still offer TKIP and that CCMP-only settings or a no-TKIP build remove it.

for a middle

Explain how rsn_pairwise inherits from wpa_pairwise, how the group cipher is derived and why the group rekey default differs.

for a senior

Audit a configuration for the mixed-mode trap, where a TKIP group key persists under a CCMP-looking SSID, and prove the removal with the advertised suite lists.

for a principal

Standardise the cipher baseline in the build and the templates, so a stray copied line cannot bring TKIP back and every exception has an owner.

## The settings and how they interact These are hostapd's settings, not the standard's names. The standard defines cipher suites; hostapd.conf spells how an access point built on hostapd selects them. - **`wpa`** is a bit field: bit 0 enables WPA (version 1), bit 1 enables RSN (WPA2, and also WPA3, which uses RSN too). `wpa=2` is RSN only; `wpa=3` offers both. - **`wpa_pairwise`** lists the pairwise ciphers for WPA version 1. Its default is TKIP. - **`rsn_pairwise`** lists the pairwise ciphers for RSN. When unset it takes the `wpa_pairwise` value. - **The group cipher** is chosen automatically from the enabled lists. hostapd.conf says that if only CCMP is allowed pairwise, the group cipher is CCMP and otherwise TKIP; in the source, a TKIP entry in any list of an enabled version makes TKIP the group cipher. `group_cipher` can override this, but the file calls that mainly a testing aid with interoperability risks. | Configuration (default build) | Pairwise offered | Group cipher | Default `wpa_group_rekey` | |---|---|---|---| | `wpa=2`, no cipher lines | TKIP only | TKIP | 600 s | | `wpa=3`, `wpa_pairwise=TKIP CCMP`, `rsn_pairwise=CCMP` | WPA: TKIP and CCMP; WPA2: CCMP | TKIP | 600 s | | `wpa=2`, `rsn_pairwise=CCMP` | CCMP | CCMP | 86400 s | The second row is the trap. The SSID looks like a WPA2 network with a CCMP-only pairwise list, but because WPA version 1 is still enabled, every client shares a TKIP group key and the group key is replaced every ten minutes. ## Removing TKIP ```ini # hostapd's settings: RSN only, CCMP pairwise, so the group cipher is CCMP ssid=corp-example wpa=2 wpa_key_mgmt=WPA-PSK wpa_passphrase=placeholder-passphrase-1 rsn_pairwise=CCMP ``` 1. **Configuration:** enable RSN only and set `rsn_pairwise=CCMP`; the group cipher then follows automatically. 2. **Build:** `CONFIG_NO_TKIP=y`, added in hostapd 2.10 (2022-01-16). The default build still includes TKIP so mixed WPA and WPA2 networks can work, and the build file's own comment says TKIP "should not be used anymore". Version 2.10 also removed WEP from the default build. 3. **Evidence:** a TKIP entry shows up as selector 00-0F-AC:2 in the cipher suite lists that the access point advertises. ## Auditing a configuration 1. Read `wpa`, `wpa_pairwise` and `rsn_pairwise` together, and compute the group cipher from them as above; do not trust the SSID's label. 2. Check how the binary was built, since a no-TKIP build changes the defaults. 3. Compare with what the access point advertises: a leftover TKIP entry in the cipher suite lists is the proof, whatever the configuration file says. ## Rekey settings - **`wpa_group_rekey`:** 86400 seconds with CCMP or GCMP as group cipher, 600 seconds with TKIP. - **`wpa_ptk_rekey`:** a maximum PTK lifetime in seconds; hostapd's comment says it can enforce PTK rekeying "to mitigate some attacks against TKIP deficiencies". It was added in hostapd 0.6.6 (2008-11-23), and the comment warns that PTK rekeying is buggy with many devices, so it needs testing before use. - The other rekey settings are not TKIP mitigations: `wpa_strict_rekey` rekeys the group key when a station that holds it leaves, and `wpa_gmk_rekey` covers the master key used internally to generate group keys. ## Consequences for a leftover TKIP device A TKIP-only station has no cipher in common with a BSS whose lists exclude TKIP, so it cannot complete association, and that failure is the evidence that the device needs replacing. hostapd also refuses an HT or VHT association that uses a TKIP pairwise cipher; the rate consequences belong to the comparison of Wi-Fi security generations.

  • What does CONFIG_NO_TKIP=y change beyond refusing a TKIP line in the configuration?
    It is a build-time switch that removes TKIP support from the binary. In hostapd's source the built-in default pairwise and group ciphers become CCMP and the macros listing allowed cipher suites omit TKIP, so TKIP is no longer a default that an unedited configuration can fall back on.
  • Why can setting rsn_pairwise=CCMP alone still leave TKIP in use?
    If WPA version 1 is still enabled with TKIP in wpa_pairwise, the group cipher is chosen across both lists and becomes TKIP, and the version 1 clients keep TKIP pairwise. Only enabling RSN alone, or removing TKIP from every enabled list, removes it.

  • Assumes a WPA2 SSID is CCMP-only because the label says WPA2.
  • Thinks the group cipher is independent of the pairwise lists.
  • Believes wpa_group_rekey is the same 86400 seconds whatever the group cipher.
  • Treats wpa_ptk_rekey as a way to make TKIP safe to keep.
  • Believes rsn_pairwise=CCMP alone always removes TKIP from a mixed WPA and WPA2 SSID.