]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
4 years agoD-Bus: Add MAC address randomization endpoints
Eric Caruso [Thu, 17 Oct 2019 23:03:51 +0000 (16:03 -0700)] 
D-Bus: Add MAC address randomization endpoints

Add D-Bus property:
* MACAddressRandomizationMask: a{say}

which configure random MAC address functionality in the Wi-Fi
driver via netlink.

Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
4 years agoMove ownership of MAC address randomization mask to scan params
Eric Caruso [Thu, 17 Oct 2019 23:03:50 +0000 (16:03 -0700)] 
Move ownership of MAC address randomization mask to scan params

This array can be freed either from the scan parameters or from
clearing the MAC address randomization parameters from the
wpa_supplicant struct. To make this ownership more clear, we have
each struct own its own copy of the parameters.

Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
4 years agoDPP: Mention ssid and pass parameters for DPP_AUTH_INIT in documentation
Jouni Malinen [Sun, 27 Oct 2019 16:38:07 +0000 (18:38 +0200)] 
DPP: Mention ssid and pass parameters for DPP_AUTH_INIT in documentation

These parameter use hexdump values over the control interface, so
mention them in the DPP example documentation.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP configuration saving
Jouni Malinen [Sun, 27 Oct 2019 15:10:35 +0000 (17:10 +0200)] 
tests: DPP configuration saving

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoJSON: Fix escaping of characters that have MSB=1 with signed char
Jouni Malinen [Sun, 27 Oct 2019 15:08:31 +0000 (17:08 +0200)] 
JSON: Fix escaping of characters that have MSB=1 with signed char

The "\\u%04x" printf string did not really work in the correct way if
char is signed. Fix this by type casting this to unsigned char.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Add negative scan tests
Johannes Berg [Tue, 8 Oct 2019 12:11:09 +0000 (14:11 +0200)] 
tests: Add negative scan tests

There was a bug in wmediumd in that it didn't set the
frequency of frames, and thus they were always received
by mac80211_hwsim, regardless of channel it was on.

Add two tests that verify we only find a single instance
of an AP if we only have that one, and run this both with
and without wmediumd.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years agotests: Make wpas_mesh_pmksa_caching_ext more robust
Jouni Malinen [Sun, 27 Oct 2019 14:20:19 +0000 (16:20 +0200)] 
tests: Make wpas_mesh_pmksa_caching_ext more robust

Avoid race conditions in completing mesh group removal/re-addition steps
and starting connectivity check. It seemed to be possible to get to the
connectivity test in some cases before the mesh STA had rejoined the
mesh and completed key configuration.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agodbus: Export OWE capability and OWE BSS key_mgmt
Beniamino Galvani [Sun, 13 Oct 2019 13:18:54 +0000 (15:18 +0200)] 
dbus: Export OWE capability and OWE BSS key_mgmt

Export a new 'owe' capability to indicate that wpa_supplicant was
built with OWE support and accepts 'key_mgmt=OWE'. Also, support 'owe'
in the array of BSS' available key managements.

Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
4 years agoD-Bus: Fix P2P NULL dereference after interface removal
Davide Caratti [Wed, 2 Oct 2019 12:08:41 +0000 (14:08 +0200)] 
D-Bus: Fix P2P NULL dereference after interface removal

When the P2P management interface is deleted, P2P is then disabled and
global->p2p_init_wpa_s is set to NULL. After that, other interfaces can
still trigger P2P functions (like wpas_p2p_find()) using D-Bus. This
makes wpa_supplicant terminate with SIGSEGV, because it dereferences a
NULL pointer. Fix this by adding proper checks, like it's done with
wpa_cli.

CC: Beniamino Galvani <bgalvani@redhat.com>
CC: Benjamin Berg <benjamin@sipsolutions.net>
Reported-by: Vladimir Benes <vbenes@redhat.com>
Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
4 years agonl80211: Indicate SUITE_B_192 capa only when CCMP-256/GCMP-256 supported
Mikael Kanstrup [Tue, 1 Oct 2019 14:19:29 +0000 (16:19 +0200)] 
nl80211: Indicate SUITE_B_192 capa only when CCMP-256/GCMP-256 supported

SUITE_B_192 AKM capability was indicated for all devices using the
nl80211 driver (without the QCA vendor specific AKM capability
indication). However, some devices can't handle Suite B 192 due to
insufficient ciphers supported. Add a check for CCMP-256 or GCMP-256
cipher support and only indicate SUITE_B_192 capability when such cipher
is supported. This allows compiling with CONFIG_SUITEB192 and still get
proper response to the 'GET_CAPABILITY key_mgmt' command. Under Android
it can also serve as a dynamic way for HAL to query platform for
WPA3-Enterprise 192-bit support.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
4 years agotests: Additional SAE protocol testing
Jouni Malinen [Sun, 27 Oct 2019 13:16:03 +0000 (15:16 +0200)] 
tests: Additional SAE protocol testing

