Skip to content

Commit

Permalink
libosdp: Fix issue with SC retry timer
Browse files Browse the repository at this point in the history
When SC fails, we missed updating the sc_tstamp which resulted in CP
retrying SC back to back causing CP to do nothing but bouncing between
online and sc-init sates.

Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Mar 9, 2024
1 parent 4396c74 commit bdc35db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/osdp_cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,11 @@ static enum osdp_cp_state_e get_next_err_state(struct osdp_pd *pd)
return OSDP_CP_STATE_SC_CHLNG;
}
CLEAR_FLAG(pd, PD_FLAG_SC_USE_SCBKD);
/**
* SC setup failed; Update sc_tstamp so the next retry happens
* after OSDP_PD_SC_RETRY_MS.
*/
pd->sc_tstamp = osdp_millis_now();
return OSDP_CP_STATE_ONLINE;
case OSDP_CP_STATE_SC_SCRYPT:
if (is_enforce_secure(pd)) {
Expand Down

0 comments on commit bdc35db

Please sign in to comment.