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_m5_encrypted_settings

This commit is contained in:
Denis Kenzior 2016-08-30 14:10:20 -05:00
parent 7bdb1a0225
commit 24dfe6e436
2 changed files with 23 additions and 0 deletions

View File

@ -1469,6 +1469,13 @@ static void build_e_hash2(struct wsc_attr_builder *builder,
wsc_attr_builder_put_bytes(builder, e_hash2, 32);
}
static void build_e_snonce1(struct wsc_attr_builder *builder,
const uint8_t *nonce)
{
wsc_attr_builder_start_attr(builder, WSC_ATTR_E_SNONCE1);
wsc_attr_builder_put_bytes(builder, nonce, 16);
}
static void build_enrollee_nonce(struct wsc_attr_builder *builder,
const uint8_t *nonce)
{
@ -1838,6 +1845,19 @@ done:
return ret;
}
uint8_t *wsc_build_m5_encrypted_settings(
const struct wsc_m5_encrypted_settings *in,
size_t *out_len)
{
struct wsc_attr_builder *builder;
builder = wsc_attr_builder_new(256);
build_e_snonce1(builder, in->e_snonce1);
build_key_wrap_authenticator(builder, in->authenticator);
return wsc_attr_builder_free(builder, false, out_len);
}
uint8_t *wsc_build_nack(const struct wsc_nack *nack, size_t *out_len)
{
struct wsc_attr_builder *builder;

View File

@ -510,6 +510,9 @@ uint8_t *wsc_build_m4_encrypted_settings(
size_t *out_len);
uint8_t *wsc_build_m5(const struct wsc_m5 *m5, const uint8_t *encrypted,
size_t encrypted_len, size_t *out_len);
uint8_t *wsc_build_m5_encrypted_settings(
const struct wsc_m5_encrypted_settings *in,
size_t *out_len);
uint8_t *wsc_build_nack(const struct wsc_nack *nack, size_t *out_len);