From 397a7d18c24a127824cbaacd67c5b44af84193cc Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 29 Aug 2016 22:09:39 -0500 Subject: [PATCH] eap-wsc: Add TX message Authenticator calculation --- src/eap-wsc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/eap-wsc.c b/src/eap-wsc.c index 9f275089..62cab923 100644 --- a/src/eap-wsc.c +++ b/src/eap-wsc.c @@ -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;