3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-26 10:39:23 +01:00

wscutil: Add wsc_build_m6

This commit is contained in:
Denis Kenzior 2016-08-31 11:01:45 -05:00
parent 815f685c2d
commit 4e0c932dc9
2 changed files with 28 additions and 0 deletions

View File

@ -1885,6 +1885,32 @@ uint8_t *wsc_build_m5_encrypted_settings(
return wsc_attr_builder_free(builder, false, out_len);
}
uint8_t *wsc_build_m6(const struct wsc_m6 *m6, const uint8_t *encrypted,
size_t encrypted_len, 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_M6);
build_enrollee_nonce(builder, m6->enrollee_nonce);
wsc_attr_builder_start_attr(builder, WSC_ATTR_ENCRYPTED_SETTINGS);
wsc_attr_builder_put_bytes(builder, encrypted, encrypted_len);
if (!m6->version2)
goto done;
START_WFA_VENDOR_EXTENSION();
done:
build_authenticator(builder, m6->authenticator);
ret = wsc_attr_builder_free(builder, false, out_len);
return ret;
}
uint8_t *wsc_build_nack(const struct wsc_nack *nack, size_t *out_len)
{
struct wsc_attr_builder *builder;

View File

@ -521,6 +521,8 @@ uint8_t *wsc_build_m5(const struct wsc_m5 *m5, const uint8_t *encrypted,
uint8_t *wsc_build_m5_encrypted_settings(
const struct wsc_m5_encrypted_settings *in,
size_t *out_len);
uint8_t *wsc_build_m6(const struct wsc_m6 *m6, const uint8_t *encrypted,
size_t encrypted_len, size_t *out_len);
uint8_t *wsc_build_nack(const struct wsc_nack *nack, size_t *out_len);