From: Jouni Malinen Date: Thu, 14 May 2020 21:31:32 +0000 (+0300) Subject: dpp-nfc: Be more graceful when wpa_supplicant is not available X-Git-Tag: hostap_2_10~1316 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f96f2c3b122bf543188f82fd3ba54f35a3d71d2;p=thirdparty%2Fhostap.git dpp-nfc: Be more graceful when wpa_supplicant is not available Do not try to proceed with negotiated connection handover if wpa_supplicant control interface is not available. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/examples/dpp-nfc.py b/wpa_supplicant/examples/dpp-nfc.py index cc32e4904..2f220f964 100755 --- a/wpa_supplicant/examples/dpp-nfc.py +++ b/wpa_supplicant/examples/dpp-nfc.py @@ -154,7 +154,10 @@ def dpp_bootstrap_gen(wpas, type="qrcode", chan=None, mac=None, info=None, if mac: if mac is True: mac = own_addr(wpas) - cmd += " mac=" + mac.replace(':', '') + if mac is None: + print("Could not determine local MAC address for bootstrap info") + else: + cmd += " mac=" + mac.replace(':', '') if info: cmd += " info=" + info if curve: @@ -197,6 +200,9 @@ def wpas_report_handover_sel(uri): def dpp_handover_client(llc): uri = wpas_get_nfc_uri(start_listen=False) + if uri is None: + print("Cannot start handover client - no bootstrap URI available") + return uri = ndef.UriRecord(uri) print("NFC URI record for DPP: " + str(uri)) carrier = ndef.Record('application/vnd.wfa.dpp', 'A', uri.data)