Cpc_security_secondary

Description

CPC Security Secondary.

Overview

TODO

Initialization

TODO

Data Structures

struct sl_cpc_unbind_notification_handle_t
Enumeration representing unbind notification handle.

Functions

sl_cpc_security_state_t sl_cpc_security_get_state (void)
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 sl_cpc_security_unbind (void)
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.

Typedefs

typedef void(* sl_cpc_unbind_notification_t ) (void *data)
Typedef for the user-supplied callback function, which is called when unbinding (authorized).

Enumerations

enum sl_cpc_security_state_t {
SL_CPC_SECURITY_STATE_NOT_READY = 0x00,
SL_CPC_SECURITY_STATE_DISABLED = 0x01,
SL_CPC_SECURITY_STATE_INITIALIZING = 0x02,
SL_CPC_SECURITY_STATE_WAITING_ON_TX_COMPLETE = 0x3,
SL_CPC_SECURITY_STATE_INITIALIZED = 0x04
}
Enumeration representing security state.

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.

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.

SL_CPC_SECURITY_BINDING_KEY_METHOD config must be set to SL_CPC_SECURITY_BINDING_KEY_CUSTOMER_SPECIFIC

Parameters
[out] key The encryption key
[out] key_size The encryption key size Note: Only 16 bytes keys are supported for the moment

sl_cpc_security_on_unbind_request()

uint64_t sl_cpc_security_on_unbind_request ( bool is_link_encrypted )

Authorize an unbind request.

Note
Declared as a weak symbol. If no strong definition is given by the user, unbind requests are always denied. If the user gives a 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.

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
[in] handle pointer to the unbind notification handle.
[in] callback pointer to the unbind notification callback.
[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
[in] handle pointer to the unbind notification handle.
Returns
Status code.

Typedef Documentation

sl_cpc_unbind_notification_t

typedef void(* sl_cpc_unbind_notification_t) (void *data)

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

Parameters
data User-specific argument.

Enumeration Type Documentation

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_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.