eap-wsc: Add TX message Authenticator calculation

This commit is contained in:
Denis Kenzior 2016-08-29 22:09:39 -05:00
parent 5951bc220b
commit 397a7d18c2
1 changed files with 16 additions and 0 deletions

View File

@ -102,6 +102,22 @@ static inline bool authenticator_check(struct eap_wsc_state *wsc,
return true;
}
static inline void authenticator_put(struct eap_wsc_state *wsc,
const uint8_t *prev_msg,
size_t prev_msg_len,
uint8_t *cur_msg, size_t cur_msg_len)
{
struct iovec iov[2];
iov[0].iov_base = (void *) prev_msg;
iov[0].iov_len = prev_msg_len;
iov[1].iov_base = cur_msg;
iov[1].iov_len = cur_msg_len - 12;
l_checksum_updatev(wsc->hmac_auth_key, iov, 2);
l_checksum_get_digest(wsc->hmac_auth_key, cur_msg + cur_msg_len - 8, 8);
}
static int eap_wsc_probe(struct eap_state *eap, const char *name)
{
struct eap_wsc_state *wsc;