From 2207f51cbdd3962b1e94fb8432edfc2e294fd9c7 Mon Sep 17 00:00:00 2001 From: Vernon Mauery Date: Thu, 30 Nov 2017 10:48:08 -0800 Subject: Truncate Integrity Check Value to the correct length According to the RMCP+ spec: RAKP-HMAC-SHA1 specifies the use of RAKP messages for the key exchange portion of establishing the session, and that HMAC-SHA1 (per [RFC2104]) is used to create 20-byte Key Exchange Authentication Code fields in RAKP Message 2 and RAKP Message 3. HMAC-SHA1-96 (per [RFC2404]) is used for generating a 12-byte Integrity Check Value field for RAKP Message 4. Change-Id: Ic85b79a748ceb4083b613a0df1c253d8099a6c22 Signed-off-by: Vernon Mauery --- auth_algo.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'auth_algo.cpp') diff --git a/auth_algo.cpp b/auth_algo.cpp index d2acebf..b71636b 100644 --- a/auth_algo.cpp +++ b/auth_algo.cpp @@ -37,6 +37,7 @@ std::vector AlgoSHA1::generateICV(std::vector& input) const std::cerr << "Generate Session Integrity Key failed\n"; output.resize(0); } + output.resize(integrityCheckValueLength); return output; } -- cgit v1.2.1