]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agoMACsec: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:27:57 +0000 (01:27 +0300)] 
MACsec: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoeap_example: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:15:47 +0000 (01:15 +0300)] 
eap_example: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoEAP peer: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:14:34 +0000 (01:14 +0300)] 
EAP peer: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoRSN supp: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:04:24 +0000 (01:04 +0300)] 
RSN supp: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoEAPOL supp: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 21:51:11 +0000 (00:51 +0300)] 
EAPOL supp: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFST: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 21:41:16 +0000 (00:41 +0300)] 
FST: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoEAPOL auth: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 21:29:09 +0000 (00:29 +0300)] 
EAPOL auth: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPA auth: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 20:52:12 +0000 (23:52 +0300)] 
WPA auth: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPA: Fix wpa_parse_kde_ies() handling with vendor specific elements
Jouni Malinen [Thu, 23 Apr 2020 20:30:23 +0000 (23:30 +0300)] 
WPA: Fix wpa_parse_kde_ies() handling with vendor specific elements

Documentation of the return values for wpa_parse_vendor_specific() and
wpa_parse_generic() were not accurate and the parsing results from these
were not really handled appropriately. There is no point in calling
wpa_parse_vendor_specific() if wpa_parse_generic() recognizes a KDE. Not
that this would break anything in practice, but still, it looks
confusing.

The part about handling wpa_parse_vendor_specific() return value can, at
least in theory, break some cases where an unexpectedly short KDE/vendor
specific element were present and something would need to be recognized
after it. That does not really happen with any standard compliant
implementation and this is unlikely to cause any real harm, but it is
clearer to handle this more appropriately even for any theoretical case,
including misbehavior of a peer device.

Instead of stopping parsing on too short vendor specific element,
continue parsing the following KDEs/IEs. Skip the
wpa_parse_vendor_specific() call when a KDE has been recognized. Also
fix the return value documentation for wpa_parse_generic() and remove
the useless return value from wpa_parse_vendor_specific().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Fri, 24 Apr 2020 14:06:36 +0000 (17:06 +0300)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2020-02-24.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: DPP QR Code and authentication exchange (rand_mac_addr=1)
Jouni Malinen [Wed, 22 Apr 2020 14:04:08 +0000 (17:04 +0300)] 
tests: DPP QR Code and authentication exchange (rand_mac_addr=1)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Fix config exchange with gas_rand_mac_addr
Jouni Malinen [Wed, 22 Apr 2020 14:04:43 +0000 (17:04 +0300)] 
DPP: Fix config exchange with gas_rand_mac_addr

Do not use a random MAC address for the GAS exchange that is used as
part of the DPP protocol exchange since that would break DPP.
Configurator expects the same MAC address to be used for DPP
Authentication exchange and DPP Configuration exchange (GAS).

Since the DPP Authentication exchange has already used the MAC address
configured on the interface, use of a random address for the GAS
exchange would not provide any additional privacy protection. If a
random MAC address needs to be used for this type of an exchange, that
random address would need to be first configured on the interface before
starting DPP exchange.

This does not change GAS query behavior for any other use case, i.e.,
the gas_rand_mac_addr configuration continues to apply to all the
Interworking/Hotspot 2.0 uses.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Fix new fuzzer builds
Jouni Malinen [Tue, 21 Apr 2020 21:51:13 +0000 (00:51 +0300)] 
tests: Fix new fuzzer builds

$(LIBS) got included twice into the linker command line from $^ and
$(LIBS). The former ended up getting converted based on host CPU rather
than target. Fix that by removing duplication and -lcrypto from $(LIBS).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoEAP server: Convert Boolean to C99 bool
Jouni Malinen [Mon, 20 Apr 2020 21:16:16 +0000 (00:16 +0300)] 
EAP server: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Add driver operation for enabling/disabling listen mode
Jouni Malinen [Mon, 20 Apr 2020 20:52:04 +0000 (23:52 +0300)] 
DPP: Add driver operation for enabling/disabling listen mode

