eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit a95cd4f0faec4c66d97d7eb694a9bbc3c2615213
parent 930df7a2b952455c505da28f820c7acf5170d31c
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date:   Thu, 13 Aug 2020 02:50:11 +0200

wscutil: Handle a deprecated network key format

Implement a note from the spec saying that implementations should handle
NUL-terminated Network Keys inside credentials structures.

Diffstat:
Msrc/wscutil.c | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/wscutil.c b/src/wscutil.c @@ -362,13 +362,25 @@ static bool extract_network_key(struct wsc_attr_iter *iter, void *data) { struct iovec *network_key = data; unsigned int len; + const uint8_t *key; len = wsc_attr_iter_get_length(iter); if (len > 64) return false; + /* + * WSC 2.0.5, Section 12, Network Key: + * "Some existing implementations based on v1.0h null-terminate the + * passphrase value, i.e., add an extra 0x00 octet into the end of + * the value. For backwards compatibility, implementations shall be + * able to parse such a value" + */ + key = wsc_attr_iter_get_data(iter); + if (len && key[len - 1] == 0x00) + len--; + network_key->iov_len = len; - network_key->iov_base = (void *) wsc_attr_iter_get_data(iter); + network_key->iov_base = (void *) key; return true; }