From ec484cabcaafa39bf1a945a9fd5fb586fb080b28 Mon Sep 17 00:00:00 2001 From: Siddharth Chandrasekaran Date: Sat, 9 Mar 2024 02:47:47 +0100 Subject: [PATCH] Fix bug in SC setup due to missing call to cp_keyset_complete When SC is setup for the first time when the PD is in install mode, the CP state machine should call cp_keyset_complete to clear the current SC session so a new one can be setup. During refactoring, this was broken and hence there was a failure during initial SC handshake. Signed-off-by: Siddharth Chandrasekaran --- src/osdp_cp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/osdp_cp.c b/src/osdp_cp.c index a986e23..facd95d 100644 --- a/src/osdp_cp.c +++ b/src/osdp_cp.c @@ -1067,6 +1067,7 @@ static enum osdp_cp_state_e get_next_ok_state(struct osdp_pd *pd) } return OSDP_CP_STATE_ONLINE; case OSDP_CP_STATE_SET_SCBK: + cp_keyset_complete(pd); return OSDP_CP_STATE_SC_CHLNG; case OSDP_CP_STATE_ONLINE: if (cp_sc_should_retry(pd)) {