This can be used to configure RX filter to be able to receive broadcast
DPP Public Action frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoInclude stdbool.h to allow C99 bool to be used
Jouni Malinen [Mon, 20 Apr 2020 17:29:31 +0000 (20:29 +0300)] 
Include stdbool.h to allow C99 bool to be used

We have practically started requiring some C99 features, so might as
well finally go ahead and bring in the C99 bool as well.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Silence compiler warning with no-CONFIG_DPP2 and OpenSSL 1.0.2
Jouni Malinen [Sun, 19 Apr 2020 13:58:59 +0000 (16:58 +0300)] 
DPP2: Silence compiler warning with no-CONFIG_DPP2 and OpenSSL 1.0.2

EVP_PKEY_get0_EC_KEY() compatibility wrapper is used only within
CONFIG_DPP2 blocks, so define it with matching condition.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoSilence compiler warning in no-NEED_AP_MLME hostapd builds
Jouni Malinen [Sun, 19 Apr 2020 13:56:35 +0000 (16:56 +0300)] 
Silence compiler warning in no-NEED_AP_MLME hostapd builds

The static function hostapd_ctrl_check_freq_params() was called only
within #ifdef NEED_AP_MLME block so the function needs to be defined
under matching condition.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Move nl80211_init_connect_handle() to avoid forward declaration
Jouni Malinen [Sun, 19 Apr 2020 13:41:47 +0000 (16:41 +0300)] 
nl80211: Move nl80211_init_connect_handle() to avoid forward declaration

This has no changes to the function itself, i.e., it is just moved to a
location that is above the first caller.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoDo not open l2_packet(EAPOL) for receive unnecessarily
Jouni Malinen [Sun, 19 Apr 2020 13:38:29 +0000 (16:38 +0300)] 
Do not open l2_packet(EAPOL) for receive unnecessarily

If the driver supports control port for EAPOL RX, do not register
l2_packet for RX to minimize unnecessary operation load.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agol2_packet: Allow initialization without RX handling
Jouni Malinen [Sun, 19 Apr 2020 13:36:47 +0000 (16:36 +0300)] 
l2_packet: Allow initialization without RX handling

This can be used to minimize resource use when receive path is not
needed.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Do not open EAPOL RX socket when using control port for RX (AP)
Jouni Malinen [Sun, 19 Apr 2020 13:25:27 +0000 (16:25 +0300)] 
nl80211: Do not open EAPOL RX socket when using control port for RX (AP)

drv->eapol_sock is used only for receiving EAPOL frames in AP mode, so
it is not needed when using control port for EAPOL frame RX.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: ap_open_out_of_memory to skip i802_init test if needed
Jouni Malinen [Sun, 19 Apr 2020 14:41:38 +0000 (17:41 +0300)] 
tests: ap_open_out_of_memory to skip i802_init test if needed

The eloop_register_read_sock() call in i802_init() will be skipped if
the driver supports control port for EAPOL RX, so need to skip this part
of the test case conditionally.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoClean up l2_packet_get_own_addr() call
Jouni Malinen [Sun, 19 Apr 2020 13:15:18 +0000 (16:15 +0300)] 
Clean up l2_packet_get_own_addr() call

There is no need for this to be outside the if block that is used to
check whether l2_packet is used for the interface.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoDo not open l2_packet bridge workaround socket if control port is used
Jouni Malinen [Sun, 19 Apr 2020 13:13:26 +0000 (16:13 +0300)] 
Do not open l2_packet bridge workaround socket if control port is used

This allows wpa_supplicant to avoid the packet socket workaround for
cases where a bridge interface is used if the driver supports control
port for EAPOL frame TX and RX.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: WPA2-PSK AP with nl80211 control port in AP mode
Jouni Malinen [Sun, 19 Apr 2020 12:52:42 +0000 (15:52 +0300)] 
tests: WPA2-PSK AP with nl80211 control port in AP mode

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Disable EAPOL TX over control port in AP mode by default
Jouni Malinen [Sun, 19 Apr 2020 12:43:41 +0000 (15:43 +0300)] 
nl80211: Disable EAPOL TX over control port in AP mode by default

