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 <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2020-05-15 00:31:32 +03:00 committed by Jouni Malinen
parent 0b04d3c578
commit 8f96f2c3b1

View file

@ -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)