From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 3/8] ft: add ft_over_ds_handshake_new
Date: Thu, 15 Apr 2021 15:45:03 -0700 [thread overview]
Message-ID: <20210415224508.1823614-3-prestwoj@gmail.com> (raw)
In-Reply-To: <20210415224508.1823614-1-prestwoj@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3300 bytes --]
FT-over-DS will be refactored to better handle the initial
action frame stage which can be done prior to needing to
roam. To do this a new handshake object needs to be created
as we cannot change the existing handshake since its needed
for rekeys. Much of the existing handshake is kept as it
contains all the keys negotiated during the initial association.
When IWD is ready, this new handshake can be used to reassociate
to a new AP.
---
src/ft.c | 42 ++++++++++++++++++++++++++++++++++++++++++
src/ft.h | 7 +++++++
2 files changed, 49 insertions(+)
diff --git a/src/ft.c b/src/ft.c
index 08e6cdeb..9e6935e8 100644
--- a/src/ft.c
+++ b/src/ft.c
@@ -32,6 +32,9 @@
#include "src/ft.h"
#include "src/mpdu.h"
#include "src/auth-proto.h"
+#include "src/scan.h"
+#include "src/netdev.h"
+#include "src/util.h"
struct ft_sm {
struct auth_proto ap;
@@ -769,6 +772,45 @@ static bool ft_start(struct auth_proto *ap)
return true;
}
+struct handshake_state *ft_over_ds_handshake_new(struct netdev *netdev,
+ struct scan_bss *target)
+{
+ uint8_t mde[5];
+ struct handshake_state *old = netdev_get_handshake(netdev);
+ struct handshake_state *hs = netdev_handshake_state_new(netdev);
+
+ /* copy info that will remain the same between handshakes */
+ handshake_state_set_supplicant_address(hs, old->spa);
+ handshake_state_set_supplicant_ie(hs, old->supplicant_ie);
+ handshake_state_set_ssid(hs, old->ssid, old->ssid_len);
+
+ if (old->settings_8021x)
+ handshake_state_set_8021x_config(hs, old->settings_8021x);
+
+ handshake_state_set_kh_ids(hs, old->r0khid, old->r0khid_len, old->r1khid);
+ memcpy(hs->pmk_r0, old->pmk_r0, sizeof(hs->pmk_r0));
+ memcpy(hs->pmk_r1, old->pmk_r1, sizeof(hs->pmk_r1));
+ memcpy(hs->pmk_r0_name, old->pmk_r0_name, sizeof(hs->pmk_r0_name));
+ memcpy(hs->pmk_r1_name, old->pmk_r1_name, sizeof(hs->pmk_r1_name));
+
+ handshake_state_set_pmk(hs, old->pmk, old->pmk_len);
+
+ mde[0] = IE_TYPE_MOBILITY_DOMAIN;
+ mde[1] = 3;
+ memcpy(mde + 2, target->mde, 3);
+
+ handshake_state_set_mde(hs, mde);
+
+ /* prepare new handshake for target BSS */
+ handshake_state_new_snonce(hs);
+ handshake_state_set_authenticator_address(hs, target->addr);
+
+ if (target->rsne)
+ handshake_state_set_authenticator_ie(hs, target->rsne);
+
+ return hs;
+}
+
static struct auth_proto *ft_sm_new(struct handshake_state *hs,
ft_tx_authenticate_func_t tx_auth,
ft_tx_associate_func_t tx_assoc,
diff --git a/src/ft.h b/src/ft.h
index f24b3b5e..50090a03 100644
--- a/src/ft.h
+++ b/src/ft.h
@@ -20,6 +20,10 @@
*
*/
+struct scan_bss;
+struct netdev;
+struct handshake_state;
+
typedef void (*ft_tx_authenticate_func_t)(struct iovec *iov, size_t iov_len,
void *user_data);
typedef void (*ft_tx_associate_func_t)(struct iovec *ie_iov, size_t iov_len,
@@ -29,6 +33,9 @@ bool ft_build_authenticate_ies(struct handshake_state *hs,
const uint8_t *new_snonce, uint8_t *buf,
size_t *len);
+struct handshake_state *ft_over_ds_handshake_new(struct netdev *netdev,
+ struct scan_bss *target);
+
struct auth_proto *ft_over_air_sm_new(struct handshake_state *hs,
ft_tx_authenticate_func_t tx_auth,
ft_tx_associate_func_t tx_assoc,
--
2.26.2
next prev parent reply other threads:[~2021-04-15 22:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-15 22:45 [PATCH 1/8] ft: separate ft_sm from ft_process_ies James Prestwood
2021-04-15 22:45 ` [PATCH 2/8] ft: expose ft_build_authenticate_ies James Prestwood
2021-04-16 16:32 ` Denis Kenzior
2021-04-15 22:45 ` James Prestwood [this message]
2021-04-15 22:45 ` [PATCH 4/8] ft: add ft_parse_action_response James Prestwood
2021-04-15 22:45 ` [PATCH 5/8] netdev: factor out FT handshake preparation James Prestwood
2021-04-16 16:33 ` Denis Kenzior
2021-04-15 22:45 ` [PATCH 6/8] ft: netdev: refactor FT-over-DS to properly handle Auth failures James Prestwood
2021-04-16 17:37 ` Denis Kenzior
2021-04-15 22:45 ` [PATCH 7/8] station: specially handle FT-over-DS failure James Prestwood
2021-04-15 22:45 ` [PATCH 8/8] ft: netdev: add return value to tx_associate James Prestwood
2021-04-16 16:31 ` [PATCH 1/8] ft: separate ft_sm from ft_process_ies Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210415224508.1823614-3-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.