Since this nl80211 mechanism for sending EAPOL frames does not currently
support TX status notification, disable it by default of AP mode where
the Authenticator state machine uses those notifications to optimize
retransmission. The control port TX can be enabled for AP mode with
driver param control_port_ap=1.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Use nl80211 control port for receiving EAPOL frames
Markus Theil [Sat, 11 Apr 2020 10:25:22 +0000 (12:25 +0200)] 
nl80211: Use nl80211 control port for receiving EAPOL frames

Use and/or set socker owner where necessary to allow EAPOL frames to be
received using the nl80211 control port. This is done when the driver
indicates support for the control port without previous hardcoded
reception of RSN preauth frames.

Use methods which set or use the connection owner nl_sock * where
necessary. Initial operations need to register with the SOCKET_OWNER
attribute set (e.g., connect for STA mode). Final operations need to use
the socket which holds the owner attribute (e.g., disconnect for STA
mode).

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Tie connect handle to bss init/destroy
Markus Theil [Sat, 11 Apr 2020 10:25:21 +0000 (12:25 +0200)] 
nl80211: Tie connect handle to bss init/destroy

This commit creates a connect nl_sock * for every bss unconditionally.
It is used in the next commit for nl80211 control port RX.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Handle control port frame in bss events
Markus Theil [Sat, 11 Apr 2020 10:25:19 +0000 (12:25 +0200)] 
nl80211: Handle control port frame in bss events

In order to work in AP mode, handle control port frame RX as per bss
event.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Check ethertype for control port RX
Markus Theil [Sat, 11 Apr 2020 10:25:18 +0000 (12:25 +0200)] 
nl80211: Check ethertype for control port RX

nl80211 control port event handling previously did not differentiate
between EAPOL and RSN preauth ethertypes. Add checking of the ethertype
and report unexpected frames (only EAPOL frames are supposed to be
delivered through this path).

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Add a separate driver capability for control port RX
Jouni Malinen [Sun, 19 Apr 2020 09:30:55 +0000 (12:30 +0300)] 
nl80211: Add a separate driver capability for control port RX

This is needed since the initial implementation of the control port
mechanism in the kernel mixed in RSN pre-authentication ethertype
unconditionally (and IMHO, incorrectly) into the control port.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agodriver: Add second driver capability flags bitmap
Jouni Malinen [Sun, 19 Apr 2020 09:29:00 +0000 (12:29 +0300)] 
driver: Add second driver capability flags bitmap

All 64 bits of the capability flags bitmap are used, so add a new
variable to hold future capability bits.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Move csa_supported() into utils.py
Jouni Malinen [Sat, 18 Apr 2020 08:31:49 +0000 (11:31 +0300)] 
tests: Move csa_supported() into utils.py

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Move clear_scan_cache() and set_world_reg() to utils.py
Jouni Malinen [Sat, 18 Apr 2020 08:12:54 +0000 (11:12 +0300)] 
tests: Move clear_scan_cache() and set_world_reg() to utils.py

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Move vht_supported() into utils.py
Jouni Malinen [Sat, 18 Apr 2020 08:09:36 +0000 (11:09 +0300)] 
tests: Move vht_supported() into utils.py

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Move check_sae_capa() into utils.py
Jouni Malinen [Sat, 18 Apr 2020 08:07:33 +0000 (11:07 +0300)] 
tests: Move check_sae_capa() into utils.py

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Move check_wep_capa() into utils.py
Jouni Malinen [Sat, 18 Apr 2020 08:05:49 +0000 (11:05 +0300)] 
tests: Move check_wep_capa() into utils.py

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Use function decorator to clean up --long processing
Jouni Malinen [Sat, 18 Apr 2020 08:00:49 +0000 (11:00 +0300)] 
tests: Use function decorator to clean up --long processing

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: ap_wps_reg_config_tkip to allow no-TKIP hostapd build
Jouni Malinen [Fri, 17 Apr 2020 19:07:03 +0000 (22:07 +0300)] 
tests: ap_wps_reg_config_tkip to allow no-TKIP hostapd build

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPS: Convert WPA/TKIP-only to WPA+WPA2 mixed mode credential
Jouni Malinen [Fri, 17 Apr 2020 19:05:07 +0000 (22:05 +0300)] 
WPS: Convert WPA/TKIP-only to WPA+WPA2 mixed mode credential

