3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-23 06:02:37 +01:00

wscutil: Add wsc_build_wsc_done

This commit is contained in:
Denis Kenzior 2016-09-08 21:27:44 -05:00
parent d8b8c25848
commit aa518811b3
2 changed files with 23 additions and 0 deletions

View File

@ -2301,6 +2301,27 @@ done:
return ret; return ret;
} }
uint8_t *wsc_build_wsc_done(const struct wsc_done *done, size_t *out_len)
{
struct wsc_attr_builder *builder;
uint8_t *ret;
builder = wsc_attr_builder_new(256);
build_version(builder, 0x10);
build_message_type(builder, WSC_MESSAGE_TYPE_WSC_DONE);
build_enrollee_nonce(builder, done->enrollee_nonce);
build_registrar_nonce(builder, done->registrar_nonce);
if (!done->version2)
goto done;
START_WFA_VENDOR_EXTENSION();
done:
ret = wsc_attr_builder_free(builder, false, out_len);
return ret;
}
bool wsc_uuid_from_addr(const uint8_t addr[], uint8_t *out_uuid) bool wsc_uuid_from_addr(const uint8_t addr[], uint8_t *out_uuid)
{ {
/* Reuse the NSID from WPA Supplicant for compatibility */ /* Reuse the NSID from WPA Supplicant for compatibility */

View File

@ -597,6 +597,8 @@ uint8_t *wsc_build_m8(const struct wsc_m8 *m8, const uint8_t *encrypted,
uint8_t *wsc_build_nack(const struct wsc_nack *nack, size_t *out_len); uint8_t *wsc_build_nack(const struct wsc_nack *nack, size_t *out_len);
uint8_t *wsc_build_wsc_done(const struct wsc_done *done, size_t *out_len);
bool wsc_uuid_from_addr(const uint8_t addr[], uint8_t *out_uuid); bool wsc_uuid_from_addr(const uint8_t addr[], uint8_t *out_uuid);
struct wsc_session_key { struct wsc_session_key {