Check behavior with delayed/replayed SAE commit message.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoSAE: Ignore commit message when waiting for confirm in STA mode
Jouni Malinen [Sun, 27 Oct 2019 12:35:04 +0000 (14:35 +0200)] 
SAE: Ignore commit message when waiting for confirm in STA mode

Previously, an unexpected SAE commit message resulted in forcing
disconnection. While that allowed recovery by starting from scratch,
this is not really necessary. Ignore such unexpected SAE commit message
instead and allow SAE confirm message to be processed after this. This
is somewhat more robust way of handling the cases where SAE commit
message might be retransmitted either in STA->AP or AP->STA direction.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDo not indicate possible PSK failure when using SAE
Jouni Malinen [Sun, 27 Oct 2019 10:54:40 +0000 (12:54 +0200)] 
Do not indicate possible PSK failure when using SAE

wpa_key_mgmt_wpa_psk() includes SAE AKMs. However, with SAE, there is no
way of reaching 4-way handshake without the password having already been
verified as part of SAE authentication. As such, a failure to complete
4-way handshake with SAE cannot indicate that the used password was
incorrect.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Add STA node details in AP through QCA vendor subcommand
Shiva Sankar Gajula [Wed, 16 Oct 2019 07:43:32 +0000 (13:13 +0530)] 
nl80211: Add STA node details in AP through QCA vendor subcommand

Addi STA node details in AP through QCA vendor subcommand
QCA_NL80211_VENDOR_SUBCMD_ADD_STA_NODE vendor when processing FT
protocol roaming.

Signed-off-by: Shiva Sankar Gajula <sgajula@codeaurora.org>
4 years agoAdd QCA vendor cmd for setting BT coex chain mode
Yu Wang [Tue, 15 Oct 2019 09:10:07 +0000 (17:10 +0800)] 
Add QCA vendor cmd for setting BT coex chain mode

To config BT coex chain mode, add a new QCA sub command
QCA_NL80211_VENDOR_SUBCMD_BTC_CHAIN_MODE.

This new command has two attributes:
1. QCA_VENDOR_ATTR_COEX_BTC_CHAIN_MODE: u32 attribute. Indicates the
   BT coex chain mode, are 32-bit values from enum qca_btc_chain_mode.
2. QCA_VENDOR_ATTR_COEX_BTC_CHAIN_MODE_RESTART: flag attribute.
   If set, vdev should be restarted once BT coex chain mode is updated.

Signed-off-by: Yu Wang <yyuwang@codeaurora.org>
4 years agoExtend QCA OEM data vendor subcmd to allow use as an event
Ashish Kumar Dhanotiya [Fri, 18 Oct 2019 11:03:15 +0000 (16:33 +0530)] 
Extend QCA OEM data vendor subcmd to allow use as an event

The QCA_NL80211_VENDOR_SUBCMD_OEM_DATA command was previously defined
only to pass data blobs from user space to kernel (application to
firmware) but there was no mechanism to send the data blobs from
firmware to application. Extend this to define use of the same
subcommand and attributes as vendor events.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: SAE and authentication restarts with H2E/looping
Jouni Malinen [Fri, 25 Oct 2019 12:57:47 +0000 (15:57 +0300)] 
tests: SAE and authentication restarts with H2E/looping

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Determine H2E vs. looping when restarting SAE auth in AP mode
Jouni Malinen [Fri, 25 Oct 2019 12:54:11 +0000 (15:54 +0300)] 
SAE: Determine H2E vs. looping when restarting SAE auth in AP mode

If hostapd had existing STA SAE state, e.g., from a previously completed
SAE authentication, a new start of a separate SAE authentication (i.e.,
receiving of a new SAE commit) ended up using some of the previous
state. This is problematic for determining whether to H2E vs. looping
since the STA is allowed (even if not really expected to) to change
between these two alternatives. This could result in trying to use H2E
when STA was using looping to derive PWE and that would result in SAE
confirm failing.

Fix this by determining whether to use H2E or looping for the restarted
authentication based on the Status Code in the new SAE commit message
instead of previously cached state information.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agocrypto: Remove unused crypto_bignum_sqrtmod()
Jouni Malinen [Fri, 25 Oct 2019 11:34:44 +0000 (14:34 +0300)] 
crypto: Remove unused crypto_bignum_sqrtmod()

This wrapper function is not used anymore, so drop it instead of trying
to figure out good way of implementing it in constant time with various
crypto libraries.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Drop sqrt() alternative from SSWU (H2E)
Jouni Malinen [Fri, 25 Oct 2019 11:32:05 +0000 (14:32 +0300)] 
SAE: Drop sqrt() alternative from SSWU (H2E)