This case of accepting WPA/TKIP-only credential based on internal
registrar request to configure an AP to use TKIP was still remaining
while all the WPS cases were supposed to enable mixed mode
automatically. This is bit of a corner case since this is based on
explicit local request to configure TKIP, but anyway, convert this one
as well to allow WPA2/CCMP to be used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Use SAE instead of WPA/TKIP in ap_multi_bss_acs
Jouni Malinen [Fri, 17 Apr 2020 18:55:18 +0000 (21:55 +0300)] 
tests: Use SAE instead of WPA/TKIP in ap_multi_bss_acs

This makes the test case work with no-TKIP hostapd builds.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: ap_wpa2_eap_assoc_rsn to allow TKIP-disabled hostapd build
Jouni Malinen [Fri, 17 Apr 2020 18:51:26 +0000 (21:51 +0300)] 
tests: ap_wpa2_eap_assoc_rsn to allow TKIP-disabled hostapd build

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: ap_wps_init to allow TKIP-disabled hostapd build
Jouni Malinen [Fri, 17 Apr 2020 18:46:12 +0000 (21:46 +0300)] 
tests: ap_wps_init to allow TKIP-disabled hostapd build

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Skip test cases where hostapd does not support TKIP
Jouni Malinen [Fri, 17 Apr 2020 15:16:13 +0000 (18:16 +0300)] 
tests: Skip test cases where hostapd does not support TKIP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Skip more tests based on missing TKIP support
Jouni Malinen [Fri, 17 Apr 2020 13:07:24 +0000 (16:07 +0300)] 
tests: Skip more tests based on missing TKIP support

This makes it more convenient to run tests with builds that disable
TKIP/WPA(v1) support completely.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Do not enable TKIP group cipher for FT tests without need
Jouni Malinen [Fri, 17 Apr 2020 13:06:25 +0000 (16:06 +0300)] 
tests: Do not enable TKIP group cipher for FT tests without need

Change run_roams() default to CCMP-only and enable TKIP only in the test
case that needs this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAllow TKIP support to be removed from build
Disha Das [Thu, 9 Apr 2020 04:12:21 +0000 (09:42 +0530)] 
Allow TKIP support to be removed from build

Add a build flag CONFIG_NO_TKIP=y to remove all TKIP functionality from
hostapd and wpa_supplicant builds. This disables use of TKIP as both the
pairwise and group cipher. The end result does not interoperate with a
WPA(v1)-only device or WPA+WPA2 mixed modes.

Signed-off-by: Disha Das <dishad@codeaurora.org>
5 years agotests: sigma_dut controlled AP with FT and RSNXE Used mismatch
Jouni Malinen [Thu, 16 Apr 2020 20:58:36 +0000 (23:58 +0300)] 
tests: sigma_dut controlled AP with FT and RSNXE Used mismatch

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: FT-SAE AP and unexpected RSNXE Used in ReassocResp
Jouni Malinen [Thu, 16 Apr 2020 20:24:06 +0000 (23:24 +0300)] 
tests: FT-SAE AP and unexpected RSNXE Used in ReassocResp

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFT: Testing override for RSNXE Used subfield in FTE (AP)
Jouni Malinen [Thu, 16 Apr 2020 20:22:57 +0000 (23:22 +0300)] 
FT: Testing override for RSNXE Used subfield in FTE (AP)

Allow hostapd to be requested to override the RSNXE Used subfield in FT
reassociation case for testing purposes with "ft_rsnxe_used=<0/1/2>"
where 0 = no override, 1 = override to 1, and 2 = override to 0.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut controlled FT protocol with RSNXE Used mismatch
Jouni Malinen [Wed, 15 Apr 2020 10:55:28 +0000 (13:55 +0300)] 
tests: sigma_dut controlled FT protocol with RSNXE Used mismatch

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Remove unnecessary inclusion of l2_packet.h
Jouni Malinen [Tue, 14 Apr 2020 16:23:09 +0000 (19:23 +0300)] 
nl80211: Remove unnecessary inclusion of l2_packet.h

The only l2_packet use within this file was removed by commit
d12dab4c6f9e ("nl80211: Use non-receiving socket for EAPOL TX").

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: FT-SAE AP and unexpected RSNXE Used in ReassocReq
Jouni Malinen [Tue, 14 Apr 2020 10:50:53 +0000 (13:50 +0300)] 
tests: FT-SAE AP and unexpected RSNXE Used in ReassocReq

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFT: Testing override for RSNXE Used subfield in FTE
Jouni Malinen [Tue, 14 Apr 2020 10:48:43 +0000 (13:48 +0300)] 
FT: Testing override for RSNXE Used subfield in FTE

Allow wpa_supplicant to be requested to override the RSNXE Used subfield
in FT reassociation case for testing purposes with "SET ft_rsnxe_used
<0/1/2>" where 0 = no override, 1 = override to 1, and 2 = override to
0.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFT: Discard ReassocReq with mismatching RSNXE Used value
Jouni Malinen [Tue, 14 Apr 2020 10:46:00 +0000 (13:46 +0300)] 
FT: Discard ReassocReq with mismatching RSNXE Used value

Discard the FT Reassociation Request frame instead of rejecting it
(i.e., do not send Reassociation Response frame) if RSNXE Used is
indicated in FTE, but no RSNXE is included even though the AP is
advertising RSNXE.

While there is not really much of a difference between discarding and
rejecting the frame, this discarding behavior is what the standard says
for this type of an error case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: AP may discard FT ReassocReq in ap_ft_sae_h2e_downgrade_attack
Jouni Malinen [Tue, 14 Apr 2020 13:36:07 +0000 (16:36 +0300)] 
tests: AP may discard FT ReassocReq in ap_ft_sae_h2e_downgrade_attack

This is in preparation for a hostapd implementation change on how to
address the unexpected RSNXE Used field value in FTE during FT
reassociation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd vendor attributes indicating number of spectral detectors
Edayilliam Jayadev [Fri, 27 Mar 2020 06:13:43 +0000 (11:43 +0530)] 
Add vendor attributes indicating number of spectral detectors

Add per bandwidth capability attributes which indicate the number of
spectral detectors used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd an attribute for secondary 80 MHz span of agile spectral scan
Edayilliam Jayadev [Fri, 27 Mar 2020 08:20:01 +0000 (13:50 +0530)] 
Add an attribute for secondary 80 MHz span of agile spectral scan

Add an attribute QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FREQUENCY_2
for describing the secondary 80 MHz span of agile spectral scan.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoPKCS#1: Debug dump invalid Signature EB
Jouni Malinen [Sun, 5 Apr 2020 17:13:26 +0000 (20:13 +0300)] 
PKCS#1: Debug dump invalid Signature EB

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Enable dumping of key information in test-x509v3
Jouni Malinen [Sun, 5 Apr 2020 17:12:59 +0000 (20:12 +0300)] 
tests: Enable dumping of key information in test-x509v3

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoX509: Use unique debug prints for unused bits entries
Jouni Malinen [Sun, 5 Apr 2020 16:59:47 +0000 (19:59 +0300)] 
X509: Use unique debug prints for unused bits entries

This makes it easier to understand which X.509 BIT STRING value has the
unused bits.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Remove test-x509
Jouni Malinen [Sun, 5 Apr 2020 16:38:41 +0000 (19:38 +0300)] 
tests: Remove test-x509

This has been obsoleted by tests/fuzzing/x509.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Do not include rt library for OS X builds
Jouni Malinen [Sun, 5 Apr 2020 14:59:57 +0000 (17:59 +0300)] 
wlantest: Do not include rt library for OS X builds

That is not needed or available by default, so simply drop it from the
build.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Link without libwlantest
Jouni Malinen [Sun, 5 Apr 2020 14:58:46 +0000 (17:58 +0300)] 
wlantest: Link without libwlantest

The ar operations with embedded libraries were not exactly portable
or strictly speaking necessary. Drop that library completely to make
this more portable.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Comment out Linux packet socket from OS X build
Jouni Malinen [Sun, 5 Apr 2020 14:57:32 +0000 (17:57 +0300)] 
wlantest: Comment out Linux packet socket from OS X build

