Client/Server: connecting secure channel shall be considered when closing all connections
Description
Client
On client side when SOPC_ClientConfigHelper_Clear
is called all established client secure channel connected are closed.
If a new connection attempt was made just prior to call SOPC_ClientConfigHelper_Clear
, the following assertion might be triggered:
src/ClientServer/secure_channels/sopc_chunks_mgr.c:3234: SC_Chunks_EncryptMsg: Assertion
scConfig != NULL' failed.`
The service layer is responsible to trigger SE_TO_SE_SC_ALL_DISCONNECTED
event when all client secure channels are closed, the configuration is only removed after treating this even. Therefore the service layer shall check for connecting secure channels to fail or to be closed prior to trigger SE_TO_SE_SC_ALL_DISCONNECTED
.
Server (reverse connection)
On server side when SOPC_ServerHelper_StopServer
is called (mandatory prior to SOPC_ServerConfigHelper_Clear
) and some reverse connections are configured. At secure channel levels, it is possible that TIMER_SC_SERVER_REVERSE_CONN_RETRY
event is triggered during EP_CLOSE
event treatment stopping the connection retry timer. To avoid any new connection attempt INT_EP_SC_REVERSE_CONNECT
shall be inhibited when the EP listener is in CLOSED state (set by EP_CLOSE
event treatment).
Note: there is no assertion triggering identified as a consequence of this degraded behavior, the SC state should be considered closed and treatment of possible SOCKET_CONNECTION
would lead to close the socket anyway.