DPP: Allow TCP destination (address/port) to be used from peer URI
tcp_addr=from-uri can now be used as a special case for initiating DPP-over-TCP to the destination indicated in the peer bootstrapping URI. Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
parent
e58dabbcfb
commit
ed325ff0f9
2 changed files with 22 additions and 2 deletions
|
@ -832,7 +832,17 @@ int hostapd_dpp_auth_init(struct hostapd_data *hapd, const char *cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
addr = get_param(cmd, " tcp_addr=");
|
addr = get_param(cmd, " tcp_addr=");
|
||||||
if (addr) {
|
if (addr && os_strcmp(addr, "from-uri") == 0) {
|
||||||
|
os_free(addr);
|
||||||
|
if (!peer_bi->host) {
|
||||||
|
wpa_printf(MSG_INFO,
|
||||||
|
"DPP: TCP address not available in peer URI");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
tcp = 1;
|
||||||
|
os_memcpy(&ipaddr, peer_bi->host, sizeof(ipaddr));
|
||||||
|
tcp_port = peer_bi->port;
|
||||||
|
} else if (addr) {
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = hostapd_parse_ip_addr(addr, &ipaddr);
|
res = hostapd_parse_ip_addr(addr, &ipaddr);
|
||||||
|
|
|
@ -799,7 +799,17 @@ int wpas_dpp_auth_init(struct wpa_supplicant *wpa_s, const char *cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
addr = get_param(cmd, " tcp_addr=");
|
addr = get_param(cmd, " tcp_addr=");
|
||||||
if (addr) {
|
if (addr && os_strcmp(addr, "from-uri") == 0) {
|
||||||
|
os_free(addr);
|
||||||
|
if (!peer_bi->host) {
|
||||||
|
wpa_printf(MSG_INFO,
|
||||||
|
"DPP: TCP address not available in peer URI");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
tcp = 1;
|
||||||
|
os_memcpy(&ipaddr, peer_bi->host, sizeof(ipaddr));
|
||||||
|
tcp_port = peer_bi->port;
|
||||||
|
} else if (addr) {
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = hostapd_parse_ip_addr(addr, &ipaddr);
|
res = hostapd_parse_ip_addr(addr, &ipaddr);
|
||||||
|
|
Loading…
Reference in a new issue