For now, allow wlantest to be built on OS X without support for
live sniffer capturing.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Comment out ICMP processing from OS X builds
Jouni Malinen [Sun, 5 Apr 2020 14:56:59 +0000 (17:56 +0300)] 
wlantest: Comment out ICMP processing from OS X builds

For now, allow this to be compiled without ICMP support.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Use BSD compatible UDP header struct
Jouni Malinen [Sun, 5 Apr 2020 14:56:20 +0000 (17:56 +0300)] 
wlantest: Use BSD compatible UDP header struct

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: SAE/PMF roam
Jouni Malinen [Sat, 4 Apr 2020 20:57:18 +0000 (23:57 +0300)] 
tests: SAE/PMF roam

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT RRB: Remove confusing debug print about extra data
Jouni Malinen [Sat, 4 Apr 2020 20:42:05 +0000 (23:42 +0300)] 
FT RRB: Remove confusing debug print about extra data

The "FT: Ignore extra data in end" hexdump is quite confusing since it
shows all the IEs that were actually either processed or forwarded.
There is no code path that could reach this debug print with actual real
extra data. Remove it and the dead increment of pos to avoid warnings
from static analyzers.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: FT+PMF roaming with skip_prune
Jouni Malinen [Sat, 4 Apr 2020 18:49:31 +0000 (21:49 +0300)] 
tests: FT+PMF roaming with skip_prune

Verify hostapd behavior during FT protocol processing when a STA entry
is still present in the AP and that association has PMF negotiated.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Remove and re-add STA entry after FT protocol success with PMF
Jouni Malinen [Sat, 4 Apr 2020 18:50:37 +0000 (21:50 +0300)] 
FT: Remove and re-add STA entry after FT protocol success with PMF

Allow STA entry to be removed and re-added to the driver with PMF is
used with FT. Previously, this case resulted in cfg80211 rejecting STA
entry update after successful FT protocol use if the association had not
been dropped and it could not be dropped for the PMF case in
handle_auth().

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: New style fuzzing tool for DPP URI parsing
Jouni Malinen [Sat, 4 Apr 2020 17:07:38 +0000 (20:07 +0300)] 
tests: New style fuzzing tool for DPP URI parsing

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: New style fuzzing tool for SAE commit parsing
Jouni Malinen [Sat, 4 Apr 2020 15:28:06 +0000 (18:28 +0300)] 
tests: New style fuzzing tool for SAE commit parsing

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoSAE: Fix build without DPP/OWE/ERP
Jouni Malinen [Sat, 4 Apr 2020 15:08:14 +0000 (18:08 +0300)] 
SAE: Fix build without DPP/OWE/ERP

SAE needs sha256-kdf.c to be included in the build.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Enable MACsec testing by default in the VM kernel
Thomas Pedersen [Tue, 31 Mar 2020 18:09:00 +0000 (11:09 -0700)] 
tests: Enable MACsec testing by default in the VM kernel

Include support for MACsec testing in the (vm) kernel by default.

Don't include support in the example hostapd or wpa_supplicant configs
yet since that would potentially break the build on older distributions
like Ubuntu 16.04, which is supported until April 2021.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
5 years agowlantest: Add frame number fo replay detected messages
Jouni Malinen [Fri, 3 Apr 2020 21:06:59 +0000 (00:06 +0300)] 
wlantest: Add frame number fo replay detected messages

This makes it easier to find the relevant frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Remove duplicate PN/RSC prints from replay cases
Jouni Malinen [Fri, 3 Apr 2020 21:04:32 +0000 (00:04 +0300)] 
wlantest: Remove duplicate PN/RSC prints from replay cases

The PN and RSC are already printed in the "replay detected" debug
message so there is no point in having separate hexdumps of the same
values immediately after that.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Add debug print with frame number for decryption failures
Jouni Malinen [Fri, 3 Apr 2020 21:00:17 +0000 (00:00 +0300)] 
wlantest: Add debug print with frame number for decryption failures

