if "OK" not in dev[0].request("DPP_BOOTSTRAP_REMOVE %d" % id[1]):
raise Exception("DPP_BOOTSTRAP_REMOVE failed")
- res = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode")
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % int(res))
+ id = dev[0].dpp_bootstrap_gen()
+ uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id)
logger.info("Generated URI: " + uri)
dev[0].dpp_qr_code(uri)
- res = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1,115/36 mac=010203040506 info=foo")
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % int(res))
+ id = dev[0].dpp_bootstrap_gen(chan="81/1,115/36", mac="010203040506",
+ info="foo")
+ uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id)
logger.info("Generated URI: " + uri)
dev[0].dpp_qr_code(uri)
("secp384r1", dpp_key_p384),
("secp521r1", dpp_key_p521) ]
for curve, hex in tests:
- id = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode key=" + hex)
- if "FAIL" in id:
- raise Exception("Failed to set key for " + curve)
- info = dev[0].request("DPP_BOOTSTRAP_INFO " + id)
+ id = dev[0].dpp_bootstrap_gen(key=hex)
+ info = dev[0].request("DPP_BOOTSTRAP_INFO %d" % id)
if "FAIL" in info:
raise Exception("Failed to get info for " + curve)
if "curve=" + curve not in info:
("brainpoolP384r1", dpp_key_bp384),
("brainpoolP512r1", dpp_key_bp512) ]
for curve, hex in tests:
- id = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode key=" + hex)
- if "FAIL" in id:
- raise Exception("Failed to set key for " + curve)
- info = dev[0].request("DPP_BOOTSTRAP_INFO " + id)
+ id = dev[0].dpp_bootstrap_gen(key=hex)
+ info = dev[0].request("DPP_BOOTSTRAP_INFO %d" % id)
if "FAIL" in info:
raise Exception("Failed to get info for " + curve)
if "curve=" + curve not in info:
check_dpp_capab(dev[0], brainpool=True)
check_dpp_capab(dev[1], brainpool=True)
- addr = dev[0].own_addr().replace(':', '')
bi = []
for key in [ dpp_key_p256, dpp_key_p384, dpp_key_p521,
dpp_key_bp256, dpp_key_bp384, dpp_key_bp512 ]:
- id = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr + " key=" + key)
- if "FAIL" in id:
- raise Exception("Failed to set key for " + curve)
- info = dev[0].request("DPP_BOOTSTRAP_INFO " + id)
+ id = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True, key=key)
+ info = dev[0].request("DPP_BOOTSTRAP_INFO %d" % id)
for i in info.splitlines():
if '=' in i:
name, val = i.split('=')
if name == "curve":
curve = val
break
- uri = dev[0].request("DPP_BOOTSTRAP_GET_URI " + id)
+ uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id)
bi.append((curve, uri))
for curve, uri in bi:
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
logger.info("dev0 displays QR Code")
- res = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1")
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1")
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
conf_id = int(res)
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- if curve:
- cmd += " curve=" + curve
- if key:
- cmd += " key=" + key
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True, curve=curve, key=key)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- res = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 displays QR Code")
- addr = dev[1].own_addr().replace(':', '')
- res = dev[1].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1b = int(res)
+ id1b = dev[1].dpp_bootstrap_gen(chan="81/1", mac=True)
uri1b = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1b)
logger.info("dev0 scans QR Code")
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- res = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 displays QR Code")
- addr = dev[1].own_addr().replace(':', '')
- res = dev[1].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1b = int(res)
+ id1b = dev[1].dpp_bootstrap_gen(chan="81/1", mac=True)
uri1b = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1b)
logger.info("dev1 initiates DPP Authentication")
check_dpp_capab(dev[0], curve and "BP-" in curve)
check_dpp_capab(dev[1], curve and "BP-" in curve)
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- cmd += " curve=" + curve
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True, curve=curve)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
dev[0].set("dpp_resp_retry_time", "100")
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- res = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 displays QR Code")
- addr = dev[1].own_addr().replace(':', '')
- res = dev[1].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1b = int(res)
+ id1b = dev[1].dpp_bootstrap_gen(chan="81/1", mac=True)
uri1b = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1b)
logger.info("dev1 initiates DPP Authentication")
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- res = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 displays QR Code")
- addr = dev[1].own_addr().replace(':', '')
- res = dev[1].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1b = int(res)
+ id1b = dev[1].dpp_bootstrap_gen(chan="81/1", mac=True)
uri1b = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1b)
logger.info("dev0 does not scan QR Code")
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- res = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 displays QR Code")
- addr = dev[1].own_addr().replace(':', '')
- res = dev[1].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr + " curve=secp384r1")
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1b = int(res)
+ id1b = dev[1].dpp_bootstrap_gen(chan="81/1", mac=True, curve="secp384r1")
uri1b = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1b)
logger.info("dev0 scans QR Code")
check_dpp_capab(hapd)
logger.info("AP displays QR Code")
- addr = hapd.own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = hapd.request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id_h = int(res)
+ id_h = hapd.dpp_bootstrap_gen(chan="81/1", mac=True)
uri_h = hapd.request("DPP_BOOTSTRAP_GET_URI %d" % id_h)
logger.info("dev0 scans QR Code")
id0 = dev[0].dpp_qr_code(uri_h)
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- res = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0b = int(res)
+ id0b = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0b)
logger.info("dev0 initiates DPP Authentication")
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- res = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
dev[0].request("SET gas_address3 1")
dev[1].request("SET gas_address3 1")
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- res = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- res = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- res = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
conf_id = int(res)
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
hapd = hostapd.add_ap(apdev[0], { "ssid": "unconfigured" })
check_dpp_capab(hapd)
- addr = hapd.own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- if curve:
- cmd += " curve=" + curve
- res = hapd.request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id_h = int(res)
+ id_h = hapd.dpp_bootstrap_gen(chan="81/1", mac=True, curve=curve)
uri = hapd.request("DPP_BOOTSTRAP_GET_URI %d" % id_h)
cmd = "DPP_CONFIGURATOR_ADD"
update_hapd_config(hapd)
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- if curve:
- cmd += " curve=" + curve
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id1 = dev[1].dpp_bootstrap_gen(chan="81/1", mac=True, curve=curve)
uri1 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1)
id0b = dev[0].dpp_qr_code(uri1)
conf_id = int(res)
dev[0].set("dpp_config_processing", str(processing))
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = dev[1].dpp_qr_code(uri0)
hapd = hostapd.add_ap(apdev[0], params)
dev[0].set("dpp_config_processing", "2")
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = dev[1].dpp_qr_code(uri0)
hapd = hostapd.add_ap(apdev[0], params)
dev[0].set("dpp_config_processing", "2")
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = dev[1].dpp_qr_code(uri0)
raise Exception("Failed to add configurator")
conf_id = int(res)
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = dev[1].dpp_qr_code(uri0)
raise Exception("Failed to add configurator")
conf_id = int(res)
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
dev[0].set("dpp_configurator_params",
raise Exception("Failed to add configurator")
conf_id = int(res)
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1,81/11 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1,81/11", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
dev[0].set("dpp_configurator_params",
# Responder bootstrapping key
priv = "54ce181a98525f217216f59b245f60e9df30ac7f6b26c939418cfc3c42d1afa0"
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/11 mac=" + addr + " key=30310201010420" + priv + "a00a06082a8648ce3d030107"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/11", mac=True, key="30310201010420" + priv + "a00a06082a8648ce3d030107")
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
# Responder protocol keypair override
# Initiator bootstrapping key
priv = "15b2a83c5a0a38b61f2aa8200ee4994b8afdc01c58507d10d0a38f7eedf051bb"
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode key=30310201010420" + priv + "a00a06082a8648ce3d030107"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id1 = dev[1].dpp_bootstrap_gen(key="30310201010420" + priv + "a00a06082a8648ce3d030107")
uri1 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1)
# Initiator protocol keypair override
# Responder bootstrapping key
priv = "54ce181a98525f217216f59b245f60e9df30ac7f6b26c939418cfc3c42d1afa0"
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/11 mac=" + addr + " key=30310201010420" + priv + "a00a06082a8648ce3d030107"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/11", mac=True, key="30310201010420" + priv + "a00a06082a8648ce3d030107")
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
# Responder protocol keypair override
# Initiator bootstrapping key
priv = "15b2a83c5a0a38b61f2aa8200ee4994b8afdc01c58507d10d0a38f7eedf051bb"
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode key=30310201010420" + priv + "a00a06082a8648ce3d030107"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id1 = dev[1].dpp_bootstrap_gen(key="30310201010420" + priv + "a00a06082a8648ce3d030107")
uri1 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1)
# Initiator protocol keypair override
# Responder bootstrapping key
priv = "0061e54f518cdf859735da3dd64c6f72c2f086f41a6fd52915152ea2fe0f24ddaecd8883730c9c9fd82cf7c043a41021696388cf5190b731dd83638bcd56d8b6c743"
- addr = dev[0].own_addr().replace(':', '')
- #cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/11 mac=" + addr + " key=" + der_prefix + priv + der_postfix
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/11 mac=" + addr + " key=" + der_priv_key_p_521(priv)
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/11", mac=True,
+ key=der_priv_key_p_521(priv))
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
# Responder protocol keypair override
# Initiator bootstrapping key
priv = "0060c10df14af5ef27f6e362d31bdd9eeb44be77a323ba64b08f3f03d58b92cbfe05c182a91660caa081ca344243c47b5aa088bcdf738840eb35f0218b9f26881e02"
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode key=" + der_priv_key_p_521(priv)
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id1 = dev[1].dpp_bootstrap_gen(key=der_priv_key_p_521(priv))
uri1 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1)
# Initiator protocol keypair override
check_dpp_capab(dev[0], curve and "brainpool" in curve)
check_dpp_capab(dev[1], curve and "brainpool" in curve)
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- if curve:
- cmd += " curve=" + curve
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
-
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- if curve:
- cmd += " curve=" + curve
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex", curve=curve)
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex", curve=curve)
identifier = " identifier=" + identifier_r if identifier_r else ""
cmd = "DPP_PKEX_ADD own=%d%s code=secret" % (id0, identifier)
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
-
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex")
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d identifier=test code=secret" % (id0)
res = dev[0].request(cmd)
dev[1].set("dpp_pkex_peer_mac_override", resp_addr)
# Responder bootstrapping key
- cmd = "DPP_BOOTSTRAP_GEN type=pkex key=" + p256_prefix + resp_priv + p256_postfix
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex",
+ key=p256_prefix + resp_priv + p256_postfix)
# Responder y/Y keypair override
dev[0].set("dpp_pkex_ephemeral_key_override",
p256_prefix + resp_y_priv + p256_postfix)
# Initiator bootstrapping key
- cmd = "DPP_BOOTSTRAP_GEN type=pkex key=" + p256_prefix + init_priv + p256_postfix
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex",
+ key=p256_prefix + init_priv + p256_postfix)
# Initiator x/X keypair override
dev[1].set("dpp_pkex_ephemeral_key_override",
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
-
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex")
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d identifier=test code=secret" % (id0)
res = dev[0].request(cmd)
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
-
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex")
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d identifier=test code=secret" % (id0)
res = dev[0].request(cmd)
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
- cmd = "DPP_BOOTSTRAP_GEN type=pkex curve=P-256"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
-
- cmd = "DPP_BOOTSTRAP_GEN type=pkex curve=P-384"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex", curve="P-256")
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex", curve="P-384")
cmd = "DPP_PKEX_ADD own=%d identifier=test code=secret" % (id0)
res = dev[0].request(cmd)
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
- cmd = "DPP_BOOTSTRAP_GEN type=pkex curve=P-256"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
-
- cmd = "DPP_BOOTSTRAP_GEN type=pkex curve=P-384"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex", curve="P-256")
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex", curve="P-384")
cmd = "DPP_PKEX_ADD own=%d identifier=test code=secret" % (id0)
res = dev[0].request(cmd)
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
-
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex")
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d identifier=test code=secret" % (id0)
res = dev[0].request(cmd)
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
-
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex")
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d identifier=test code=secret" % (id0)
res = dev[0].request(cmd)
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- if curve:
- cmd += " curve=" + curve
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
-
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- if curve:
- cmd += " curve=" + curve
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex", curve=curve)
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex", curve=curve)
cmd = "DPP_PKEX_ADD own=%d identifier=test code=secret" % (id0)
res = dev[0].request(cmd)
"""DPP and PKEX with no responder (retry behavior)"""
check_dpp_capab(dev[0])
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d init=1 identifier=test code=secret" % (id0)
res = dev[0].request(cmd)
"""DPP and PKEX completing after retry"""
check_dpp_capab(dev[0])
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d init=1 identifier=test code=secret" % (id0)
res = dev[0].request(cmd)
raise Exception("Failed to set PKEX data (initiator)")
time.sleep(0.1)
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d identifier=test code=secret" % (id1)
res = dev[1].request(cmd)
"channel": "6" })
check_dpp_capab(hapd)
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = hapd.request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info (hostapd)")
- id_h = int(res)
+ id_h = hapd.dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d identifier=test code=secret" % (id_h)
res = hapd.request(cmd)
raise Exception("Failed to add configurator")
conf_id = int(res)
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info (wpa_supplicant)")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 conf=ap-dpp configurator=%d code=secret" % (id0, conf_id)
res = dev[0].request(cmd)
raise Exception("Failed to add configurator")
conf_id = int(res)
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info (wpa_supplicant)")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex")
dev[0].set("dpp_configurator_params",
" conf=ap-dpp configurator=%d" % conf_id)
if "OK" not in dev[0].request(cmd):
raise Exception("Failed to start listen operation")
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = hapd.request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info (hostapd)")
- id_h = int(res)
+ id_h = hapd.dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 role=enrollee code=secret" % (id_h)
res = hapd.request(cmd)
raise Exception("Failed to add configurator")
conf_id = int(res)
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = hapd.dpp_qr_code(uri0)
hapd.set("dpp_configurator_params",
" conf=sta-dpp configurator=%d" % conf_id)
- addr = hapd.own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = hapd.request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = hapd.dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = hapd.request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = dev[0].dpp_qr_code(uri0)
hapd = hostapd.add_ap(apdev[0], { "ssid": "unconfigured" })
check_dpp_capab(hapd)
- addr = hapd.own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = hapd.request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id_h = int(res)
+ id_h = hapd.dpp_bootstrap_gen(chan="81/1", mac=True)
uri = hapd.request("DPP_BOOTSTRAP_GET_URI %d" % id_h)
cmd = "DPP_CONFIGURATOR_ADD"
raise Exception("Failed to add configurator (reconf)")
conf_id = int(res)
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id = int(res)
+ id = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id)
id = hapd.dpp_qr_code(uri)
hapd = hostapd.add_ap(apdev[0], { "ssid": "unconfigured" })
check_dpp_capab(hapd)
- addr = hapd.own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = hapd.request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id_h = int(res)
+ id_h = hapd.dpp_bootstrap_gen(chan="81/1", mac=True)
uri = hapd.request("DPP_BOOTSTRAP_GET_URI %d" % id_h)
logger.info("Provision AP with DPP configuration")
logger.info("Provision STA0 with DPP Connector that has mismatching groupId")
dev[0].set("dpp_config_processing", "2")
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = dev[1].dpp_qr_code(uri0)
logger.info("Provision STA2 with DPP Connector that has mismatching C-sign-key")
dev[2].set("dpp_config_processing", "2")
- addr = dev[2].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[2].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id2 = int(res)
+ id2 = dev[2].dpp_bootstrap_gen(chan="81/1", mac=True)
uri2 = dev[2].request("DPP_BOOTSTRAP_GET_URI %d" % id2)
id1 = dev[1].dpp_qr_code(uri2)
logger.info("Provision STA5 with DPP Connector that has mismatching netAccessKey EC group")
wpas.set("dpp_config_processing", "2")
- addr = wpas.own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- cmd += " curve=P-521"
- res = wpas.request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id5 = int(res)
+ id5 = wpas.dpp_bootstrap_gen(chan="81/1", mac=True, curve="P-521")
uri5 = wpas.request("DPP_BOOTSTRAP_GET_URI %d" % id5)
id1 = dev[1].dpp_qr_code(uri5)
raise Exception("Failed to add configurator")
conf_id = int(res)
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode"
- if chan:
- cmd += " chan=" + chan
- if unicast:
- cmd += " mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan=chan, mac=unicast)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = dev[1].dpp_qr_code(uri0)
if mutual:
- addr = dev[1].own_addr().replace(':', '')
- res = dev[1].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1b = int(res)
+ id1b = dev[1].dpp_bootstrap_gen(chan="81/1", mac=True)
uri1b = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1b)
id0b = dev[0].dpp_qr_code(uri1b)
check_dpp_capab(dev[1])
dev[test_dev].set("dpp_test", str(test))
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
-
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex")
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d identifier=test code=secret" % (id0)
res = dev[0].request(cmd)
dev[1].set("dpp_resp_wait_time", "1000")
logger.info("dev0 displays QR Code")
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode"
- if chanlist:
- cmd += " chan=" + chanlist
- if unicast:
- addr = dev[0].own_addr().replace(':', '')
- cmd += " mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan=chanlist, mac=unicast)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=123/123"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="123/123")
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = dev[1].dpp_qr_code(uri0)
raise Exception("Failed to add configurator")
conf_id = int(res)
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
-
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex")
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex")
# Local error cases on the Initiator
tests = [ (1, "dpp_get_pubkey_point"),
raise Exception("Failed to add configurator")
conf_id = int(res)
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
-
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(type="pkex")
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex")
# Local error cases on the Initiator
tests = [ (1, "aes_siv_encrypt;dpp_auth_build_req"),
raise Exception("DPP configuration not completed (Enrollee)")
def start_dpp(dev):
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = dev[1].dpp_qr_code(uri0)
check_dpp_capab(dev[1])
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
check_dpp_capab(dev[1])
logger.info("dev0 displays QR Code")
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
logger.info("dev1 scans QR Code")
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = dev[1].dpp_qr_code(uri0)
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = dev[1].dpp_qr_code(uri0)
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = dev[1].dpp_qr_code(uri0)
if "FAIL" not in dev.request("DPP_BOOTSTRAP_GEN " + t):
raise Exception("Command accepted unexpectedly")
- id = dev.request("DPP_BOOTSTRAP_GEN type=qrcode")
- if "FAIL" in id:
- raise Exception("Failed to generate bootstrap info")
- uri = dev.request("DPP_BOOTSTRAP_GET_URI " + id)
+ id = dev.dpp_bootstrap_gen()
+ uri = dev.request("DPP_BOOTSTRAP_GET_URI %d" % id)
if not uri.startswith("DPP:"):
raise Exception("Could not get URI")
if "FAIL" not in dev.request("DPP_BOOTSTRAP_GET_URI 0"):
raise Exception("Failure not reported")
- info = dev.request("DPP_BOOTSTRAP_INFO " + id)
+ info = dev.request("DPP_BOOTSTRAP_INFO %d" % id)
if not info.startswith("type=QRCODE"):
raise Exception("Could not get info")
if "FAIL" not in dev.request("DPP_BOOTSTRAP_REMOVE 0"):
raise Exception("Failure not reported")
if "FAIL" in dev.request("DPP_BOOTSTRAP_REMOVE *"):
raise Exception("Failed to remove bootstrap info")
- if "FAIL" not in dev.request("DPP_BOOTSTRAP_GET_URI " + id):
+ if "FAIL" not in dev.request("DPP_BOOTSTRAP_GET_URI %d" % id):
raise Exception("Failure not reported")
- if "FAIL" not in dev.request("DPP_BOOTSTRAP_INFO " + id):
+ if "FAIL" not in dev.request("DPP_BOOTSTRAP_INFO %d" % id):
raise Exception("Failure not reported")
func = "hostapd_dpp_bootstrap_gen" if hostapd else "wpas_dpp_bootstrap_gen"
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
- addr = dev[0].own_addr().replace(':', '')
- id = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in id:
- raise Exception("Failed to set key for " + curve)
- uri = dev[0].request("DPP_BOOTSTRAP_GET_URI " + id)
+ id = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
+ uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id)
if "OK" not in dev[0].request("DPP_LISTEN 2412"):
raise Exception("Failed to start listen operation")
check_dpp_capab(dev[1])
check_dpp_capab(dev[2])
- addr = dev[0].own_addr().replace(':', '')
- id = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr)
- if "FAIL" in id:
- raise Exception("Failed to set key for " + curve)
- uri = dev[0].request("DPP_BOOTSTRAP_GET_URI " + id)
+ id = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
+ uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id)
if "OK" not in dev[0].request("DPP_LISTEN 2412"):
raise Exception("Failed to start listen operation")
raise Exception("Failed to add configurator")
conf_id = int(res)
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[1].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
dev[1].set("dpp_configurator_params",
raise Exception("Failed to add configurator")
conf_id = int(res)
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[1].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
dev[1].set("dpp_configurator_params",
raise Exception("Failed to add configurator")
conf_id = int(res)
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[1].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
res = sigma_dut_cmd("dev_exec_action,program,DPP,DPPActionType,GetLocalBootstrap,DPPCryptoIdentifier,P-256,DPPBS,QR")
raise Exception("Failed to add configurator")
conf_id = int(res)
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[1].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
res = sigma_dut_cmd("dev_exec_action,program,DPP,DPPActionType,GetLocalBootstrap,DPPCryptoIdentifier,P-256,DPPBS,QR")
raise Exception("Failed to add configurator")
conf_id = int(res)
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[1].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
dev[1].set("dpp_configurator_params",
raise Exception("Failed to add configurator")
conf_id = int(res)
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[1].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
dev[1].set("dpp_configurator_params",
check_dpp_capab(dev[1])
sigma = start_sigma_dut(dev[0].ifname)
try:
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[1].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
cmd = "DPP_LISTEN 2437 role=enrollee"
id1 = dev[1].dpp_qr_code(uri)
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[1].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
cmd = "DPP_LISTEN 2437 role=enrollee"
id1 = dev[1].dpp_qr_code(uri)
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[1].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
res = sigma_dut_cmd("dev_exec_action,program,DPP,DPPActionType,SetPeerBootstrap,DPPBootstrappingdata,%s,DPPBS,QR" % to_hex(uri0))
check_dpp_capab(dev[1])
sigma = start_sigma_dut(dev[0].ifname)
try:
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d identifier=test code=secret" % (id1)
res = dev[1].request(cmd)
if "FAIL" in res:
if "ConfResult,OK" not in res:
raise Exception("Unexpected result: " + res)
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id1 = dev[1].dpp_bootstrap_gen(chan="81/1", mac=True)
uri1 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1)
id0b = dev[0].dpp_qr_code(uri1)
def dpp_init_conf_pkex(dev, conf_id, check_config=True):
logger.info("Starting DPP PKEX initiator/configurator in a thread")
time.sleep(1.5)
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev.request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id = int(res)
+ id = dev.dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d init=1 conf=ap-dpp configurator=%d code=password" % (id, conf_id)
res = dev.request(cmd)
if "FAIL" in res:
stop_sigma_dut(sigma)
def run_sigma_dut_dpp_proto_initiator(dev, step, frame, attr, result, fail):
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[1].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
cmd = "DPP_LISTEN 2437 role=enrollee"
stop_sigma_dut(sigma)
def run_sigma_dut_dpp_proto_stop_at_initiator(dev, frame, result, fail):
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[1].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
cmd = "DPP_LISTEN 2437 role=enrollee"
def run_sigma_dut_dpp_proto_stop_at_initiator_enrollee(dev, frame, result,
fail):
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[1].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
cmd = "DPP_LISTEN 2437 role=configurator"
raise Exception("Failed to add configurator")
conf_id = int(res)
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev.request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id = int(res)
+ id = dev.dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d init=1 conf=sta-dpp configurator=%d code=secret" % (id, conf_id)
if "FAIL" in dev.request(cmd):
stop_sigma_dut(sigma)
def run_sigma_dut_dpp_proto_initiator_pkex(dev, step, frame, attr, result, fail):
- cmd = "DPP_BOOTSTRAP_GEN type=pkex"
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id1 = int(res)
+ id1 = dev[1].dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d code=secret" % (id1)
res = dev[1].request(cmd)
raise Exception("Failed to add configurator")
conf_id = int(res)
- addr = dev[1].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/6 mac=" + addr
- res = dev[1].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id0 = int(res)
+ id0 = dev[1].dpp_bootstrap_gen(chan="81/6", mac=True)
uri0 = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
dev[1].set("dpp_configurator_params",
sigma = start_sigma_dut(dev[0].ifname)
try:
dev[0].set("dpp_config_processing", "2")
- addr = hapd.own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
- res = hapd.request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id = int(res)
+ id = hapd.dpp_bootstrap_gen(chan="81/1", mac=True)
uri = hapd.request("DPP_BOOTSTRAP_GET_URI %d" % id)
res = sigma_dut_cmd("dev_exec_action,program,DPP,DPPActionType,SetPeerBootstrap,DPPBootstrappingdata,%s,DPPBS,QR" % to_hex(uri))
dev[0].set("dpp_config_processing", "2")
- addr = dev[0].own_addr().replace(':', '')
- cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/11 mac=" + addr
- res = dev[0].request(cmd)
- if "FAIL" in res:
- raise Exception("Failed to generate bootstrapping info")
- id = int(res)
+ id = dev[0].dpp_bootstrap_gen(chan="81/11", mac=True)
uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id)
cmd = "DPP_LISTEN 2462 role=enrollee"
if "OK" not in dev[0].request(cmd):