Commit Graph

22 Commits

Author SHA1 Message Date
James Prestwood 6b677e8db0 handshake: use authenticator_fte instead of 'fte' 2023-12-13 10:08:06 -06:00
James Prestwood 39b36f8e21 fils: pragma false positive for uninitialized variable
On musl-gcc the compiler is giving a warning for igtk_key_index
and gtk_key_index being used uninitialized. This isn't possible
since they are only used if gtk/igtk are non-NULL so pragma to
ignore the warning.

src/fils.c: In function 'fils_rx_associate':
src/fils.c:580:17: error: 'igtk_key_index' may be used uninitialized
	in this function [-Werror=maybe-uninitialized]
  580 |                 handshake_state_install_igtk(fils->hs,
					igtk_key_index,igtk + 6,
					igtk_len - 6, igtk);

(same error for gtk_key_index)
2022-06-10 13:59:01 -05:00
Denis Kenzior fe95cbe077 treewide: Various style fixups
- Mostly problems with whitespace:
	- Use of spaces instead of tabs
	- Stray spaces before closing ')
	- Missing spaces

- Missing 'void' from function declarations & definitions that
  take no arguments.

- Wrong indentation level
2022-01-11 11:07:05 -06:00
James Prestwood d68c9e69fa fils: support OCI in reassociation 2021-09-28 16:46:48 -05:00
James Prestwood f78ea26f13 fils: change fatal return code to -EPROTO
This keeps FILS consistent with what netdev expects for a fatal
auth-proto return.
2021-09-08 14:35:05 -05:00
Denis Kenzior 30d32e4a58 treewide: Remove non-ascii characters 2021-07-28 10:03:27 -05:00
Denis Kenzior f67e5ea6d8 netdev: Centralize mmpdu validation
Instead of requiring each auth_proto to perform validation of the frames
received via rx_authenticate & rx_associate, have netdev itself perform
the mpdu validation.  This is unlikely to happen anyway since the kernel
performs its own frame validation.  Print a warning in case the
validation fails.
2021-07-14 09:58:42 -05:00
Denis Kenzior 8de07357fd fils: mmpdu_body cannot fail 2021-07-14 09:58:42 -05:00
Denis Kenzior 08845fb19c ie: Change ie_tlv_builder_finalize signature
ie_tlv_builder_init takes a size_t as input, yet for some reason
ie_tlv_builder_finalize takes an unsigned int argument as output.  Fix
the latter to use size_t as well.
2021-07-14 09:58:42 -05:00
Denis Kenzior 113c1086e2 fils: Use bit_field from ell 2021-03-11 22:34:26 -06:00
James Prestwood d38bd513c9 fils: include RSNE in authenticate
802.11ai mandates that the RSN element is included during authentication
for FILS. This previously was happening by chance since supplicant_ie
was being included with CMD_AUTHENTICATE. This included more than just
the RSNE so that was removed in an earlier commit. Now FILS builds the
RSNE itself and includes this with CMD_AUTHENTICATE.
2020-05-02 20:56:13 -05:00
Rosen Penev a47609acbe iwd: remove unnecessary semicolons
Found with clang's -Wextra-semi-stmt
2020-04-08 21:02:15 -05:00
Denis Kenzior 360ec1488d fils: Fix endianness issues
Using mmpdu_associate_response and mmpdu_authenticate structure
members marked __le requires the relevant endianness conversion.
2019-05-23 16:59:14 -05:00
James Prestwood e583b1d243 fils: update to handle FILS-FT
FILS unfortunately is a special case when it comes to fast transition.
We have to process the FT IEs internally since we cannot trigger the
same initial mobility association code path (via netdev).
2019-05-23 15:26:34 -05:00
James Prestwood 4c32dd09f6 fils: add forgotten break 2019-05-22 16:13:08 -05:00
James Prestwood 8317b96e7d fils: netdev: update to use auth_proto concepts 2019-05-03 14:37:11 -05:00
Denis Kenzior f0de2516ea erp: Return const void * instead 2019-05-03 14:17:17 -05:00
James Prestwood 8c11fdabcc erp: remove 'complete' callback
Since ERP is only used for FILS and not behaving in the 'normal' ERP
fashion (dealing with actual EAP data, timeouts etc.) we can structure
ERP as a more synchronous protocol, removing the need for a complete
callback.

Now, erp_rx_packet returns a status, so FILS can decide how to handle
any failures. The complete callback was also removed in favor of a
getter for the RMSK (erp_get_rmsk). This allows FILS to syncronously
handle ERP, and potentially fail directly in fils_rx_authenticate.
2019-05-03 14:11:57 -05:00
James Prestwood 00cbd171f1 fils: add support for PMKID derivation
FILS defines its own derivation for the PMKID, which is just a
SHA256 or SHA384 hash of the ERP data. Setting the PMKID will
allow FILS PTK rekeys.
2019-04-26 12:40:02 -05:00
James Prestwood 856b21d9ba fils: update TLV builder code to use new APIs 2019-04-23 12:56:20 -05:00
James Prestwood d2e7d47c84 ie: fix ie_tlv_builder semantics
The TLV builder APIs were not very intuative, and in some (or all)
cases required access to the builder structure directly, either to
set the TLV buffer or to get the buffer at the end.

This change adds a new API, ie_tlv_builder_set_data, which both sets
the length for the current TLV and copies the TLV data in one go.
This will avoid the need for memcpy(ie_tlv_builder_get_data(...),...)

ie_tlv_builder_finalize was also changed to return a pointer to the
start of the build buffer. This will eliminate the need to access
builder.tlv after building the TLVs.

ie_tlv_builder_init was changed to take an optional buffer to hold
the TLV data. Passing NULL/0 will build the TLV in the internal
buffer. Passing in a pointer and length will build into the passed
in buffer.
2019-04-23 12:56:20 -05:00
James Prestwood 73c9a126bd fils: implementation for FILS
FILS (Fast Initial Link Setup) allows a station to negotiate a PTK during
authentication and association. This allows for a faster connection as
opposed to doing full EAP and the 4-way. FILS uses ERP (EAP Reauth Protocol)
to achieve this, but encapsulates the ERP data into an IE inside
authenticate frames. Association is then used to verify both sides have
valid keys, as well as delivering the GTK/IGTK.

FILS will work similar to SAE/OWE/FT where netdev registers a fils_sm, and
then forwards all Auth/Assoc frame data to and from the FILS module.
2019-04-22 14:55:02 -05:00