This makes it more convenient to find the frames that could not be
decrypted.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Do not report decryption failures for WEP keys if no keys
Jouni Malinen [Fri, 3 Apr 2020 20:56:10 +0000 (23:56 +0300)] 
wlantest: Do not report decryption failures for WEP keys if no keys

If no WEP keys are available, there is not going to be an attempt to
decrypt the frame, so don't claim decryption failed.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Make ap_vht_csa_vht40_disable more robust
Jouni Malinen [Fri, 3 Apr 2020 18:16:06 +0000 (21:16 +0300)] 
tests: Make ap_vht_csa_vht40_disable more robust

Wait for disconnection and reconnection after CSA since mac80211 does
not support clean CSA to disable VHT.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoP2P: Start group with user configured params after accepting invitation
Vamsi Krishna [Fri, 3 Apr 2020 11:52:03 +0000 (17:22 +0530)] 
P2P: Start group with user configured params after accepting invitation

Use global configuration parameters while invoking a persistent P2P
group after accepting P2P Invitation Request from a peer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut and DPP with NFC
Jouni Malinen [Fri, 3 Apr 2020 13:21:30 +0000 (16:21 +0300)] 
tests: sigma_dut and DPP with NFC

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Mandate mutual auth with NFC negotiated connection handover
Jouni Malinen [Fri, 3 Apr 2020 12:47:18 +0000 (15:47 +0300)] 
DPP: Mandate mutual auth with NFC negotiated connection handover

Mark own bootstrap information as having been used in NFC negotiated
connection handover and do not accept non-mutual authentication when
processing Authentication Response from the peer when such bootstrapping
information is used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Use a helper function for starting DPP AP in sigma_dut tests
Jouni Malinen [Fri, 3 Apr 2020 09:59:47 +0000 (12:59 +0300)] 
tests: Use a helper function for starting DPP AP in sigma_dut tests

Remove unnecessary code duplication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Remove duplicate definitions of csign/connector in sigma_dut
Jouni Malinen [Fri, 3 Apr 2020 09:54:44 +0000 (12:54 +0300)] 
tests: Remove duplicate definitions of csign/connector in sigma_dut

There is no need to duplicate the definitions of the exact same values
within each test function.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP netAccessKey for reconfig
Jouni Malinen [Fri, 3 Apr 2020 09:45:03 +0000 (12:45 +0300)] 
tests: DPP netAccessKey for reconfig

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Store netAccessKey in psk/sae credentials for reconfig
Jouni Malinen [Fri, 3 Apr 2020 09:43:48 +0000 (12:43 +0300)] 
DPP2: Store netAccessKey in psk/sae credentials for reconfig

Connector alone is not sufficient for authentication during
reconfiguration, so store the netAccessKey as well.

Fixes: e4eb009d9863 ("DPP2: Add Connector and C-sign-key in psk/sae credentials for reconfig")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOWE: Remove check for unexpected DH Parameter IE use with other AKMs
Jouni Malinen [Fri, 3 Apr 2020 09:18:11 +0000 (12:18 +0300)] 
OWE: Remove check for unexpected DH Parameter IE use with other AKMs

While the Diffie-Hellman Parameter element is defined in RFC 8110
explicitly for use witht he OWE AKM, it has now been proposed to be used
with another AKM (DPP). Should any other AKM be extended in similar
manner in the future, the check against unexpected use could result in
additional interoperability issues. Remove that and instead, ignore the
unexpected Diffie-Hellman Parameter element if it is included in
(Re)Association Request frame when any other AKM is negotiated.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP reconfiguration connector
Jouni Malinen [Thu, 2 Apr 2020 12:38:20 +0000 (15:38 +0300)] 
tests: DPP reconfiguration connector

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add Connector and C-sign-key in psk/sae credentials for reconfig
Jouni Malinen [Thu, 2 Apr 2020 12:35:56 +0000 (15:35 +0300)] 
DPP2: Add Connector and C-sign-key in psk/sae credentials for reconfig

