CPC-Security#

Modules#

sl_cpc_unbind_notification_handle_t

Enumerations#

enum
SL_CPC_SECURITY_STATE_NOT_READY = 0x00
SL_CPC_SECURITY_STATE_DISABLED = 0x01
SL_CPC_SECURITY_STATE_INITIALIZING = 0x02
SL_CPC_SECURITY_STATE_RESETTING = 0x03
SL_CPC_SECURITY_STATE_WAITING_ON_TX_COMPLETE = 0x4
SL_CPC_SECURITY_STATE_INITIALIZED = 0x05
}

Enumeration representing security state.

Typedefs#

typedef void(*

Typedef for the user-supplied callback function, which is called when unbinding (authorized).

Functions#

Get the setup status of the security subsystem.

void
sl_cpc_security_fetch_user_specified_binding_key(uint8_t **key, uint16_t *key_size_in_bytes)

User callback to provide CPC with a binding key.

uint64_t
sl_cpc_security_on_unbind_request(bool is_link_encrypted)

Authorize an unbind request.

sl_status_t

Unbind device.

sl_status_t
sl_cpc_security_unbind_subscribe(sl_cpc_unbind_notification_handle_t *handle, sl_cpc_unbind_notification_t callback, void *data)

Register a callback that will be called when an unbind event occurs.

sl_status_t
sl_cpc_security_unbind_unsubscribe(sl_cpc_unbind_notification_handle_t *handle)

Unregister a callback that will be called when an unbind event occurs.

Enumeration Documentation#

sl_cpc_security_state_t#

sl_cpc_security_state_t

Enumeration representing security state.

Enumerator
SL_CPC_SECURITY_STATE_NOT_READY

Security is not yet setup, no I-frame allowed.

SL_CPC_SECURITY_STATE_DISABLED

Security is not enabled, cleartext I-frame are allowed.

SL_CPC_SECURITY_STATE_INITIALIZING

Security is being initialized, raw I-frame are only allowed on security endpoint.

SL_CPC_SECURITY_STATE_RESETTING

Security is being reset.

SL_CPC_SECURITY_STATE_WAITING_ON_TX_COMPLETE

Response to setup the security session is about to be sent, waiting for write completion.

SL_CPC_SECURITY_STATE_INITIALIZED

Security is initialized, only encrypted I-frame are allowed.


Typedef Documentation#

sl_cpc_unbind_notification_t#

typedef void(* sl_cpc_unbind_notification_t) (void *data) )(void *data)

Typedef for the user-supplied callback function, which is called when unbinding (authorized).

Parameters
TypeDirectionArgument NameDescription
N/Adata

User-specific argument.


Function Documentation#

sl_cpc_security_get_state#

sl_cpc_security_state_t sl_cpc_security_get_state (void )

Get the setup status of the security subsystem.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • The setup status of the security subsystem.


sl_cpc_security_fetch_user_specified_binding_key#

void sl_cpc_security_fetch_user_specified_binding_key (uint8_t ** key, uint16_t * key_size_in_bytes)

User callback to provide CPC with a binding key.

Parameters
TypeDirectionArgument NameDescription
uint8_t **[out]key

The encryption key

uint16_t *[out]key_size_in_bytes

The encryption key size Note: Only 16 bytes keys are supported for the moment

SL_CPC_SECURITY_BINDING_KEY_METHOD config must be set to SL_CPC_SECURITY_BINDING_KEY_CUSTOMER_SPECIFIC


sl_cpc_security_on_unbind_request#

uint64_t sl_cpc_security_on_unbind_request (bool is_link_encrypted)

Authorize an unbind request.

Parameters
TypeDirectionArgument NameDescription
boolN/Ais_link_encrypted

Note

  • Declared as a weak symbol. If no strong definition is given by the user, unbind requests are always denied. If the user gives sl_cpc_security_fetch_user_specified_binding_key definition for this function, its return value will dictate if unbind requests are accepted.

Returns

  • Whether to allow unbind or not, use SL_CPC_SECURITY_OK_TO_UNBIND as a return value to allow. Return anything else to deny.


sl_cpc_security_unbind#

sl_status_t sl_cpc_security_unbind (void )

Unbind device.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Status code.


sl_cpc_security_unbind_subscribe#

sl_status_t sl_cpc_security_unbind_subscribe (sl_cpc_unbind_notification_handle_t * handle, sl_cpc_unbind_notification_t callback, void * data)

Register a callback that will be called when an unbind event occurs.

Parameters
TypeDirectionArgument NameDescription
sl_cpc_unbind_notification_handle_t *[in]handle

pointer to the unbind notification handle.

sl_cpc_unbind_notification_t[in]callback

pointer to the unbind notification callback.

void *[in]data

pointer to pass to the unbind notification callback.

Returns

  • Status code.


sl_cpc_security_unbind_unsubscribe#

sl_status_t sl_cpc_security_unbind_unsubscribe (sl_cpc_unbind_notification_handle_t * handle)

Unregister a callback that will be called when an unbind event occurs.

Parameters
TypeDirectionArgument NameDescription
sl_cpc_unbind_notification_handle_t *[in]handle

pointer to the unbind notification handle.

Returns

  • Status code.