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>
This commit is contained in:
parent
97c9991c5b
commit
0bb20efcd0
2 changed files with 10 additions and 2 deletions
|
@ -25,6 +25,8 @@
|
||||||
#include "crypto/sha256.h"
|
#include "crypto/sha256.h"
|
||||||
#include "osu_client.h"
|
#include "osu_client.h"
|
||||||
|
|
||||||
|
const char *spp_xsd_fname = "spp.xsd";
|
||||||
|
|
||||||
|
|
||||||
void write_result(struct hs20_osu_client *ctx, const char *fmt, ...)
|
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>] "
|
" [-w<wpa_supplicant ctrl_iface dir>] "
|
||||||
"[-r<result file>] [-f<debug file>] \\\n"
|
"[-r<result file>] [-f<debug file>] \\\n"
|
||||||
" [-s<summary file>] \\\n"
|
" [-s<summary file>] \\\n"
|
||||||
|
" [-x<spp.xsd file name>] \\\n"
|
||||||
" <command> [arguments..]\n"
|
" <command> [arguments..]\n"
|
||||||
"commands:\n"
|
"commands:\n"
|
||||||
"- to_tnds <XML MO> <XML MO in TNDS format> [URN]\n"
|
"- to_tnds <XML MO> <XML MO in TNDS format> [URN]\n"
|
||||||
|
@ -3025,7 +3028,7 @@ int main(int argc, char *argv[])
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
for (;;) {
|
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)
|
if (c < 0)
|
||||||
break;
|
break;
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
@ -3063,6 +3066,9 @@ int main(int argc, char *argv[])
|
||||||
case 'w':
|
case 'w':
|
||||||
wpas_ctrl_path = optarg;
|
wpas_ctrl_path = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'x':
|
||||||
|
spp_xsd_fname = optarg;
|
||||||
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
#include "osu_client.h"
|
#include "osu_client.h"
|
||||||
|
|
||||||
|
|
||||||
|
extern const char *spp_xsd_fname;
|
||||||
|
|
||||||
static int hs20_spp_update_response(struct hs20_osu_client *ctx,
|
static int hs20_spp_update_response(struct hs20_osu_client *ctx,
|
||||||
const char *session_id,
|
const char *session_id,
|
||||||
const char *spp_status,
|
const char *spp_status,
|
||||||
|
@ -59,7 +61,7 @@ static int hs20_spp_validate(struct hs20_osu_client *ctx, xml_node_t *node,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = xml_validate(xctx, node, "spp.xsd", &err);
|
ret = xml_validate(xctx, node, spp_xsd_fname, &err);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
wpa_printf(MSG_INFO, "XML schema validation error(s)\n%s", err);
|
wpa_printf(MSG_INFO, "XML schema validation error(s)\n%s", err);
|
||||||
write_summary(ctx, "SPP XML schema validation failed");
|
write_summary(ctx, "SPP XML schema validation failed");
|
||||||
|
|
Loading…
Reference in a new issue