Remove support for performing full sqrt(), i.e., only support curves
that use prime with p = 3 mod 4. In practice, this drops only group 26
with SAE H2E. This seems acceptable since there does not seem to be any
strong use case for that group taken into account the limits being
placed on acceptable prime lengths.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Remove SAE H2E testing with group 26
Jouni Malinen [Fri, 25 Oct 2019 11:36:50 +0000 (14:36 +0300)] 
tests: Remove SAE H2E testing with group 26

This is in preparation of an implementation to to remove the alternative
SSWU path that was needed only for this particular group.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Fix copy-paste issues in SAE H2E group tests
Jouni Malinen [Fri, 25 Oct 2019 11:31:01 +0000 (14:31 +0300)] 
tests: Fix copy-paste issues in SAE H2E group tests

These test cases were all using group 21 even though they were supposed
to go through all the possible groups.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowpa_supplicant: Fix arithmetic on void pointer
Jesus Fernandez Manzano [Wed, 9 Oct 2019 07:59:33 +0000 (09:59 +0200)] 
wpa_supplicant: Fix arithmetic on void pointer

When using void pointers in calculations, the behavior is undefined.
Arithmetic operations on 'void *' is a GNU C extension,
which defines the 'sizeof(void)' to be 1.

This change improves portability of the code.

Signed-off-by: Jesus Fernandez Manzano <jesus.manzano@galgus.net>
4 years agocommon: Fix same expression checked twice in fils_key_auth_sk()
Jesus Fernandez Manzano [Tue, 8 Oct 2019 19:37:31 +0000 (21:37 +0200)] 
common: Fix same expression checked twice in fils_key_auth_sk()

Signed-off-by: Jesus Fernandez Manzano <jesus.manzano@galgus.net>
4 years agotests: HE AP Functionality
Pradeep Kumar Chitrapu [Wed, 16 Oct 2019 18:57:39 +0000 (11:57 -0700)] 
tests: HE AP Functionality

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
4 years agoHE: Add 11ax info to ap mode ctrl iface STATUS command
Pradeep Kumar Chitrapu [Wed, 16 Oct 2019 18:57:38 +0000 (11:57 -0700)] 
HE: Add 11ax info to ap mode ctrl iface STATUS command

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
4 years agoFix AP Extended Capability length determination
Jouni Malinen [Mon, 21 Oct 2019 15:11:30 +0000 (18:11 +0300)] 
Fix AP Extended Capability length determination

The IE minimum length determination in hostapd_eid_ext_capab() was not
fully up to date with the hostapd_ext_capab_byte() conditions. This
could result in omitting some of the capability octets depending on
configuration. Fix this by adding the missing conditions.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoP2P: Continue listening next request if no post-PD operations
Jimmy Chen [Thu, 17 Oct 2019 13:36:50 +0000 (21:36 +0800)] 
P2P: Continue listening next request if no post-PD operations

If there are no post-provision discovery operations, we should continue
in find mode to avoid getting the p2p_find operation stopped (stuck in
SEARCH state) unexpectedly.

Signed-off-by: Jimmy Chen <jimmycmchen@google.com>
4 years agoFix hostapd build with CONFIG_WPA_TRACE but no CONFIG_WPA_TRACE_BFD
Brian Norris [Thu, 17 Oct 2019 23:19:15 +0000 (16:19 -0700)] 
Fix hostapd build with CONFIG_WPA_TRACE but no CONFIG_WPA_TRACE_BFD

Otherwise, we may get linker failures:

  ld.lld: error: unable to find library -lbfd

While we're at it, pull in the library selection fixes from commit
848905b12abf ("Avoid undefined references with CONFIG_WPA_TRACE_BFD=y").

Signed-off-by: Brian Norris <briannorris@chromium.org>
4 years agodbus: Suppress to show NULL string
Masashi Honma [Fri, 18 Oct 2019 02:04:19 +0000 (11:04 +0900)] 
dbus: Suppress to show NULL string

wpa_s->dbus_groupobj_path is always NULL so suppress to show it.
This was found by gcc 9.2.1 warning.

dbus/dbus_new.c: In function ‘wpas_dbus_unregister_p2p_group’:
dbus/dbus_new.c:4793:3: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
 4793 |   wpa_printf(MSG_DEBUG,
      |   ^~~~~~~~~~~~~~~~~~~~~
 4794 |       "%s: Group object '%s' already unregistered",
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 4795 |       __func__, wpa_s->dbus_groupobj_path);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
4 years agoInterworking: Check NULL string to avoid compiler warning
Masashi Honma [Fri, 18 Oct 2019 02:04:18 +0000 (11:04 +0900)] 
Interworking: Check NULL string to avoid compiler warning

