From 86fd6755cbe59ee438e35237cc96ae1f46ed417b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 11 Aug 2020 23:44:48 +0300 Subject: [PATCH] dpp-nfc: Use --altchan value in handover server Use the alternative channel list in the handover server role when processing an alternative proposal. This was previously done only in the handover client role, but with the updated design, both roles act in a similar manner for the case where the alternative channel list is specified. Signed-off-by: Jouni Malinen --- wpa_supplicant/examples/dpp-nfc.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wpa_supplicant/examples/dpp-nfc.py b/wpa_supplicant/examples/dpp-nfc.py index 4027c5e23..e0d11f412 100755 --- a/wpa_supplicant/examples/dpp-nfc.py +++ b/wpa_supplicant/examples/dpp-nfc.py @@ -467,6 +467,7 @@ def run_dpp_handover_client(handover, alt=False): summary("DPP carrier not seen in response - do not allow alternative proposal anymore") elif not dpp_found: summary("DPP carrier not seen in response - allow peer to initiate a new handover with different parameters") + handover.alt_proposal = True handover.my_crn_ready = False handover.my_crn = None handover.peer_crn = None @@ -523,6 +524,7 @@ class HandoverServer(nfc.handover.HandoverServer): resp = self._process_request_data(req) if resp is None or len(resp) == 0: summary("No handover select to send out - wait for a possible alternative handover request") + handover.alt_proposal = True req = bytearray() continue @@ -605,6 +607,11 @@ class HandoverServer(nfc.handover.HandoverServer): if test_uri: summary("TEST MODE: Using specified URI") data = test_sel_uri if test_sel_uri else test_uri + elif handover.alt_proposal and handover.altchanlist: + summary("Use alternative channel list while processing alternative proposal from peer") + data = wpas_get_nfc_uri(start_listen=False, + chan_override=handover.altchanlist, + pick_channel=True) else: data = wpas_get_nfc_uri(start_listen=False, pick_channel=True) @@ -918,6 +925,7 @@ class ConnectionHandover(): self.my_uri = None self.peer_uri = None self.connected = False + self.alt_proposal = False def start_handover_server(self, llc): summary("Start handover server")