aboutsummaryrefslogtreecommitdiffstats
path: root/hs20
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2018-09-12 01:00:27 (GMT)
committerJouni Malinen <jouni@codeaurora.org>2018-09-12 21:17:51 (GMT)
commit25f3c270d91fbddaa3e43b277cbdd28a1e9b4792 (patch)
treee2bf04568240f85efcb53a95d8a5ac5b7393543c /hs20
parentb275c3ae51c90c5620c526abc2b1492d89d11cfa (diff)
downloadhostap-25f3c270d91fbddaa3e43b277cbdd28a1e9b4792.zip
hostap-25f3c270d91fbddaa3e43b277cbdd28a1e9b4792.tar.gz
hostap-25f3c270d91fbddaa3e43b277cbdd28a1e9b4792.tar.bz2
HS 2.0: Allow OSU SSID selection to be enforced for testing purposes
This allows hs20-osu-client to be requested to select a specific OSU SSID with the new command line argument (-o<OSU_SSID>). This is useful for testing single SSID transition mode cases. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'hs20')
-rw-r--r--hs20/client/osu_client.c21
-rw-r--r--hs20/client/osu_client.h1
2 files changed, 21 insertions, 1 deletions
diff --git a/hs20/client/osu_client.c b/hs20/client/osu_client.c
index a174699..76ef9c4 100644
--- a/hs20/client/osu_client.c
+++ b/hs20/client/osu_client.c
@@ -2146,6 +2146,22 @@ static int osu_connect(struct hs20_osu_client *ctx, const char *bssid,
if (ssid2 && ssid2[0] == '\0')
ssid2 = NULL;
+ if (ctx->osu_ssid) {
+ if (os_strcmp(ssid, ctx->osu_ssid) == 0) {
+ wpa_printf(MSG_DEBUG,
+ "Enforced OSU SSID matches ANQP info");
+ ssid2 = NULL;
+ } else if (ssid2 && os_strcmp(ssid2, ctx->osu_ssid) == 0) {
+ wpa_printf(MSG_DEBUG,
+ "Enforced OSU SSID matches RSN[OSEN] info");
+ ssid = ssid2;
+ } else {
+ wpa_printf(MSG_INFO, "Enforced OSU SSID did not match");
+ write_summary(ctx, "Enforced OSU SSID did not match");
+ return -1;
+ }
+ }
+
id = add_network(ifname);
if (id < 0)
return -1;
@@ -3153,7 +3169,7 @@ int main(int argc, char *argv[])
return -1;
for (;;) {
- c = getopt(argc, argv, "df:hKNO:qr:s:S:tw:x:");
+ c = getopt(argc, argv, "df:hKNo:O:qr:s:S:tw:x:");
if (c < 0)
break;
switch (c) {
@@ -3170,6 +3186,9 @@ int main(int argc, char *argv[])
case 'N':
no_prod_assoc = 1;
break;
+ case 'o':
+ ctx.osu_ssid = optarg;
+ break;
case 'O':
friendly_name = optarg;
break;
diff --git a/hs20/client/osu_client.h b/hs20/client/osu_client.h
index 9a7059e..5c8e6d0 100644
--- a/hs20/client/osu_client.h
+++ b/hs20/client/osu_client.h
@@ -47,6 +47,7 @@ struct hs20_osu_client {
int client_cert_present;
char **server_dnsname;
size_t server_dnsname_count;
+ const char *osu_ssid; /* Enforced OSU_SSID for testing purposes */
#define WORKAROUND_OCSP_OPTIONAL 0x00000001
unsigned long int workarounds;
};