<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>I found an issue with hostapd v0.5.3</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Currently, hostapd only sets the RSN capabilities field to either set or clear Bit 0: Pre-Authentication.  Bit 1: No Pairwise, Bits 2-3: PTKSA Replay Counter, and Bits 4-5: GTKSA Replay Counter are all not addressed (unless I am missing something).</DIV><DIV><BR class="khtml-block-placeholder"></DIV>From what I have seen PTKSA and GTKSA Replay Counters tend to vary based on semiconductor vendor.  This means it should not be a part of the /etc/hostapd.conf file.  The driver interface should query the driver for these values.  Under the net80211 interface it could be covered by doing a get of IEEE80211_IOC_RSNCAPS.  This would need to be done before generating the RSN-IE with the call to wpa_gen_wpa_ie().<DIV><DIV><DIV><DIV><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I worked around this in the following manner:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-style-span">I added an <I>int rsn_caps</I> field to <I>struct hostapd_bss_config</I> and <I>struct wpa_auth_config</I>.  Since <I>ieee802_1x_init()</I> is called before <I>wpa_init()</I>, I made the <I>driver_bsd.set_ieee8021x</I> handler, inside <I>bsd_configure_wpa()</I>, get the RSN caps, clear or set the preauth bit appropriately, and then save that to <I>hapd-&gt;conf-&gt;rsn_caps</I>. </SPAN></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>v = 0;</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>if (get80211param(drv, IEEE80211_IOC_RSNCAPS, &amp;v)) {</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                </SPAN><I>printf("Unable to set RSN capabilities to 0x%x\n", v);</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                </SPAN><I>return -1;</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>}</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>HOSTAPD_DEBUG(HOSTAPD_DEBUG_MINIMAL,</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                </SPAN><I>"%s: got rsn capabilities=0x%x\n", __func__, v);</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>if (conf-&gt;rsn_preauth) {</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                </SPAN><I>v |= RSN_CAP_PREAUTH;</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>}</I><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>else {</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                </SPAN><I>v &amp;= ((0xFF &lt;&lt; 8) | (0xFF &amp; ~RSN_CAP_PREAUTH));</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>}</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>HOSTAPD_DEBUG(HOSTAPD_DEBUG_MINIMAL,</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                </SPAN><I>"%s: setting rsn capabilities=0x%x\n", __func__, v);</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>if (set80211param(drv, IEEE80211_IOC_RSNCAPS, v)) {</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                </SPAN><I>printf("Unable to set RSN capabilities to 0x%x\n", v);</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                </SPAN><I>return -1;</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>}</I></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>conf-&gt;rsn_caps = v;</I></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-style-span"><I>hostapd_wpa_auth_conf()</I> then stores this value into the <I>struct wpa_auth_config </I>along with the rest of the values<I>. </I>Now that the proper version of RSN caps is passed around <I>wpa_write_rsn_ie()</I> can generate this by changing </SPAN></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-style-span"><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>*pos++ = conf-&gt;rsn_preauth ? BIT(0) : 0;</I></SPAN></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>to do the following </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><I>*pos++ = conf-&gt;rsn_caps;</I></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>All of this is predicated upon the vendor driver actually handling rsn_caps appropriately, and not just for the preauth bit.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks,</DIV><DIV>Chris</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-- </DIV><DIV>Chris Zimmermann</DIV><DIV><A href="mailto:cbzimmermann@mac.com">cbzimmermann@mac.com</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></DIV></DIV></DIV></BODY></HTML>