If the Enrollee indicates support for DPP R2 or newer, add Connector and
C-sign-key in psk/sae credentials (i.e., cases where DPP AKM is not
enabled) for reconfiguration. Extend processing of such credentials in
wpa_supplicant network profile addition to handle this new case
correctly by not setting key_mgmt=DPP based on Connector being present,
but by looking at the actual akm value in the config object.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agowlantest: Update PTK after rekeying even if EAPOL-Key msg 4/4 is missing
Jouni Malinen [Wed, 1 Apr 2020 15:46:14 +0000 (18:46 +0300)] 
wlantest: Update PTK after rekeying even if EAPOL-Key msg 4/4 is missing

Update TPTK to PTK if a valid EAPOL-Key msg 2/4 and 3/4 are available,
but 4/4 is missing. This avoids certain cases where the new TK could be
derived, but it was not being used to try to decrypt following encrypted
frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agowlantest: Do not report decryption keys when checking only zero TK
Jouni Malinen [Wed, 1 Apr 2020 15:30:33 +0000 (18:30 +0300)] 
wlantest: Do not report decryption keys when checking only zero TK

All the "Failed to decrypt frame" debug prints were confusing since
those were not supposed to be shown unless there were one or more real
TKs available. The recently added check for zero TK added these notes
for that case which is not really correct, so get rid of them.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Clear requirement for QR Code mutual authentication for chirping
Jouni Malinen [Wed, 1 Apr 2020 14:16:55 +0000 (17:16 +0300)] 
DPP2: Clear requirement for QR Code mutual authentication for chirping

The chirping cases are not really targeting interactive operations, so
clear the requirement for mutual authentication when DPP_CHIRP command
is used. This avoids testing isues where an earlier DPP_LISTEN command
has used qr=mutual parameter and that seting not getting cleared before
the next DPP_CHIRP command is used.

This fixes a test case failure in the following test sequence:
dpp_auth_resp_status_failure dpp_controller_relay_chirp

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoProcess received WNM Notification Request for beacon protection failures
Jouni Malinen [Wed, 1 Apr 2020 13:29:24 +0000 (16:29 +0300)] 
Process received WNM Notification Request for beacon protection failures

Report received notifications for beacon protection failures in syslog
and control interface.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoBeacon frame protection event for incorrect protection
Jouni Malinen [Wed, 1 Apr 2020 13:07:25 +0000 (16:07 +0300)] 
Beacon frame protection event for incorrect protection

Define a driver interface event for Beacon frame protection failures.
Report such events over the control interface and send a
WNM-Notification Request frame to the AP as well.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agowpa_supplicant: Add HE override support
P Praneesh [Mon, 9 Mar 2020 10:53:50 +0000 (16:23 +0530)] 
wpa_supplicant: Add HE override support

Add HE override support under the build parameter CONFIG_HE_OVERRIDES=y.
The disable_he=1 network profile parameter can be used to disable HE.
This requires a fallback to VHT on the 5 GHz band and to HT on the 2.4
GHz band.

There is no nl80211 support for configuring the driver to disable HE, so
for now, this applies only to IBSS and mesh cases.

Signed-off-by: P Praneesh <ppranees@codeaurora.org>
5 years agohostapd: Validate the country_code parameter value
Sriram R [Thu, 26 Mar 2020 03:12:19 +0000 (08:42 +0530)] 
hostapd: Validate the country_code parameter value

cfg80211/regulatory supports only ISO 3166-1 alpha2 country code and
that's what this parameter is supposed to use, so validate the country
code input before accepting the value. Only characters A..Z are
accepted.

Signed-off-by: Sriram R <srirrama@codeaurora.org>
5 years agoDPP: Add some more details on how to use DPP
Jouni Malinen [Sun, 29 Mar 2020 20:24:45 +0000 (23:24 +0300)] 
DPP: Add some more details on how to use DPP

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFix the dpp_configurator_sign example command
Jouni Malinen [Sun, 29 Mar 2020 20:07:42 +0000 (23:07 +0300)] 
Fix the dpp_configurator_sign example command

The mandatory ssid parameter was forgotten from this command when it was
added to the dpp_auth_init examples.

Signed-off-by: Jouni Malinen <j@w1.fi>