Fix warning by gcc 9.2.1.

interworking.c: In function ‘interworking_home_sp_cred’:
interworking.c:2263:3: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
 2263 |   wpa_msg(wpa_s, MSG_DEBUG,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
 2264 |    "Interworking: Search for match with SIM/USIM domain %s",
      |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2265 |    realm);
      |    ~~~~~~

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
4 years agoFix name of DBus interface in defconfig
Phil Wise [Mon, 2 Sep 2019 15:58:40 +0000 (16:58 +0100)] 
Fix name of DBus interface in defconfig

Signed-off-by: Phil Wise <phil@phil-wise.com>
4 years agotests: Make ap_ft_ap_oom4 more robust against compiler optimizations
Jouni Malinen [Fri, 18 Oct 2019 21:45:57 +0000 (00:45 +0300)] 
tests: Make ap_ft_ap_oom4 more robust against compiler optimizations

It looks like the wpa_auth_get_seqnum() function might not always be
visible in the backtrace since the compiler may optimize that wrapper
away. Use the i802_get_seqnum() function instead as a trigger for the
get_seqnum operation failure trigger to avoid this.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFT-SAE: Add RSNXE into FT MIC
Jouni Malinen [Fri, 18 Oct 2019 13:20:27 +0000 (16:20 +0300)] 
FT-SAE: Add RSNXE into FT MIC

Protect RSNXE, if present, in FT Reassociation Request/Response frames.
This is needed for SAE H2E with FT.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd RSNXE into (Re)Association Response frames
Jouni Malinen [Fri, 18 Oct 2019 12:49:32 +0000 (15:49 +0300)] 
Add RSNXE into (Re)Association Response frames

Add the new RSNXE into (Re)Association Response frames if any of the
capability bits is nonzero.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: WPA2-PSK-FT-SAE AP (H2E)
Jouni Malinen [Fri, 18 Oct 2019 12:33:14 +0000 (15:33 +0300)] 
tests: WPA2-PSK-FT-SAE AP (H2E)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoMerge wpa_supplicant and hostapd EAPOL-Key KDE parsers
Jouni Malinen [Fri, 18 Oct 2019 10:02:27 +0000 (13:02 +0300)] 
Merge wpa_supplicant and hostapd EAPOL-Key KDE parsers

Use a single struct definition and a single shared implementation for
parsing EAPOL-Key KDEs and IEs instead of maintaining more or less
identical functionality separately for wpa_supplicant and hostapd.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Verify that STA negotiated H2E if it claims to support it
Jouni Malinen [Fri, 18 Oct 2019 09:38:11 +0000 (12:38 +0300)] 
SAE: Verify that STA negotiated H2E if it claims to support it

If a STA indicates support for SAE H2E in RSNXE and H2E is enabled in
the AP configuration, require H2E to be used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoRSN: Verify RSNXE match between (Re)AssocReq and EAPOL-Key msg 2/4
Jouni Malinen [Thu, 17 Oct 2019 21:17:51 +0000 (00:17 +0300)] 
RSN: Verify RSNXE match between (Re)AssocReq and EAPOL-Key msg 2/4

If the STA advertises RSN Extension element, it has to be advertised
consistently in the unprotected ((Re)Association Request) and protected
(EAPOL-Key msg 2/4) frames. Verify that this is the case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd RSNXE into AP KDE parser
Jouni Malinen [Thu, 17 Oct 2019 21:13:32 +0000 (00:13 +0300)] 
Add RSNXE into AP KDE parser

This is needed for SAE hash-to-element implementation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoStore a copy of Association Request RSNXE in AP mode for later use
Jouni Malinen [Thu, 17 Oct 2019 21:11:24 +0000 (00:11 +0300)] 
Store a copy of Association Request RSNXE in AP mode for later use

This is needed to be able to compare the received RSNXE to a protected
version in EAPOL-Key msg 2/4.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Add RSNXE in Association Request and EAPOL-Key msg 2/4
Jouni Malinen [Thu, 17 Oct 2019 13:54:05 +0000 (16:54 +0300)] 
SAE: Add RSNXE in Association Request and EAPOL-Key msg 2/4

Add the new RSNXE into (Re)Association Request frames and EAPOL-Key msg
2/4 when using SAE with hash-to-element mechanism enabled. This allows
the AP to verify that there was no downgrade attack when both PWE
derivation mechanisms are enabled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd RSNXE into IE parser
Jouni Malinen [Thu, 17 Oct 2019 13:53:09 +0000 (16:53 +0300)] 
Add RSNXE into IE parser

This is needed for SAE hash-to-element implementation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoWPS: Check SHA256 result success
Jouni Malinen [Tue, 15 Oct 2019 12:34:41 +0000 (15:34 +0300)] 
WPS: Check SHA256 result success

