]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mka: Remember LowestPN for each key server
authorAndrey Kartashev <andrey.kartashev@afconsult.com>
Fri, 2 Nov 2018 18:02:17 +0000 (19:02 +0100)
committerJouni Malinen <j@w1.fi>
Wed, 26 Dec 2018 14:42:25 +0000 (16:42 +0200)
According IEEE Std 802.1X-2010, 9.8 each participant shall record the
values of NextPN for last SAK accepted from each Key Server to use it in
case of a switch from one Key Server to another and back. Add LPN
recording and set saved value as the initial PN for the created channel.

Signed-off-by: Andrey Kartashev <andrey.kartashev@afconsult.com>
src/pae/ieee802_1x_kay.c

index dc9a47f3ec4377bd26babd9787381679d01a002f..0e7f0f31ac6ec94d698c6d6a3b7067056b0086fc 100644 (file)
@@ -1435,6 +1435,8 @@ ieee802_1x_mka_decode_sak_use_body(
                }
        }
 
+       if (sa_key)
+               sa_key->next_pn = lpn;
        found = FALSE;
        dl_list_for_each(rxsc, &participant->rxsc_list, struct receive_sc,
                         list) {
@@ -1568,6 +1570,7 @@ static void ieee802_1x_kay_init_data_key(struct data_key *pkey)
        pkey->receives = TRUE;
        os_get_time(&pkey->created_time);
 
+       pkey->next_pn = 1;
        pkey->user = 1;
 }
 
@@ -2784,7 +2787,9 @@ int ieee802_1x_kay_create_sas(struct ieee802_1x_kay *kay,
                ieee802_1x_delete_transmit_sa(kay, txsa);
 
        txsa = ieee802_1x_kay_init_transmit_sa(principal->txsc, latest_sak->an,
-                                              1, latest_sak);
+                                              latest_sak->next_pn ?
+                                              latest_sak->next_pn : 1,
+                                              latest_sak);
        if (!txsa)
                return -1;