HS 2.0: Do not require devinfo.xml for all hs20-osu-client operations

hs20-osu-client refused to do anything if it could not find devinfo.xml
from the current working directory. This is a bit excessive since that
file was used in init_ctx() only to fill in ctx->devid which is used
when constructing OMA DM messages.

Move the check for ctx->devid into OMA DM specific code so that other
hs20-osu-client functionality can be used without the devinfo.xml file.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2018-10-30 15:29:12 +02:00 committed by Jouni Malinen
parent 21895884ea
commit 1695b4dc37
2 changed files with 15 additions and 16 deletions

View file

@ -111,6 +111,12 @@ static xml_node_t * oma_dm_build_hdr(struct hs20_osu_client *ctx,
xml_node_t *syncml, *synchdr;
xml_namespace_t *ns;
if (!ctx->devid) {
wpa_printf(MSG_ERROR,
"DevId from devinfo.xml is not available - cannot use OMA DM");
return NULL;
}
syncml = xml_node_create_root(ctx->xml, "SYNCML:SYNCML1.2", NULL, &ns,
"SyncML");