DPP: Bootstrapping via NFC URI Record
This extends hostapd and wpa_supplicant DPP implementation to allow the bootstrapping URI to be generated for and parsed from an NFC Tag with an NFC URI Record. This is similar to the way the bootstrapping URI is used with QR Code for unidirectional authentication. The DPP_BOOTSTRAP_GEN command uses "type=nfc-uri" to request the URI to be assigned for NFC URI Record. In practice, the URI is generated identically to the QR Code case, but the internal entry maintains the NFC-URI type. A new command "DPP_NFC_URI <uri>" can now be used to parse the URI read from an NFC Tag with the NFC URI Record. This is similar to the DPP_QR_CODE command. Other commands (mainly, DPP_LISTEN and DPP_AUTH_INIT) are used for NFC URI in the same way as they are used for QR Code. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
3c0d6eb8a9
commit
e780b4bf20
8 changed files with 88 additions and 13 deletions
|
@ -830,6 +830,8 @@ const char * dpp_bootstrap_type_txt(enum dpp_bootstrap_type type)
|
|||
return "QRCODE";
|
||||
case DPP_BOOTSTRAP_PKEX:
|
||||
return "PKEX";
|
||||
case DPP_BOOTSTRAP_NFC_URI:
|
||||
return "NFC-URI";
|
||||
}
|
||||
return "??";
|
||||
}
|
||||
|
@ -1181,17 +1183,6 @@ static struct dpp_bootstrap_info * dpp_parse_uri(const char *uri)
|
|||
}
|
||||
|
||||
|
||||
struct dpp_bootstrap_info * dpp_parse_qr_code(const char *uri)
|
||||
{
|
||||
struct dpp_bootstrap_info *bi;
|
||||
|
||||
bi = dpp_parse_uri(uri);
|
||||
if (bi)
|
||||
bi->type = DPP_BOOTSTRAP_QR_CODE;
|
||||
return bi;
|
||||
}
|
||||
|
||||
|
||||
static void dpp_debug_print_key(const char *title, EVP_PKEY *key)
|
||||
{
|
||||
EC_KEY *eckey;
|
||||
|
@ -8959,10 +8950,30 @@ struct dpp_bootstrap_info * dpp_add_qr_code(struct dpp_global *dpp,
|
|||
if (!dpp)
|
||||
return NULL;
|
||||
|
||||
bi = dpp_parse_qr_code(uri);
|
||||
bi = dpp_parse_uri(uri);
|
||||
if (!bi)
|
||||
return NULL;
|
||||
|
||||
bi->type = DPP_BOOTSTRAP_QR_CODE;
|
||||
bi->id = dpp_next_id(dpp);
|
||||
dl_list_add(&dpp->bootstrap, &bi->list);
|
||||
return bi;
|
||||
}
|
||||
|
||||
|
||||
struct dpp_bootstrap_info * dpp_add_nfc_uri(struct dpp_global *dpp,
|
||||
const char *uri)
|
||||
{
|
||||
struct dpp_bootstrap_info *bi;
|
||||
|
||||
if (!dpp)
|
||||
return NULL;
|
||||
|
||||
bi = dpp_parse_uri(uri);
|
||||
if (!bi)
|
||||
return NULL;
|
||||
|
||||
bi->type = DPP_BOOTSTRAP_NFC_URI;
|
||||
bi->id = dpp_next_id(dpp);
|
||||
dl_list_add(&dpp->bootstrap, &bi->list);
|
||||
return bi;
|
||||
|
@ -8990,6 +9001,8 @@ int dpp_bootstrap_gen(struct dpp_global *dpp, const char *cmd)
|
|||
bi->type = DPP_BOOTSTRAP_QR_CODE;
|
||||
else if (os_strstr(cmd, "type=pkex"))
|
||||
bi->type = DPP_BOOTSTRAP_PKEX;
|
||||
else if (os_strstr(cmd, "type=nfc-uri"))
|
||||
bi->type = DPP_BOOTSTRAP_NFC_URI;
|
||||
else
|
||||
goto fail;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue