aboutsummaryrefslogtreecommitdiffstats
path: root/src/pae/ieee802_1x_key.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2018-12-26 14:18:00 (GMT)
committerJouni Malinen <j@w1.fi>2018-12-26 14:44:58 (GMT)
commitb452a76e540b0ef6ecf053941851c079c036bb20 (patch)
tree3e9d03bf12edc38b1226f74fc7e51c1f7352254f /src/pae/ieee802_1x_key.c
parent7c3d1cc040d60cab56fb7558b359454ab6cb8744 (diff)
downloadhostap-b452a76e540b0ef6ecf053941851c079c036bb20.zip
hostap-b452a76e540b0ef6ecf053941851c079c036bb20.tar.gz
hostap-b452a76e540b0ef6ecf053941851c079c036bb20.tar.bz2
mka: ICV calculation using 256-bit ICK
Add support for using AES-CMAC with 256-bit key (ICK) to calculate ICV. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/pae/ieee802_1x_key.c')
-rw-r--r--src/pae/ieee802_1x_key.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/pae/ieee802_1x_key.c b/src/pae/ieee802_1x_key.c
index fe27e2c..4fafba8 100644
--- a/src/pae/ieee802_1x_key.c
+++ b/src/pae/ieee802_1x_key.c
@@ -172,16 +172,25 @@ int ieee802_1x_ick_aes_cmac(const u8 *cak, size_t cak_bytes, const u8 *ckn,
/**
- * ieee802_1x_icv_128bits_aes_cmac
+ * ieee802_1x_icv_aes_cmac
*
* IEEE Std 802.1X-2010, 9.4.1
* ICV = AES-CMAC(ICK, M, 128)
*/
-int ieee802_1x_icv_128bits_aes_cmac(const u8 *ick, const u8 *msg,
- size_t msg_bytes, u8 *icv)
+int ieee802_1x_icv_aes_cmac(const u8 *ick, size_t ick_bytes, const u8 *msg,
+ size_t msg_bytes, u8 *icv)
{
- if (omac1_aes_128(ick, msg, msg_bytes, icv)) {
- wpa_printf(MSG_ERROR, "MKA: omac1_aes_128 failed");
+ int res;
+
+ if (ick_bytes == 16)
+ res = omac1_aes_128(ick, msg, msg_bytes, icv);
+ else if (ick_bytes == 32)
+ res = omac1_aes_256(ick, msg, msg_bytes, icv);
+ else
+ return -1;
+ if (res) {
+ wpa_printf(MSG_ERROR,
+ "MKA: AES-CMAC failed for ICV calculation");
return -1;
}
return 0;