These functions can fail in theory, so verify they succeeded before
comparing the hash values.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoQCA vendor command for adding a STA node
Shiva Sankar Gajula [Tue, 8 Oct 2019 00:57:59 +0000 (06:27 +0530)] 
QCA vendor command for adding a STA node

Add a QCA vendor subcommand QCA_NL80211_VENDOR_SUBCMD_ADD_STA_NODE with
attributes qca_wlan_vendor_attr_add_sta_node_params to add STA peer
entries in AP mode. This vendor sub command is used in FT roaming
scenario to send STA node information from application/service to
driver/firmware. The attributes defined in enum
qca_wlan_vendor_attr_add_sta_node_params are used to deliver the
parameters.

Signed-off-by: Shiva Sankar Gajula <sgajula@codeaurora.org>
4 years agoAdd a new QCA vendor attribute to carry device info for OEM data
Subrat Dash [Thu, 3 Oct 2019 16:12:46 +0000 (21:42 +0530)] 
Add a new QCA vendor attribute to carry device info for OEM data

The OEM data binary blobs from application/service will be routed to the
appropriate device based on this attribute value. This optional
attribute is used to specify whether the device type is virtual or
physical. This attribute can be omitted when the command is for a
virtual device.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoQCA vendor attributes to indicate BW-based agile spectral capability
Edayilliam Jayadev [Thu, 19 Sep 2019 09:15:44 +0000 (14:45 +0530)] 
QCA vendor attributes to indicate BW-based agile spectral capability

Some chipsets don't have the capability to run agile spectral scan with
160/80+80 MHz modes. Add separate agile spectral scanning capability
flags for 160, 80+80, and non-160 MHz modes to cover such cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agonl80211: Allow external auth based on SAE/FT-SAE key mgmt
Sunil Dutt [Mon, 8 Jul 2019 14:12:12 +0000 (19:42 +0530)] 
nl80211: Allow external auth based on SAE/FT-SAE key mgmt

In the SME-in-driver case, wpa_supplicant used only the selected SAE
auth_alg value as the trigger for enabling external authentication
support for SAE. This prevented the driver from falling back to full SAE
authentication if PMKSA caching was attempted (Open auth_alg selected)
and the cached PMKID had been dropped.

Enable external auth based on SAE/FT-SAE key_mgmt, rather than doing
this based on SAE auth_alg, so that the driver can go through full SAE
authentication in cases where PMKSA caching is attempted and it fails.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFST: Update FST about MAC address change
Dedy Lansky [Tue, 10 Sep 2019 09:53:55 +0000 (12:53 +0300)] 
FST: Update FST about MAC address change

Notify FST module upon MAC address change. FST module will update the
Multiband IE accordingly.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
4 years agoAP: Publish only HE capabilities and operation IEs on 6 GHz band
Andrei Otcheretianski [Wed, 19 Jun 2019 12:49:13 +0000 (15:49 +0300)] 
AP: Publish only HE capabilities and operation IEs on 6 GHz band

When operating on the 6 GHz band, add 6 GHz Operation Information inside
the HE Operation element and don't publish HT/VHT IEs.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
- Replace HOSTAPD_MODE_IEEE80211AX mode checks with is_6ghz_op_class()

Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
4 years agoAP: Add initial support for 6 GHz band
Andrei Otcheretianski [Wed, 19 Jun 2019 12:49:11 +0000 (15:49 +0300)] 
AP: Add initial support for 6 GHz band

Add support for new hardware mode for 6 GHz band. 6 GHz operation is
defined in IEEE P802.11ax/D4.3. 6 GHz band adds global operating classes
131-135 that define channels in frequency range from 5940 MHz to 7105
MHz.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
- Remove HOSTAPD_MODE_IEEE80211AX mode
- Replace check for HOSTAPD_MODE_IEEE80211AX with is_6ghz_freq()
- Move center_idx_to_bw_6ghz() to ieee802_11_common.c file

Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
4 years agoAP: Add op_class config item to specify 6 GHz channels uniquely
Liangwei Dong [Fri, 9 Aug 2019 04:27:46 +0000 (12:27 +0800)] 
AP: Add op_class config item to specify 6 GHz channels uniquely

Add hostapd config option "op_class" for fixed channel selection along
with existing "channel" option. "op_class" and "channel" config options
together can specify channels across 2.4 GHz, 5 GHz, and 6 GHz bands
uniquely.

Signed-off-by: Liangwei Dong <liangwei@codeaurora.org>
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
4 years agowpa_supplicant: Pass in operating class for channel validity checks
Jouni Malinen [Wed, 9 Oct 2019 15:49:42 +0000 (18:49 +0300)] 
wpa_supplicant: Pass in operating class for channel validity checks

