#include "kderiv.h"
#include "curve25519.h"
#include "s2_protocol.h"
#include "s2_keystore.h"
#include "s2_inclusion_internal.h"
|
| 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
} |
| |
◆ 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 | |
◆ execute_action_controller()
| void execute_action_controller |
( |
uint8_t |
action | ) |
|
◆ inclusion_failed_evt_push()
| void inclusion_failed_evt_push |
( |
uint8_t |
fail_code | ) |
|
◆ inclusion_failed_frame_send()
| void inclusion_failed_frame_send |
( |
uint8_t |
error, |
|
|
uint8_t |
secure |
|
) |
| |
◆ process_event()
| void process_event |
( |
uint16_t |
evt | ) |
|
◆ s2_check_no_keys()
| static void s2_check_no_keys |
( |
void |
| ) |
|
|
static |
◆ s2_do_ecdh_calc_a()
| static void s2_do_ecdh_calc_a |
( |
void |
| ) |
|
|
static |
Section defining validation functions for including node - Begin.
◆ s2_inclusion_complete()
| static void s2_inclusion_complete |
( |
void |
| ) |
|
|
static |
◆ s2_inclusion_including_start()
| void s2_inclusion_including_start |
( |
struct S2 * |
p_context, |
|
|
const s2_connection_t * |
conn |
|
) |
| |
◆ s2_inclusion_key_grant()
| void s2_inclusion_key_grant |
( |
struct S2 * |
p_context, |
|
|
uint8_t |
include, |
|
|
uint8_t |
keys, |
|
|
uint8_t |
csa |
|
) |
| |
◆ s2_inclusion_send_data()
| void s2_inclusion_send_data |
( |
void |
| ) |
|
◆ s2_inclusion_send_frame()
| void s2_inclusion_send_frame |
( |
void |
| ) |
|
◆ s2_kex_rep_recv()
| static void s2_kex_rep_recv |
( |
void |
| ) |
|
|
static |
◆ s2_send_echo_kex_report()
| static void s2_send_echo_kex_report |
( |
void |
| ) |
|
|
static |
◆ 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.
◆ s2_send_kex_set()
| static void s2_send_kex_set |
( |
void |
| ) |
|
|
static |
◆ s2_send_net_key_report()
| static void s2_send_net_key_report |
( |
void |
| ) |
|
|
static |
◆ s2_send_pub_key_a()
| static void s2_send_pub_key_a |
( |
void |
| ) |
|
|
static |
◆ s2_send_transfer_end()
| static void s2_send_transfer_end |
( |
void |
| ) |
|
|
static |
◆ 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.
◆ 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] | context | Pointer to the context which contains the received buffer. |
- Return values
-
| 0 | If the echo frame matched the original frame. |
| KEX_FAIL | If the echo frame did not match the original frame. |
◆ validate_reported_curves()
| static uint8_t validate_reported_curves |
( |
void |
| ) |
|
|
static |
Function for validating the schemes supported by a joining node.
- Parameters
-
| [in,out] | context | Pointer to the context which contains the received buffer. Context will be updated with curves supported by joining node. |
- Return values
-
| 0 | If the requested curve is supported. |
| KEX_FAIL | if no supported curve is found . |
◆ validate_reported_keys()
| static uint8_t validate_reported_keys |
( |
void |
| ) |
|
|
static |
Function for validating that requested keys matches the supported schemes.
- Parameters
-
| [in,out] | context | Pointer to the context which contains the received buffer. Context will be updated with curves supported by joining node. |
- Return values
-
| 0 | If the requested curve is supported. |
| KEX_FAIL | if no supported curve is found . |
◆ 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] | context | Pointer to the context which contains the received buffer. Context will be updated with schemes supported by joining node. |
- Return values
-
| 0 | If a valid set of schemes is requested. |
| KEX_FAIL | if no supported scheme is found or invalid set of schemes are requested. |
◆ 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] | context | Pointer to the context which contains the received buffer. |
- Return values
-
| 0 | If the requested key is granted.. |
| KEX_FAIL | if the key requested has not been granted. |
◆ s2_transition_table_controller
| const s2_transition_t s2_transition_table_controller[] |
◆ s2_transition_table_controller_length