Z-Wave Protocol Controller Reference
zwave_s2_inclusion_controller.c File Reference
#include "kderiv.h"
#include "curve25519.h"
#include "s2_protocol.h"
#include "s2_keystore.h"
#include "s2_inclusion_internal.h"
Include dependency graph for zwave_s2_inclusion_controller.c:

Enumerations

enum  s2_action_controller_t {
  S2_SEND_KEX_GET_ACTION = S2_ACTION_LAST , S2_KEX_REP_RECV_ACTION , S2_SEND_KEX_SET_ACTION , S2_SEND_PUB_KEY_A_ACTION ,
  S2_DO_ECDH_CALC_A_ACTION , S2_SEND_ECHO_KEX_REPORT_ACTION , S2_SEND_ERROR_CANCEL_ACTION , S2_SEND_ERROR_DECRYPT_ACTION ,
  S2_SEND_NET_KEY_REPORT_ACTION , S2_SEND_TRANSFER_END_ACTION , S2_INCLUSION_COMPLETE_ACTION , S2_CHECK_NO_KEYS
}
 

Functions

void process_event (uint16_t evt)
 
void inclusion_failed_frame_send (uint8_t error, uint8_t secure)
 
void inclusion_failed_evt_push (uint8_t fail_code)
 
void s2_inclusion_send_frame (void)
 
void s2_inclusion_send_data (void)
 
static void s2_send_kex_get (void)
 
static void s2_kex_rep_recv (void)
 
static void s2_send_kex_set (void)
 
static void s2_send_pub_key_a (void)
 
static void s2_send_echo_kex_report (void)
 
static void s2_send_net_key_report (void)
 
static void s2_send_transfer_end (void)
 
static void s2_inclusion_complete (void)
 
static void s2_do_ecdh_calc_a (void)
 
static void s2_check_no_keys (void)
 
void execute_action_controller (uint8_t action)
 
static uint8_t validate_reported_schemes (void)
 Function for validating the schemes supported in a KEX Report frame. More...
 
static uint8_t validate_reported_curves (void)
 Function for validating the schemes supported by a joining node. More...
 
static uint8_t validate_reported_keys (void)
 Function for validating that requested keys matches the supported schemes. More...
 
static uint8_t validate_requested_key (void)
 Function for validating that the requested key matches one the granted keys in KEX Set frame earlier. More...
 
static uint8_t validate_echo_kex_set (void)
 Function for validating that the echo kex set frame is identical to the transmitted frame earlier. More...
 
static uint8_t translate_keyslot_to_read_for_LR (uint8_t requested_keyslot, node_t peer_nodeid)
 
void s2_inclusion_key_grant (struct S2 *p_context, uint8_t include, uint8_t keys, uint8_t csa)
 
void s2_inclusion_including_start (struct S2 *p_context, const s2_connection_t *conn)
 

Variables

const s2_transition_t s2_transition_table_controller []
 
const size_t s2_transition_table_controller_length = ELEM_COUNT(s2_transition_table_controller)
 

Enumeration Type Documentation

◆ s2_action_controller_t

Enumerator
S2_SEND_KEX_GET_ACTION 
S2_KEX_REP_RECV_ACTION 
S2_SEND_KEX_SET_ACTION 
S2_SEND_PUB_KEY_A_ACTION 
S2_DO_ECDH_CALC_A_ACTION 
S2_SEND_ECHO_KEX_REPORT_ACTION 
S2_SEND_ERROR_CANCEL_ACTION 
S2_SEND_ERROR_DECRYPT_ACTION 
S2_SEND_NET_KEY_REPORT_ACTION 
S2_SEND_TRANSFER_END_ACTION 
S2_INCLUSION_COMPLETE_ACTION 
S2_CHECK_NO_KEYS 

Function Documentation

◆ execute_action_controller()

void execute_action_controller ( uint8_t  action)
Here is the call graph for this function:

◆ inclusion_failed_evt_push()

void inclusion_failed_evt_push ( uint8_t  fail_code)
Here is the caller graph for this function:

◆ inclusion_failed_frame_send()

void inclusion_failed_frame_send ( uint8_t  error,
uint8_t  secure 
)
Here is the caller graph for this function:

◆ process_event()

void process_event ( uint16_t  evt)
Here is the caller graph for this function:

◆ s2_check_no_keys()

static void s2_check_no_keys ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s2_do_ecdh_calc_a()

static void s2_do_ecdh_calc_a ( void  )
static

Section defining validation functions for including node - Begin.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s2_inclusion_complete()

static void s2_inclusion_complete ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s2_inclusion_including_start()

void s2_inclusion_including_start ( struct S2 *  p_context,
const s2_connection_t *  conn 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s2_inclusion_key_grant()

void s2_inclusion_key_grant ( struct S2 *  p_context,
uint8_t  include,
uint8_t  keys,
uint8_t  csa 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s2_inclusion_send_data()

void s2_inclusion_send_data ( void  )
Here is the caller graph for this function:

◆ s2_inclusion_send_frame()

void s2_inclusion_send_frame ( void  )
Here is the caller graph for this function:

◆ s2_kex_rep_recv()

static void s2_kex_rep_recv ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s2_send_echo_kex_report()

static void s2_send_echo_kex_report ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s2_send_kex_get()

static void s2_send_kex_get ( void  )
static

Section defining validation functions for including node - End. Section defining including node functions for state transistion actions - Begin.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s2_send_kex_set()

static void s2_send_kex_set ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s2_send_net_key_report()

static void s2_send_net_key_report ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s2_send_pub_key_a()

static void s2_send_pub_key_a ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s2_send_transfer_end()

static void s2_send_transfer_end ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ translate_keyslot_to_read_for_LR()

static uint8_t translate_keyslot_to_read_for_LR ( uint8_t  requested_keyslot,
node_t  peer_nodeid 
)
static

When bootstrapping an LR node, we actually want to transmit different S2 keys than requested on the radio frames. This function does the translation. In other words, the Access key requested by an LR node is different from the Access key requested by a normal node. Same for the Authenticated key.

Here is the caller graph for this function:

◆ validate_echo_kex_set()

static uint8_t validate_echo_kex_set ( void  )
static

Function for validating that the echo kex set frame is identical to the transmitted frame earlier.

Parameters
[in,out]contextPointer to the context which contains the received buffer.
Return values
0If the echo frame matched the original frame.
KEX_FAILIf the echo frame did not match the original frame.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate_reported_curves()

static uint8_t validate_reported_curves ( void  )
static

Function for validating the schemes supported by a joining node.

Parameters
[in,out]contextPointer to the context which contains the received buffer. Context will be updated with curves supported by joining node.
Return values
0If the requested curve is supported.
KEX_FAILif no supported curve is found .
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate_reported_keys()

static uint8_t validate_reported_keys ( void  )
static

Function for validating that requested keys matches the supported schemes.

Parameters
[in,out]contextPointer to the context which contains the received buffer. Context will be updated with curves supported by joining node.
Return values
0If the requested curve is supported.
KEX_FAILif no supported curve is found .
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate_reported_schemes()

static uint8_t validate_reported_schemes ( void  )
static

Function for validating the schemes supported in a KEX Report frame.

Parameters
[in,out]contextPointer to the context which contains the received buffer. Context will be updated with schemes supported by joining node.
Return values
0If a valid set of schemes is requested.
KEX_FAILif no supported scheme is found or invalid set of schemes are requested.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate_requested_key()

static uint8_t validate_requested_key ( void  )
static

Function for validating that the requested key matches one the granted keys in KEX Set frame earlier.

Parameters
[in,out]contextPointer to the context which contains the received buffer.
Return values
0If the requested key is granted..
KEX_FAILif the key requested has not been granted.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ s2_transition_table_controller

const s2_transition_t s2_transition_table_controller[]

◆ s2_transition_table_controller_length

const size_t s2_transition_table_controller_length = ELEM_COUNT(s2_transition_table_controller)