libosdp icon indicating copy to clipboard operation
libosdp copied to clipboard

v3.0.6 is restarting SC twice after KEYSET

Open sebastianedse opened this issue 1 year ago • 1 comments

Describe the bug When a new PD is connected, the SCBK-D will be used and KEYSET command will write the new SCBK to the device. After this has been done the stack restarts with SC_CHLNG twice.

Expected behavior I expect it to only restart once.

Additional context I assume this has to do with the CP_REQ_RESTART_SC request in cp_keyset_complete(). Is it maybe a leftover from last state machine? And a side note: the function cp_keyset_complete() is called twice in the new state machine (this is not causing this bug, but), is this really intended? It seems that it prints two LOG_INF and deactivates sc twice...

sebastianedse avatar Aug 20 '24 10:08 sebastianedse

Hi @sebastianedse,

Sorry about the long wait. I tried reproducing this issue and failed. Can you please post some logs when you encounter this issue? Also, is there any other additional steps I need to perform to hit this problem?

the function cp_keyset_complete() is called twice in the new state machine

There are two ways to reach the keyset path:

  1. during CP setup time when we detect that PD is in install_mode: get_next_ok_state() -> cp_keyset_complete()
  2. when the application wants to set a new key from a secure channel: cp_check_online_response() -> cp_keyset_complete()

So I believe both calls are still relevant.

sidcha avatar Oct 17 '24 16:10 sidcha

Closing as not reproducible. If you have more details, feel free to re-open this issue.

sidcha avatar Oct 31 '24 00:10 sidcha