20#ifndef SOPC_SECURE_CHANNELS_INTERNAL_CTX_H_
21#define SOPC_SECURE_CHANNELS_INTERNAL_CTX_H_
int64_t SOPC_DateTime
OPC UA timestamp format which is 100 nanoseconds from 1601/01/01 00:00:00 UTC.
Definition sopc_builtintypes.h:160
Defines the common declarations for the cryptographic objects. The structures and macros defined in t...
struct _SOPC_EventHandler SOPC_EventHandler
Processes messages from a queue.
Definition sopc_event_handler.h:35
void SOPC_SetListenerFunc(SOPC_EventHandler *handler)
Function prototype for connecting an event emitter to a listener.
Definition sopc_event_handler.h:59
struct _SOPC_Looper SOPC_Looper
Manages the processing of events on a given thread.
Definition sopc_event_handler.h:43
SecretBuffer (mangled key) and ExposedBuffer (contiguous deciphered buffered) APIs.
struct SOPC_SecretBuffer SOPC_SecretBuffer
Definition sopc_secret_buffer.h:35
void SOPC_SecureChannels_OnTimerEvent(SOPC_EventHandler *handler, int32_t event, uint32_t id, uintptr_t params, uintptr_t auxParam)
void SC_ApplyToAllSCs(SC_ApplyToConnection *applyToConnection, uintptr_t param, uintptr_t auxParam)
void SOPC_SecureChannelsInternalContext_Initialize(SOPC_SetListenerFunc *setSocketsListener)
Initialize the array of secure listeners/connections.
bool SOPC_ScInternalContext_AddIntermediateInputChunk(SOPC_SecureConnection_TcpProperties *tcpProperties, SOPC_SecureConnection_ChunkMgrCtx *chunkCtx, SOPC_Buffer *intermediateChunk)
Add an intermediate chunk received into message chunks.
uint32_t lastSecureConnectionArrayIdx
struct SOPC_SecureConnection_TcpProperties SOPC_SecureConnection_TcpProperties
void SOPC_SecureChannels_OnInputEvent(SOPC_EventHandler *handler, int32_t event, uint32_t id, uintptr_t params, uintptr_t auxParam)
void SOPC_SecureChannels_OnSocketsEvent(SOPC_EventHandler *handler, int32_t event, uint32_t id, uintptr_t params, uintptr_t auxParam)
struct SOPC_SecureConnection_ChunkMgrCtx SOPC_SecureConnection_ChunkMgrCtx
SOPC_EventHandler * secureChannelsInternalEventHandler
uint32_t SOPC_ScInternalContext_GetNbIntermediateInputChunks(SOPC_SecureConnection_ChunkMgrCtx *chunkCtx)
Retrieve the number of intermediate chunks already received.
SOPC_EventHandler * secureChannelsEventHandler
void SOPC_ScInternalContext_ClearIntermediateInputChunks(SOPC_SecureConnection_ChunkMgrCtx *chunkCtx)
Clear the list of intermediate chunks received (should be called directly only in case of abort chunk...
SOPC_EventHandler * secureChannelsTimerEventHandler
SOPC_EventHandler * secureChannelsInputEventHandler
SOPC_SecureListener secureListenersArray[SOPC_MAX_ENDPOINT_DESCRIPTION_CONFIGURATIONS *2+1]
Array containing all listeners that can be used for server endpoints and client reverse endpoints.
SOPC_SecureConnection secureConnectionsArray[SOPC_MAX_SECURE_CONNECTIONS_PLUS_BUFFERED+1]
Array containing all connections that can be used.
void SOPC_SecureChannelsInternalContext_Clear(void)
Clear the array of secure listeners/connections.
struct SOPC_SecureConnection_TcpOpnReqAsymmSecu SOPC_SecureConnection_TcpAsymmSecu
void SOPC_ScInternalContext_ClearInputChunksContext(SOPC_SecureConnection_ChunkMgrCtx *chunkCtx)
Clear the current chunk and intermediate chunks context.
SOPC_Msg_IsFinal
UA Message Chunk IsFinal type.
Definition sopc_secure_channels_internal_ctx.h:91
@ SOPC_MSG_ISFINAL_FINAL
Definition sopc_secure_channels_internal_ctx.h:94
@ SOPC_MSG_ISFINAL_INTERMEDIATE
Definition sopc_secure_channels_internal_ctx.h:93
@ SOPC_MSG_ISFINAL_ABORT
Definition sopc_secure_channels_internal_ctx.h:95
@ SOPC_MSG_ISFINAL_INVALID
Definition sopc_secure_channels_internal_ctx.h:92
struct SOPC_SecureConnection_TcpSequenceProperties SOPC_SecureConnection_TcpSequenceProperties
const SOPC_CertificateList * SC_OwnCertificate(SOPC_SecureConnection *conn)
SOPC_SecureConnection_State
Definition sopc_secure_channels_internal_ctx.h:46
@ SECURE_CONNECTION_STATE_SC_CONNECTED_RENEW
Definition sopc_secure_channels_internal_ctx.h:57
@ SECURE_CONNECTION_STATE_TCP_INIT
Definition sopc_secure_channels_internal_ctx.h:52
@ SECURE_CONNECTION_STATE_SC_CONNECTED
Definition sopc_secure_channels_internal_ctx.h:56
@ SECURE_CONNECTION_STATE_TCP_REVERSE_TOKEN
Definition sopc_secure_channels_internal_ctx.h:49
@ SECURE_CONNECTION_STATE_TCP_REVERSE_INIT
Definition sopc_secure_channels_internal_ctx.h:51
@ SECURE_CONNECTION_STATE_SC_CONNECTING
Definition sopc_secure_channels_internal_ctx.h:55
@ SECURE_CONNECTION_STATE_SC_INIT
Definition sopc_secure_channels_internal_ctx.h:54
@ SECURE_CONNECTION_STATE_TCP_NEGOTIATE
Definition sopc_secure_channels_internal_ctx.h:53
@ SECURE_CONNECTION_STATE_SC_CLOSED
Definition sopc_secure_channels_internal_ctx.h:47
@ SECURE_CONNECTION_STATE_SC_CLOSING
Definition sopc_secure_channels_internal_ctx.h:48
SOPC_SecureListener_State
Definition sopc_secure_channels_internal_ctx.h:37
@ SECURE_LISTENER_STATE_INACTIVE
Definition sopc_secure_channels_internal_ctx.h:41
@ SECURE_LISTENER_STATE_OPENED
Definition sopc_secure_channels_internal_ctx.h:40
@ SECURE_LISTENER_STATE_CLOSED
Definition sopc_secure_channels_internal_ctx.h:38
@ SECURE_LISTENER_STATE_OPENING
Definition sopc_secure_channels_internal_ctx.h:39
SOPC_Msg_Type
TCP UA Message types.
Definition sopc_secure_channels_internal_ctx.h:64
@ SOPC_MSG_TYPE_ERR
Definition sopc_secure_channels_internal_ctx.h:68
@ SOPC_MSG_TYPE_SC_OPN
Definition sopc_secure_channels_internal_ctx.h:70
@ SOPC_MSG_TYPE_INVALID
Definition sopc_secure_channels_internal_ctx.h:65
@ SOPC_MSG_TYPE_SC_CLO
Definition sopc_secure_channels_internal_ctx.h:71
@ SOPC_MSG_TYPE_HEL
Definition sopc_secure_channels_internal_ctx.h:66
@ SOPC_MSG_TYPE_RHE
Definition sopc_secure_channels_internal_ctx.h:69
@ SOPC_MSG_TYPE_SC_MSG
Definition sopc_secure_channels_internal_ctx.h:72
@ SOPC_MSG_TYPE_ACK
Definition sopc_secure_channels_internal_ctx.h:67
void SOPC_ScInternalContext_ClearCurrentInputChunkContext(SOPC_SecureConnection_ChunkMgrCtx *chunkCtx)
Clear the current chunk context but not the intermediate chunks context.
void SC_ApplyToConnection(SOPC_SecureConnection *conn, uint32_t connIdx, uintptr_t param, uintptr_t auxParam)
Definition sopc_secure_channels_internal_ctx.h:253
SOPC_SecureConnection * SC_GetConnection(uint32_t connectionIdx)
void SOPC_SecureChannels_OnInternalEvent(SOPC_EventHandler *handler, int32_t event, uint32_t id, uintptr_t params, uintptr_t auxParam)
struct SOPC_SecureListener SOPC_SecureListener
SOPC_Looper * secureChannelsLooper
struct SOPC_SecureConnection SOPC_SecureConnection
const SOPC_CertificateList * SC_PeerCertificate(SOPC_SecureConnection *conn)
struct SOPC_SecureConnection_SecurityToken SOPC_SecureConnection_SecurityToken
A singly linked list based on elements with unique identifiers and dynamically allocated.
struct SOPC_SLinkedList SOPC_SLinkedList
Singly linked list structure.
Definition sopc_singly_linked_list.h:36
A platform independent API to handle time reference management.
uint64_t SOPC_TimeReference
Definition sopc_time_reference.h:52
The asymmetric key representation.
Definition key_manager_cyclone.h:42
Bytes buffer structure.
Definition sopc_buffer.h:38
The signed public key representation.
Definition key_manager_cyclone.h:60
The SOPC_CryptoProvider context.
Definition sopc_crypto_provider.h:43
Definition sopc_key_sets.h:33
Definition sopc_secure_channels_internal_ctx.h:100
uint32_t currentMsgSize
Definition sopc_secure_channels_internal_ctx.h:102
bool hasCurrentMsgRequestId
Definition sopc_secure_channels_internal_ctx.h:106
SOPC_Msg_Type currentMsgType
Definition sopc_secure_channels_internal_ctx.h:103
SOPC_Buffer * currentChunkInputBuffer
Definition sopc_secure_channels_internal_ctx.h:101
SOPC_Buffer * currentMessageInputBuffer
Definition sopc_secure_channels_internal_ctx.h:109
uint32_t currentMsgRequestId
Definition sopc_secure_channels_internal_ctx.h:107
SOPC_Msg_IsFinal currentMsgIsFinal
Definition sopc_secure_channels_internal_ctx.h:104
SOPC_SLinkedList * intermediateChunksInputBuffers
Definition sopc_secure_channels_internal_ctx.h:105
Definition sopc_secure_channels_internal_ctx.h:146
uint32_t tokenId
Definition sopc_secure_channels_internal_ctx.h:148
uint32_t revisedLifetime
Definition sopc_secure_channels_internal_ctx.h:151
SOPC_TimeReference lifetimeEndTimeRef
Definition sopc_secure_channels_internal_ctx.h:150
SOPC_DateTime createdAt
Definition sopc_secure_channels_internal_ctx.h:149
uint32_t secureChannelId
Definition sopc_secure_channels_internal_ctx.h:147
Definition sopc_secure_channels_internal_ctx.h:129
const char * securityPolicyUri
Definition sopc_secure_channels_internal_ctx.h:130
uint16_t validSecurityModes
Definition sopc_secure_channels_internal_ctx.h:131
SOPC_CertificateList * clientCertificate
Definition sopc_secure_channels_internal_ctx.h:134
bool isSecureModeActive
Definition sopc_secure_channels_internal_ctx.h:132
Definition sopc_secure_channels_internal_ctx.h:115
uint32_t sendMaxChunkCount
Definition sopc_secure_channels_internal_ctx.h:123
uint32_t protocolVersion
Definition sopc_secure_channels_internal_ctx.h:116
uint32_t receiveMaxChunkCount
Definition sopc_secure_channels_internal_ctx.h:122
uint32_t receiveMaxMessageSize
Definition sopc_secure_channels_internal_ctx.h:120
uint32_t receiveBufferSize
Definition sopc_secure_channels_internal_ctx.h:117
uint32_t sendMaxMessageSize
Definition sopc_secure_channels_internal_ctx.h:121
uint32_t sendBufferSize
Definition sopc_secure_channels_internal_ctx.h:118
Definition sopc_secure_channels_internal_ctx.h:139
SOPC_SLinkedList * sentRequestIds
Definition sopc_secure_channels_internal_ctx.h:142
uint32_t lastSNreceived
Definition sopc_secure_channels_internal_ctx.h:141
uint32_t lastSNsent
Definition sopc_secure_channels_internal_ctx.h:140
Definition sopc_secure_channels_internal_ctx.h:155
uint32_t connectionTimeoutTimerId
Definition sopc_secure_channels_internal_ctx.h:185
SOPC_SecretBuffer * clientNonce
Definition sopc_secure_channels_internal_ctx.h:195
uint32_t symmSecuMaxBodySize
Definition sopc_secure_channels_internal_ctx.h:161
uint16_t serverReverseConnIdx
Definition sopc_secure_channels_internal_ctx.h:177
bool isServerConnection
Definition sopc_secure_channels_internal_ctx.h:206
SOPC_CryptoProvider * cryptoProvider
Definition sopc_secure_channels_internal_ctx.h:189
uint32_t socketIndex
Definition sopc_secure_channels_internal_ctx.h:182
SOPC_CertificateList * serverCertificate
Definition sopc_secure_channels_internal_ctx.h:211
SOPC_CertificateList * clientCertificate
Definition sopc_secure_channels_internal_ctx.h:212
SOPC_SecureConnection_SecurityToken precedentSecurityToken
Definition sopc_secure_channels_internal_ctx.h:190
SOPC_SC_SecurityKeySets precedentSecuKeySets
Definition sopc_secure_channels_internal_ctx.h:191
SOPC_SecureConnection_TcpProperties tcpMsgProperties
Definition sopc_secure_channels_internal_ctx.h:188
uint32_t clientSecureChannelId
Definition sopc_secure_channels_internal_ctx.h:165
SOPC_SecureConnection_TcpAsymmSecu serverAsymmSecuInfo
Definition sopc_secure_channels_internal_ctx.h:170
uint32_t clientReverseEpConfigIdx
Definition sopc_secure_channels_internal_ctx.h:179
uint32_t secuTokenRenewTimerId
Definition sopc_secure_channels_internal_ctx.h:198
SOPC_SecureConnection_State state
Definition sopc_secure_channels_internal_ctx.h:173
SOPC_AsymmetricKey * privateKey
Definition sopc_secure_channels_internal_ctx.h:210
bool hasExtraPaddingSize
Definition sopc_secure_channels_internal_ctx.h:162
SOPC_SecureConnection_SecurityToken currentSecurityToken
Definition sopc_secure_channels_internal_ctx.h:192
SOPC_SecureConnection_ChunkMgrCtx chunksCtx
Definition sopc_secure_channels_internal_ctx.h:157
bool isReverseConnection
Definition sopc_secure_channels_internal_ctx.h:176
bool serverNewSecuTokenActive
Definition sopc_secure_channels_internal_ctx.h:203
uint32_t asymmSecuMaxBodySize
Definition sopc_secure_channels_internal_ctx.h:160
SOPC_SC_SecurityKeySets currentSecuKeySets
Definition sopc_secure_channels_internal_ctx.h:193
uint32_t secureChannelConfigIdx
Definition sopc_secure_channels_internal_ctx.h:174
uint32_t serverEndpointConfigIdx
Definition sopc_secure_channels_internal_ctx.h:208
uint32_t clientNextReqId
Definition sopc_secure_channels_internal_ctx.h:167
SOPC_SecureConnection_TcpSequenceProperties tcpSeqProperties
Definition sopc_secure_channels_internal_ctx.h:159
Definition sopc_secure_channels_internal_ctx.h:216
uint32_t socketIndex
Definition sopc_secure_channels_internal_ctx.h:220
uint32_t reverseConnRetryTimerIds[SOPC_MAX_REVERSE_CLIENT_CONNECTIONS]
Definition sopc_secure_channels_internal_ctx.h:226
uint32_t connectionIdxArray[SOPC_MAX_SOCKETS_CONNECTIONS]
Definition sopc_secure_channels_internal_ctx.h:222
bool isUsedConnectionIdxArray[SOPC_MAX_SOCKETS_CONNECTIONS]
Definition sopc_secure_channels_internal_ctx.h:223
uint32_t lastConnectionIdxArrayIdx
Definition sopc_secure_channels_internal_ctx.h:224
SOPC_SecureListener_State state
Definition sopc_secure_channels_internal_ctx.h:217
uint32_t serverEndpointConfigIdx
Definition sopc_secure_channels_internal_ctx.h:219
bool reverseEnpoint
Definition sopc_secure_channels_internal_ctx.h:218
Structure containing the context of a sent request message at SC layer level.
Definition sopc_secure_channels_internal_ctx.h:79
uint32_t scConnectionIdx
Definition sopc_secure_channels_internal_ctx.h:81
bool timeoutExpired
Definition sopc_secure_channels_internal_ctx.h:80
uint32_t requestHandle
Definition sopc_secure_channels_internal_ctx.h:82
uint32_t timerId
Definition sopc_secure_channels_internal_ctx.h:84
SOPC_Msg_Type msgType
Definition sopc_secure_channels_internal_ctx.h:83