This is needed to allow the 6 GHz operating classes to be compared
against the driver support channels since the channel numbers are not
really unique identifiers of a channel even within a single band.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: SAE PWE derivation methods
Jouni Malinen [Thu, 5 Sep 2019 09:34:48 +0000 (12:34 +0300)] 
tests: SAE PWE derivation methods

Verify behavior with sae_pwe configuration values 0..2, i.e., test the
new hash-to-element mechanism for deriving PWE and negotiation for which
method to use.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Check that peer's rejected groups are not enabled in AP
Jouni Malinen [Fri, 6 Sep 2019 12:51:37 +0000 (15:51 +0300)] 
SAE: Check that peer's rejected groups are not enabled in AP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: H2E version of SAE commit message handling for AP
Jouni Malinen [Fri, 6 Sep 2019 12:51:37 +0000 (15:51 +0300)] 
SAE: H2E version of SAE commit message handling for AP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Derive H2E PT in AP when starting the AP
Jouni Malinen [Fri, 6 Sep 2019 12:51:37 +0000 (15:51 +0300)] 
SAE: Derive H2E PT in AP when starting the AP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Check that peer's rejected groups are not enabled
Jouni Malinen [Fri, 6 Sep 2019 12:40:39 +0000 (15:40 +0300)] 
SAE: Check that peer's rejected groups are not enabled

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: H2E version of SAE commit message handling for STA
Jouni Malinen [Fri, 6 Sep 2019 12:40:39 +0000 (15:40 +0300)] 
SAE: H2E version of SAE commit message handling for STA

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Collect list of rejected groups for H2E in STA
Jouni Malinen [Fri, 6 Sep 2019 12:40:39 +0000 (15:40 +0300)] 
SAE: Collect list of rejected groups for H2E in STA

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Derive H2E PT in STA before connection
Jouni Malinen [Fri, 6 Sep 2019 12:40:39 +0000 (15:40 +0300)] 
SAE: Derive H2E PT in STA before connection

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoRSN: Verify RSNXE match between Beacon/ProbeResp and EAPOL-Key msg 3/4
Jouni Malinen [Fri, 6 Sep 2019 11:51:31 +0000 (14:51 +0300)] 
RSN: Verify RSNXE match between Beacon/ProbeResp and EAPOL-Key msg 3/4

If the AP advertises RSN Extension element, it has to be advertised
consistently in the unprotected (Beacon and Probe Response) and
protected (EAPOL-Key msg 3/4) frames. Verify that this is the case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Advertise Extended RSN Capabilities when H2E is enabled
Jouni Malinen [Thu, 5 Sep 2019 09:05:58 +0000 (12:05 +0300)] 
SAE: Advertise Extended RSN Capabilities when H2E is enabled

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Handle BSS membership selector indication for H2E-only in STA mode
Jouni Malinen [Sat, 7 Sep 2019 12:24:24 +0000 (15:24 +0300)] 
SAE: Handle BSS membership selector indication for H2E-only in STA mode

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Advertise BSS membership selector for H2E-only case
Jouni Malinen [Thu, 5 Sep 2019 08:54:47 +0000 (11:54 +0300)] 
SAE: Advertise BSS membership selector for H2E-only case

If hostapd is configured to enable only the hash-to-element version of
SAE PWE derivation (sae_pwe=1), advertise BSS membership selector to
indicate this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Add sae_pwe configuration parameter for wpa_supplicant
Jouni Malinen [Thu, 5 Sep 2019 09:38:32 +0000 (12:38 +0300)] 
SAE: Add sae_pwe configuration parameter for wpa_supplicant

This parameter can be used to specify which PWE derivation mechanism(s)
is enabled. This commit is only introducing the new parameter; actual
use of it will be address in separate commits.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Add sae_pwe configuration parameter for hostapd
Jouni Malinen [Thu, 5 Sep 2019 08:44:57 +0000 (11:44 +0300)] 
SAE: Add sae_pwe configuration parameter for hostapd

This parameter can be used to specify which PWE derivation mechanism(s)
is enabled. This commit is only introducing the new parameter; actual
use of it will be address in separate commits.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Module test for SAE hash-to-element crypto routines
Jouni Malinen [Tue, 27 Aug 2019 13:33:15 +0000 (16:33 +0300)] 
tests: Module test for SAE hash-to-element crypto routines

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Add Rejected Groups element into H2E Commit
Jouni Malinen [Tue, 27 Aug 2019 13:33:15 +0000 (16:33 +0300)] 
SAE: Add Rejected Groups element into H2E Commit

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Hash algorithm selection for H2E KCK/CN()
Jouni Malinen [Tue, 27 Aug 2019 13:33:15 +0000 (16:33 +0300)] 
SAE: Hash algorithm selection for H2E KCK/CN()

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Implement hash-to-element PT/PWE crypto routines
Jouni Malinen [Tue, 27 Aug 2019 13:33:15 +0000 (16:33 +0300)] 
SAE: Implement hash-to-element PT/PWE crypto routines

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Parse Rejected Groups element from H2E SAE commit
Jouni Malinen [Sat, 7 Sep 2019 15:38:29 +0000 (18:38 +0300)] 
SAE: Parse Rejected Groups element from H2E SAE commit

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Tell sae_parse_commit() whether H2E is used
Jouni Malinen [Sat, 7 Sep 2019 15:33:02 +0000 (18:33 +0300)] 
SAE: Tell sae_parse_commit() whether H2E is used

