mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
wscutil: Add wsc_parse_wsc_done
This commit is contained in:
parent
1b1bf3cf65
commit
d8b8c25848
@ -1505,6 +1505,31 @@ int wsc_parse_nack(const uint8_t *pdu, uint32_t len, struct wsc_nack *out)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wsc_parse_wsc_done(const uint8_t *pdu, uint32_t len, struct wsc_done *out)
|
||||||
|
{
|
||||||
|
int r;
|
||||||
|
struct wsc_wfa_ext_iter iter;
|
||||||
|
uint8_t version;
|
||||||
|
enum wsc_message_type msg_type;
|
||||||
|
|
||||||
|
memset(out, 0, sizeof(struct wsc_done));
|
||||||
|
|
||||||
|
r = wsc_parse_attrs(pdu, len, &out->version2, &iter, 0, NULL,
|
||||||
|
REQUIRED(VERSION, &version),
|
||||||
|
REQUIRED(MESSAGE_TYPE, &msg_type),
|
||||||
|
REQUIRED(ENROLLEE_NONCE, &out->enrollee_nonce),
|
||||||
|
REQUIRED(REGISTRAR_NONCE, &out->registrar_nonce),
|
||||||
|
WSC_ATTR_INVALID);
|
||||||
|
|
||||||
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
|
||||||
|
if (msg_type != WSC_MESSAGE_TYPE_WSC_DONE)
|
||||||
|
return -EBADMSG;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
struct wsc_attr_builder {
|
struct wsc_attr_builder {
|
||||||
size_t capacity;
|
size_t capacity;
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
|
@ -522,6 +522,12 @@ struct wsc_nack {
|
|||||||
enum wsc_configuration_error configuration_error;
|
enum wsc_configuration_error configuration_error;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct wsc_done {
|
||||||
|
bool version2;
|
||||||
|
uint8_t enrollee_nonce[16];
|
||||||
|
uint8_t registrar_nonce[16];
|
||||||
|
};
|
||||||
|
|
||||||
int wsc_parse_credential(const uint8_t *pdu, uint32_t len,
|
int wsc_parse_credential(const uint8_t *pdu, uint32_t len,
|
||||||
struct wsc_credential *out);
|
struct wsc_credential *out);
|
||||||
|
|
||||||
@ -559,6 +565,8 @@ int wsc_parse_m8_encrypted_settings(const uint8_t *pdu, uint32_t len,
|
|||||||
|
|
||||||
int wsc_parse_nack(const uint8_t *pdu, uint32_t len, struct wsc_nack *out);
|
int wsc_parse_nack(const uint8_t *pdu, uint32_t len, struct wsc_nack *out);
|
||||||
|
|
||||||
|
int wsc_parse_wsc_done(const uint8_t *pdu, uint32_t len, struct wsc_done *out);
|
||||||
|
|
||||||
uint8_t *wsc_build_probe_request(const struct wsc_probe_request *probe_request,
|
uint8_t *wsc_build_probe_request(const struct wsc_probe_request *probe_request,
|
||||||
size_t *out_len);
|
size_t *out_len);
|
||||||
uint8_t *wsc_build_m1(const struct wsc_m1 *m1, size_t *out_len);
|
uint8_t *wsc_build_m1(const struct wsc_m1 *m1, size_t *out_len);
|
||||||
|
Loading…
Reference in New Issue
Block a user