From 06e06a8df79849326f0c07c6a66cce737b44b4b5 Mon Sep 17 00:00:00 2001 From: Mike Siedzik Date: Tue, 20 Feb 2018 14:28:41 -0500 Subject: [PATCH] mka: Fix RETIRE state deletion of SAs Per IEEE Std 802.1X-2010, Figure 12-2 (CP state machine), deleteSAs(oki) is used upon entering RETIRE. Do that in addition to freeing sm->oki. Signed-off-by: Michael Siedzik --- src/pae/ieee802_1x_cp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pae/ieee802_1x_cp.c b/src/pae/ieee802_1x_cp.c index 360fcd3f5..41ca3f0f5 100644 --- a/src/pae/ieee802_1x_cp.c +++ b/src/pae/ieee802_1x_cp.c @@ -320,8 +320,11 @@ SM_STATE(CP, RETIRE) SM_ENTRY(CP, RETIRE); /* RETIRE state machine not keep with Figure 12-2 in * IEEE Std 802.1X-2010 */ - os_free(sm->oki); - sm->oki = NULL; + if (sm->oki) { + ieee802_1x_kay_delete_sas(sm->kay, sm->oki); + os_free(sm->oki); + sm->oki = NULL; + } sm->orx = FALSE; sm->otx = FALSE; ieee802_1x_kay_set_old_sa_attr(sm->kay, sm->oki, sm->oan,