network: validate passphrase on _set_passphrase

This commit is contained in:
James Prestwood 2019-09-18 09:02:58 -07:00 committed by Denis Kenzior
parent 42e083cf9b
commit 27ae3ce14d
1 changed files with 3 additions and 0 deletions

View File

@ -275,6 +275,9 @@ bool network_set_passphrase(struct network *network, const char *passphrase)
if (network_get_security(network) != SECURITY_PSK)
return false;
if (!crypto_passphrase_is_valid(passphrase))
return false;
if (!network_settings_load(network))
network->settings = l_settings_new();