From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH v3 3/9] dpp: allow enrollee to be authentication initiator
Date: Tue, 31 Oct 2023 11:47:44 -0700 [thread overview]
Message-ID: <20231031184750.722404-4-prestwoj@gmail.com> (raw)
In-Reply-To: <20231031184750.722404-1-prestwoj@gmail.com>
Until now IWD only supported enrollees as responders (configurators
could do both). For PKEX it makes sense for the enrollee to be the
initiator because configurators in the area are already on their
operating channel and going off is inefficient. For PKEX, whoever
initiates also initiates authentication so for this reason the
authentication path is being opened up to allow enrollees to
initiate.
---
src/dpp.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/dpp.c b/src/dpp.c
index dcf5953f..e5e1b3fa 100644
--- a/src/dpp.c
+++ b/src/dpp.c
@@ -1468,7 +1468,7 @@ static bool dpp_send_authenticate_request(struct dpp_sm *dpp)
struct scan_bss *bss = station_get_connected_bss(station);
/* Got disconnected by the time the peer was discovered */
- if (!bss) {
+ if (dpp->role == DPP_CAPABILITY_CONFIGURATOR && !bss) {
dpp_reset(dpp);
return false;
}
@@ -1489,7 +1489,8 @@ static bool dpp_send_authenticate_request(struct dpp_sm *dpp)
i_proto_key, dpp->key_len * 2);
ptr += dpp_append_attr(ptr, DPP_ATTR_PROTOCOL_VERSION, &version, 1);
- if (dpp->current_freq != bss->frequency) {
+ if (dpp->role == DPP_CAPABILITY_CONFIGURATOR &&
+ dpp->current_freq != bss->frequency) {
uint8_t pair[2] = { 81,
band_freq_to_channel(bss->frequency, NULL) };
@@ -1926,9 +1927,6 @@ static void authenticate_response(struct dpp_sm *dpp, const uint8_t *from,
if (dpp->state != DPP_STATE_AUTHENTICATING)
return;
- if (dpp->role != DPP_CAPABILITY_CONFIGURATOR)
- return;
-
if (!dpp->freqs)
return;
@@ -2082,6 +2080,10 @@ static void authenticate_response(struct dpp_sm *dpp, const uint8_t *from,
dpp->current_freq = dpp->new_freq;
dpp_send_authenticate_confirm(dpp);
+
+ if (dpp->role == DPP_CAPABILITY_ENROLLEE)
+ dpp_configuration_start(dpp, from);
+
}
static void dpp_handle_presence_announcement(struct dpp_sm *dpp,
--
2.25.1
next prev parent reply other threads:[~2023-10-31 18:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 18:47 [PATCH v3 0/9] DPP PKEX Changes James Prestwood
2023-10-31 18:47 ` [PATCH v3 1/9] dpp: remove scan_periodic_stop calls James Prestwood
2023-11-03 1:40 ` Denis Kenzior
2023-10-31 18:47 ` [PATCH v3 2/9] dpp: fix config request header check James Prestwood
2023-10-31 18:47 ` James Prestwood [this message]
2023-10-31 18:47 ` [PATCH v3 4/9] dbus: add net.connman.iwd.SharedCodeAgent DBus interface James Prestwood
2023-10-31 18:47 ` [PATCH v3 5/9] station: provide new state in __station_connect_network James Prestwood
2023-10-31 18:47 ` [PATCH v3 6/9] doc: PKEX support for DPP James Prestwood
2023-11-03 2:07 ` Denis Kenzior
2023-11-03 11:24 ` James Prestwood
2023-10-31 18:47 ` [PATCH v3 7/9] dpp: SharedCode interface, {Register,Unregister}SharedCodeAgent James Prestwood
2023-11-03 2:09 ` Denis Kenzior
2023-10-31 18:47 ` [PATCH v3 8/9] dpp: initial version of PKEX enrollee support James Prestwood
2023-11-03 2:12 ` Denis Kenzior
2023-11-03 11:27 ` James Prestwood
2023-10-31 18:47 ` [PATCH v3 9/9] dpp: initial version of PKEX configurator support James Prestwood
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=20231031184750.722404-4-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox