network: fix issue with WSC not connecting

After wsc_store_credentials, wsc_try_credentials is called which
sets the PSK obtained via the protocol. After the known network
refactor network_settings_load was changed to depend on the
network_info->open() call. Since there is no known network for
this initial WSC connection this always fails and the PSK is not
set into the network object (and the connection is failed).

In this case if network_settings_load fails we can just create
an empty settings object to be filled later.
This commit is contained in:
James Prestwood 2019-08-28 11:02:21 -07:00 committed by Denis Kenzior
parent 7fa5eddfbc
commit 8500b60b13
1 changed files with 1 additions and 1 deletions

View File

@ -267,7 +267,7 @@ bool network_set_psk(struct network *network, const uint8_t *psk)
return false;
if (!network_settings_load(network))
return false;
network->settings = l_settings_new();
network_reset_psk(network);
network->psk = l_memdup(psk, 32);