aboutsummaryrefslogtreecommitdiffstats
path: root/hs20
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2015-04-01 00:14:20 (GMT)
committerJouni Malinen <j@w1.fi>2015-04-01 17:33:28 (GMT)
commit0bb20efcd00826d5396bacc834f2e47a63a52f4f (patch)
treed424ce217f4040f54b9031e4897220f9ec81e8d3 /hs20
parent97c9991c5bb92a8da52c540ac5bb285e8eb3353c (diff)
downloadhostap-0bb20efcd00826d5396bacc834f2e47a63a52f4f.zip
hostap-0bb20efcd00826d5396bacc834f2e47a63a52f4f.tar.gz
hostap-0bb20efcd00826d5396bacc834f2e47a63a52f4f.tar.bz2
HS 2.0R2: Allow user to specify spp.xsd file location
Allow user to specify the path to the spp.xsd file for hs20-osu-client instead of requiring this to be spp.xsd in the current working directory. Signed-off-by: Ben Greear <greearb@candelatech.com>
Diffstat (limited to 'hs20')
-rw-r--r--hs20/client/osu_client.c8
-rw-r--r--hs20/client/spp_client.c4
2 files changed, 10 insertions, 2 deletions
diff --git a/hs20/client/osu_client.c b/hs20/client/osu_client.c
index 6ce00f8..5cd823e 100644
--- a/hs20/client/osu_client.c
+++ b/hs20/client/osu_client.c
@@ -25,6 +25,8 @@
#include "crypto/sha256.h"
#include "osu_client.h"
+const char *spp_xsd_fname = "spp.xsd";
+
void write_result(struct hs20_osu_client *ctx, const char *fmt, ...)
{
@@ -2984,6 +2986,7 @@ static void usage(void)
" [-w<wpa_supplicant ctrl_iface dir>] "
"[-r<result file>] [-f<debug file>] \\\n"
" [-s<summary file>] \\\n"
+ " [-x<spp.xsd file name>] \\\n"
" <command> [arguments..]\n"
"commands:\n"
"- to_tnds <XML MO> <XML MO in TNDS format> [URN]\n"
@@ -3025,7 +3028,7 @@ int main(int argc, char *argv[])
return -1;
for (;;) {
- c = getopt(argc, argv, "df:hKNO:qr:s:S:tw:");
+ c = getopt(argc, argv, "df:hKNO:qr:s:S:tw:x:");
if (c < 0)
break;
switch (c) {
@@ -3063,6 +3066,9 @@ int main(int argc, char *argv[])
case 'w':
wpas_ctrl_path = optarg;
break;
+ case 'x':
+ spp_xsd_fname = optarg;
+ break;
case 'h':
default:
usage();
diff --git a/hs20/client/spp_client.c b/hs20/client/spp_client.c
index 7ef70b0..cc1a0bf 100644
--- a/hs20/client/spp_client.c
+++ b/hs20/client/spp_client.c
@@ -21,6 +21,8 @@
#include "osu_client.h"
+extern const char *spp_xsd_fname;
+
static int hs20_spp_update_response(struct hs20_osu_client *ctx,
const char *session_id,
const char *spp_status,
@@ -59,7 +61,7 @@ static int hs20_spp_validate(struct hs20_osu_client *ctx, xml_node_t *node,
return -1;
}
- ret = xml_validate(xctx, node, "spp.xsd", &err);
+ ret = xml_validate(xctx, node, spp_xsd_fname, &err);
if (ret < 0) {
wpa_printf(MSG_INFO, "XML schema validation error(s)\n%s", err);
write_summary(ctx, "SPP XML schema validation failed");