aboutsummaryrefslogtreecommitdiffstats
path: root/hs20
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2015-05-26 20:47:34 (GMT)
committerJouni Malinen <j@w1.fi>2015-05-27 09:01:23 (GMT)
commit1b748e67aeedf90855331eef6ef837e90dc51a23 (patch)
tree9a005dd4e88cc2fed696dd64755dd87c0748c1e0 /hs20
parentdba68f2be2b2f955c0c19956e24be0b258dfc677 (diff)
downloadhostap-1b748e67aeedf90855331eef6ef837e90dc51a23.zip
hostap-1b748e67aeedf90855331eef6ef837e90dc51a23.tar.gz
hostap-1b748e67aeedf90855331eef6ef837e90dc51a23.tar.bz2
HS 2.0: hs20-client: Fix hostname extraction from URL
It was not properly handling cases like this: https://foo.local:443 Signed-off-by: Ben Greear <greearb@candelatech.com>
Diffstat (limited to 'hs20')
-rw-r--r--hs20/client/osu_client.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hs20/client/osu_client.c b/hs20/client/osu_client.c
index 5cd823e..478d940 100644
--- a/hs20/client/osu_client.c
+++ b/hs20/client/osu_client.c
@@ -2704,7 +2704,7 @@ static char * get_hostname(const char *url)
end = os_strchr(pos, '/');
end2 = os_strchr(pos, ':');
- if (end && end2 && end2 < end)
+ if ((end && end2 && end2 < end) || (!end && end2))
end = end2;
if (end)
end--;
@@ -2734,8 +2734,8 @@ static int osu_cert_cb(void *_ctx, struct http_cert *cert)
int found;
char *host = NULL;
- wpa_printf(MSG_INFO, "osu_cert_cb(osu_cert_validation=%d)",
- !ctx->no_osu_cert_validation);
+ wpa_printf(MSG_INFO, "osu_cert_cb(osu_cert_validation=%d, url=%s)",
+ !ctx->no_osu_cert_validation, ctx->server_url);
host = get_hostname(ctx->server_url);