aboutsummaryrefslogtreecommitdiffstats
path: root/hs20
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2018-10-05 17:53:31 (GMT)
committerJouni Malinen <j@w1.fi>2018-10-05 17:53:31 (GMT)
commit2f158bc194f8d9900f0c36087b254ada611cf126 (patch)
treed45ee0ca84c96d186ccbff1347e22181c3256c6a /hs20
parentbaf4c8637988f77009392935541fcb7f1c6344a7 (diff)
downloadhostap-2f158bc194f8d9900f0c36087b254ada611cf126.zip
hostap-2f158bc194f8d9900f0c36087b254ada611cf126.tar.gz
hostap-2f158bc194f8d9900f0c36087b254ada611cf126.tar.bz2
HS 2.0: Use alternative OSU_NAI information in hs20-osu-client
Extend hs20-osu-client to support the new osu_nai2 value for OSU connection with the shared BSS (Single SSID) case. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'hs20')
-rw-r--r--hs20/client/osu_client.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/hs20/client/osu_client.c b/hs20/client/osu_client.c
index b8791b6..02bde2f 100644
--- a/hs20/client/osu_client.c
+++ b/hs20/client/osu_client.c
@@ -1987,6 +1987,7 @@ struct osu_data {
char osu_ssid[33];
char osu_ssid2[33];
char osu_nai[256];
+ char osu_nai2[256];
struct osu_lang_text friendly_name[MAX_OSU_VALS];
size_t friendly_name_count;
struct osu_lang_text serv_desc[MAX_OSU_VALS];
@@ -2057,6 +2058,12 @@ static struct osu_data * parse_osu_providers(const char *fname, size_t *count)
continue;
}
+ if (os_strncmp(buf, "osu_nai2=", 9) == 0) {
+ os_snprintf(last->osu_nai2, sizeof(last->osu_nai2),
+ "%s", buf + 9);
+ continue;
+ }
+
if (strncmp(buf, "friendly_name=", 14) == 0) {
struct osu_lang_text *txt;
if (last->friendly_name_count == MAX_OSU_VALS)
@@ -2134,7 +2141,7 @@ static struct osu_data * parse_osu_providers(const char *fname, size_t *count)
static int osu_connect(struct hs20_osu_client *ctx, const char *bssid,
const char *ssid, const char *ssid2, const char *url,
unsigned int methods, int no_prod_assoc,
- const char *osu_nai)
+ const char *osu_nai, const char *osu_nai2)
{
int id;
const char *ifname = ctx->ifname;
@@ -2166,6 +2173,8 @@ static int osu_connect(struct hs20_osu_client *ctx, const char *bssid,
return -1;
if (set_network_quoted(ifname, id, "ssid", ssid) < 0)
return -1;
+ if (ssid2)
+ osu_nai = osu_nai2;
if (osu_nai && os_strlen(osu_nai) > 0) {
char dir[255], fname[300];
if (getcwd(dir, sizeof(dir)) == NULL)
@@ -2363,6 +2372,8 @@ static int cmd_osu_select(struct hs20_osu_client *ctx, const char *dir,
fprintf(f, "SSID2: %s<br>\n", last->osu_ssid2);
if (last->osu_nai[0])
fprintf(f, "NAI: %s<br>\n", last->osu_nai);
+ if (last->osu_nai2[0])
+ fprintf(f, "NAI2: %s<br>\n", last->osu_nai2);
fprintf(f, "URL: %s<br>\n"
"methods:%s%s<br>\n"
"</small></p>\n",
@@ -2449,7 +2460,8 @@ selected:
ret = osu_connect(ctx, last->bssid, last->osu_ssid,
last->osu_ssid2,
last->url, last->methods,
- no_prod_assoc, last->osu_nai);
+ no_prod_assoc, last->osu_nai,
+ last->osu_nai2);
}
} else
ret = -1;