mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-01 05:54:08 +01:00
wscutil: Add wsc_parse_m6_encrypted_settings
This commit is contained in:
parent
11cb6e5d35
commit
3719e78094
@ -549,6 +549,7 @@ static attr_handler handler_for_type(enum wsc_attr type)
|
||||
case WSC_ATTR_R_HASH2:
|
||||
return extract_hash;
|
||||
case WSC_ATTR_R_SNONCE1:
|
||||
case WSC_ATTR_R_SNONCE2:
|
||||
return extract_nonce;
|
||||
case WSC_ATTR_SELECTED_REGISTRAR:
|
||||
return extract_bool;
|
||||
@ -1228,6 +1229,17 @@ int wsc_parse_m6(const uint8_t *pdu, uint32_t len, struct wsc_m6 *out,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wsc_parse_m6_encrypted_settings(const uint8_t *pdu, uint32_t len,
|
||||
struct wsc_m6_encrypted_settings *out)
|
||||
{
|
||||
memset(out, 0, sizeof(*out));
|
||||
|
||||
return wsc_parse_attrs(pdu, len, NULL, NULL,
|
||||
WSC_ATTR_KEY_WRAP_AUTHENTICATOR, out->authenticator,
|
||||
REQUIRED(R_SNONCE2, out->r_snonce2),
|
||||
WSC_ATTR_INVALID);
|
||||
}
|
||||
|
||||
int wsc_parse_nack(const uint8_t *pdu, uint32_t len, struct wsc_nack *out)
|
||||
{
|
||||
int r;
|
||||
|
@ -476,6 +476,11 @@ struct wsc_m6 {
|
||||
uint8_t authenticator[8];
|
||||
};
|
||||
|
||||
struct wsc_m6_encrypted_settings {
|
||||
uint8_t r_snonce2[16];
|
||||
uint8_t authenticator[8];
|
||||
};
|
||||
|
||||
struct wsc_nack {
|
||||
bool version2;
|
||||
uint8_t enrollee_nonce[16];
|
||||
@ -503,6 +508,8 @@ int wsc_parse_m5_encrypted_settings(const uint8_t *pdu, uint32_t len,
|
||||
struct wsc_m5_encrypted_settings *out);
|
||||
int wsc_parse_m6(const uint8_t *pdu, uint32_t len, struct wsc_m6 *out,
|
||||
struct iovec *out_encrypted);
|
||||
int wsc_parse_m6_encrypted_settings(const uint8_t *pdu, uint32_t len,
|
||||
struct wsc_m6_encrypted_settings *out);
|
||||
|
||||
int wsc_parse_nack(const uint8_t *pdu, uint32_t len, struct wsc_nack *out);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user