|
RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
|
See ab_gp_takeover_key.h. More...
#include "ab_gp_takeover_key.h"#include <stdio.h>#include <string.h>#include "safecomm/mac/mac.h"Go to the source code of this file.
Functions | |
| static int | hex_nibble (char c) |
| static bool | decode_hex (const char *hex, uint8_t *out, size_t len) |
| static char * | trim_line (char *line) |
| bool | ab_gp_takeover_key_load_file (const char *path) |
| Loads the key file (one key, 48 hex characters) into this process's key slot. | |
| bool | ab_gp_takeover_key_loaded (void) |
| bool | ab_gp_takeover_verify_mac (void *user, const uint8_t *msg, size_t msg_len, const uint8_t mac[RTE_SITE_ROLE_TOKEN_MAC_LEN]) |
| rte_site_role verify_mac callback: true only when a key is loaded and the Subset-037 MAC over msg matches. | |
| bool | ab_gp_takeover_token_from_payload (const char *payload, uint8_t out[RTE_SITE_ROLE_TOKEN_LEN]) |
| Decodes a util payload token=<48 hex> into a token. | |
| bool | ab_gp_takeover_token_build (uint8_t site_id, uint8_t channel_id, uint32_t challenge, uint32_t seq, uint8_t out[RTE_SITE_ROLE_TOKEN_LEN]) |
| Builds a token for one channel: the message (version, site id, channel id, challenge, issuer sequence) and its Subset-037 MAC with the loaded key. | |
| bool | ab_gp_takeover_token_to_payload (const uint8_t token[RTE_SITE_ROLE_TOKEN_LEN], char *out, size_t out_size) |
| Encodes a token as the util payload token=<48 hex> (NUL-terminated). | |
Variables | |
| static uint8_t | s_key [SAFECOMM_MAC_KEY_LEN] |
| static bool | s_key_loaded = false |
See ab_gp_takeover_key.h.
Definition in file ab_gp_takeover_key.c.
|
static |
Definition at line 15 of file ab_gp_takeover_key.c.
|
static |
Definition at line 33 of file ab_gp_takeover_key.c.
|
static |
Definition at line 52 of file ab_gp_takeover_key.c.
| bool ab_gp_takeover_key_load_file | ( | const char * | path | ) |
Loads the key file (one key, 48 hex characters) into this process's key slot.
Definition at line 75 of file ab_gp_takeover_key.c.
| bool ab_gp_takeover_key_loaded | ( | void | ) |
Definition at line 116 of file ab_gp_takeover_key.c.
| bool ab_gp_takeover_verify_mac | ( | void * | user, |
| const uint8_t * | msg, | ||
| size_t | msg_len, | ||
| const uint8_t | mac[RTE_SITE_ROLE_TOKEN_MAC_LEN] ) |
rte_site_role verify_mac callback: true only when a key is loaded and the Subset-037 MAC over msg matches.
Definition at line 121 of file ab_gp_takeover_key.c.
| bool ab_gp_takeover_token_from_payload | ( | const char * | payload, |
| uint8_t | out[RTE_SITE_ROLE_TOKEN_LEN] ) |
Decodes a util payload token=<48 hex> into a token.
Definition at line 139 of file ab_gp_takeover_key.c.
| bool ab_gp_takeover_token_build | ( | uint8_t | site_id, |
| uint8_t | channel_id, | ||
| uint32_t | challenge, | ||
| uint32_t | seq, | ||
| uint8_t | out[RTE_SITE_ROLE_TOKEN_LEN] ) |
Builds a token for one channel: the message (version, site id, channel id, challenge, issuer sequence) and its Subset-037 MAC with the loaded key.
Definition at line 151 of file ab_gp_takeover_key.c.
| bool ab_gp_takeover_token_to_payload | ( | const uint8_t | token[RTE_SITE_ROLE_TOKEN_LEN], |
| char * | out, | ||
| size_t | out_size ) |
Encodes a token as the util payload token=<48 hex> (NUL-terminated).
Definition at line 181 of file ab_gp_takeover_key.c.
|
static |
Definition at line 12 of file ab_gp_takeover_key.c.
|
static |
Definition at line 13 of file ab_gp_takeover_key.c.