]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mka: Allow CAK length 32 (256-bit) to be initialized
authorJouni Malinen <j@w1.fi>
Wed, 26 Dec 2018 14:28:27 +0000 (16:28 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 26 Dec 2018 14:44:58 +0000 (16:44 +0200)
The CAK length is not hardcoded in the algorithm agility parameter, so
remove that from the table. Instead, allow both 16 (128-bit) and 32
(256-bit) CAK to be used so that the following key derivations use
appropriate key lengths based on the configured/derived CAK.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/pae/ieee802_1x_kay.c
src/pae/ieee802_1x_kay_i.h

index a0209f15afd86b8a2782c114b6dfc657e9465395..3127bf63cf8d13efc76185e28a7958a64db464a5 100644 (file)
@@ -64,7 +64,6 @@ static struct mka_alg mka_alg_tbl[] = {
        {
                .parameter = MKA_ALGO_AGILITY_2009,
 
-               .cak_len = DEFAULT_ICV_LEN,
                .icv_len = DEFAULT_ICV_LEN,
 
                .cak_trfm = ieee802_1x_cak_128bits_aes_cmac,
@@ -3437,8 +3436,9 @@ ieee802_1x_kay_create_mka(struct ieee802_1x_kay *kay,
                return NULL;
        }
 
-       if (cak->len != mka_alg_tbl[kay->mka_algindex].cak_len) {
-               wpa_printf(MSG_ERROR, "KaY: CAK length not follow key schema");
+       if (cak->len != 16 && cak->len != 32) {
+               wpa_printf(MSG_ERROR, "KaY: Unexpected CAK length %u",
+                          (unsigned int) cak->len);
                return NULL;
        }
        if (ckn->len > MAX_CKN_LEN) {
index 6650a1a6ca2b128061d941cb2ae084bec754cbf2..9799f6251d1eaa2c5abd09e58785849cbce1eb56 100644 (file)
@@ -66,7 +66,6 @@ struct macsec_ciphersuite {
 
 struct mka_alg {
        u8 parameter[4];
-       size_t cak_len;
        size_t icv_len;
 
        int (*cak_trfm)(const u8 *msk, const u8 *mac1, const u8 *mac2, u8 *cak);