This will be needed to help parsing the received SAE commit.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: H2E protocol defines
Jouni Malinen [Fri, 6 Sep 2019 12:46:10 +0000 (15:46 +0300)] 
SAE: H2E protocol defines

These are the defined values/identifiers for SAE hash-to-element
mechanism from IEEE P802.11-REVmd/D3.0.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowolfSSL: Fix crypto_bignum_sub()
Jouni Malinen [Mon, 14 Oct 2019 16:27:47 +0000 (19:27 +0300)] 
wolfSSL: Fix crypto_bignum_sub()

The initial crypto wrapper implementation for wolfSSL seems to have
included a copy-paste error in crypto_bignum_sub() implementation that
was identical to crypto_bignum_add() while mp_sub() should have been
used instead of mp_add().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agocrypto: Add more bignum/EC helper functions
Jouni Malinen [Tue, 27 Aug 2019 13:33:15 +0000 (16:33 +0300)] 
crypto: Add more bignum/EC helper functions

These are needed for implementing SAE hash-to-element.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: PMF AP sending valid deauth/disassoc without dropping SA
Jouni Malinen [Fri, 11 Oct 2019 15:18:43 +0000 (18:18 +0300)] 
tests: PMF AP sending valid deauth/disassoc without dropping SA

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: WPA2-PSK PMF AP dropping SA
Jouni Malinen [Fri, 11 Oct 2019 14:53:04 +0000 (17:53 +0300)] 
tests: WPA2-PSK PMF AP dropping SA

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut DPP TCP Enrollee as initiator
Jouni Malinen [Fri, 11 Oct 2019 10:27:49 +0000 (13:27 +0300)] 
tests: sigma_dut DPP TCP Enrollee as initiator

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut DPP TCP Configurator (Controller) as responder
Jouni Malinen [Fri, 11 Oct 2019 10:07:39 +0000 (13:07 +0300)] 
tests: sigma_dut DPP TCP Configurator (Controller) as responder

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Fix confusing debug entry from Configurator
Jouni Malinen [Fri, 11 Oct 2019 10:04:42 +0000 (13:04 +0300)] 
DPP: Fix confusing debug entry from Configurator

The logic for displaying the message about no configuration being
available for the Enrollee was reversed when support for multiple Config
Objects was added. This was supposed to be shown only if the first
Config Object fails (i.e., when no configuration is available); not when
second attempt fails (since the first one had already been successful in
that case).

Fixes: 7eb06a33697f ("DPP2: Allow multiple Config Objects to be build on Configurator")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut controlled SAE association with PMKID
Jouni Malinen [Thu, 10 Oct 2019 13:21:10 +0000 (16:21 +0300)] 
tests: sigma_dut controlled SAE association with PMKID

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut controlled AP with SAE Confirm immediate
Jouni Malinen [Thu, 10 Oct 2019 12:56:01 +0000 (15:56 +0300)] 
tests: sigma_dut controlled AP with SAE Confirm immediate

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: SAE and AP sending Confirm message without waiting STA
Jouni Malinen [Thu, 10 Oct 2019 12:42:11 +0000 (15:42 +0300)] 
tests: SAE and AP sending Confirm message without waiting STA

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Allow AP behavior for SAE Confirm to be configured
Jouni Malinen [Thu, 10 Oct 2019 12:38:26 +0000 (15:38 +0300)] 
SAE: Allow AP behavior for SAE Confirm to be configured

hostapd is by default waiting STA to send SAE Confirm before sending the
SAE Confirm. This can now be configured with sae_confirm_immediate=1
resulting in hostapd sending out SAE Confirm immediately after sending
SAE Commit.

These are the two different message sequences:

sae_confirm_immediate=0
STA->AP: SAE Commit
AP->STA: SAE Commit
STA->AP: SAE Confirm
AP->STA: SAE Confirm
STA->AP: Association Request
AP->STA: Association Response

sae_confirm_immediate=1
STA->AP: SAE Commit
AP->STA: SAE Commit
AP->STA: SAE Confirm
STA->AP: SAE Confirm
STA->AP: Association Request
AP->STA: Association Response

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowpa_cli: Clean up unnecessarily complex CONFIG_MESH use
Jouni Malinen [Mon, 7 Oct 2019 12:23:38 +0000 (15:23 +0300)] 
wpa_cli: Clean up unnecessarily complex CONFIG_MESH use

There is no need for #ifdef/#else/#endif construction in
network_fields[] to cover "mode" (which is completely independent of
CONFIG_MESH) or two separate conditional blocks for mesh related network
fields, so move these into a single conditionally included block.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowpa_supplicant: Pass AP mode EDMG config to hostapd struct
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
wpa_supplicant: Pass AP mode EDMG config to hostapd struct

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agowpa_supplicant: Add support for EDMG channels
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
wpa_supplicant: Add support for EDMG channels

As part of a connection request, set EDMG parameters for the driver to
use in the association. The EDMG parameters are based on EDMG IE
received from the AP's Probe Response frames, the driver's EDMG
capability, and the EDMG configuration from the configuration.

As part of starting an AP, set EDMG parameters for the driver to use for
AP operation. The EDMG parameters are based on the driver's EDMG
capability and the EDMG configuration from the configuration.

This implementation is limited to CB2 (channel bonding of 2 channels)
and the bonded channels must be adjacent, i.e., the supported values for
edmg_channel are 9..13.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agoIndicate EDMG in scan results
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
Indicate EDMG in scan results

Add [EDMG] flag to scan results.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agoAP: Show EDMG channel info in STATUS output
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
AP: Show EDMG channel info in STATUS output

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agohostapd: Check EDMG configuration against capability
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
hostapd: Check EDMG configuration against capability

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agohostapd: Check usability of EDMG channel
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
hostapd: Check usability of EDMG channel

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agoAdd EDMG parameters to set_freq functions
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
Add EDMG parameters to set_freq functions

This updates the frequency parameter setting functions to include
argument for EDMG.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agoEDMG: Helper functions for parameter encoding/checking
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
EDMG: Helper functions for parameter encoding/checking

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agowpa_supplicant: Add EDMG channel configuration parameters
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
wpa_supplicant: Add EDMG channel configuration parameters

Add two new configuration parameters for wpa_supplicant:
enable_edmg: Enable EDMG capability for STA/AP mode
edmg_channel: Configure channel bonding. In AP mode it defines the EDMG
channel to start the AP on. In STA mode it defines the EDMG channel to
use for connection.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agohostapd: Add EDMG channel configuration parameters
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
hostapd: Add EDMG channel configuration parameters

Add two new configuration parameters for hostapd:
enable_edmg: Enable EDMG capability for AP mode in the 60 GHz band
edmg_channel: Configure channel bonding for AP mode in the 60 GHz band

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agonl80211: Add support for EDMG channels
Alexei Avshalom Lazar [Tue, 10 Sep 2019 07:26:01 +0000 (10:26 +0300)] 
nl80211: Add support for EDMG channels

IEEE P802.11ay defines Enhanced Directional Multi-Gigabit (EDMG) STA and
AP which allow channel bonding of 2 channels and more.

nl80211 provides the driver's EDMG capabilities from the kernel
using two new attributes:
NL80211_BAND_ATTR_EDMG_CHANNELS - bitmap field that indicates the 2.16
GHz channel(s) that are supported by the driver.
NL80211_BAND_ATTR_EDMG_BW_CONFIG - represents the channel bandwidth
configurations supported by the driver.
The driver's EDMG capabilities are stored inside struct hostapd_hw_modes.

As part of the connect request and starting AP, EDMG parameters are
passed as part of struct hostapd_freq_params.

The EDMG parameters are sent to the kernel by using two new attributes:
NL80211_ATTR_WIPHY_EDMG_CHANNEL and NL80211_ATTR_WIPHY_EDMG_BW_CONFIG
which specify channel and bandwidth configuration for the driver to use.

This implementation is limited to CB2 (channel bonding of 2 channels)
and the bonded channels must be adjacent.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agoIEEE P802.11ay/D4.0 defines for EDMG
Alexei Avshalom Lazar [Tue, 10 Sep 2019 07:26:01 +0000 (10:26 +0300)] 
IEEE P802.11ay/D4.0 defines for EDMG

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agotests: sigma_dut DPP/QR responder status query
Jouni Malinen [Fri, 4 Oct 2019 14:03:47 +0000 (17:03 +0300)] 
tests: sigma_dut DPP/QR responder status query

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut DPP AP as Relay to Controller
Jouni Malinen [Fri, 4 Oct 2019 13:33:36 +0000 (16:33 +0300)] 
tests: sigma_dut DPP AP as Relay to Controller

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>