21 #ifndef OC_KNX_SEC_INTERNAL_H
22 #define OC_KNX_SEC_INTERNAL_H
229 char *clientrecipient_id,
230 int clientrecipient_id_size, uint8_t *shared_key,
231 int shared_key_size);
248 char *clientrecipient_id,
249 int clientrecipient_id_size, uint8_t *shared_key,
250 int shared_key_size);
bool oc_knx_sec_check_acl(oc_method_t method, const oc_resource_t *resource, oc_endpoint_t *endpoint)
check access control based on acl and resource interfaces
oc_auth_at_t * oc_get_auth_at_entry(size_t device_index, int index)
retrieve auth/at entry
int oc_core_get_at_table_size()
returns the size (amount of total entries) of the auth/at table
void oc_oscore_set_auth_mac(char *client_senderid, int client_senderid_size, char *clientrecipient_id, int clientrecipient_id_size, uint8_t *shared_key, int shared_key_size)
set shared (SPAKE) key to the auth at table, on the Management Client side
int oc_at_delete_entry(size_t device_index, int index)
delete the /auth/at table entry
int oc_core_find_at_entry_with_osc_id(size_t device_index, uint8_t *osc_id, size_t osc_id_len)
Find an entry with a given OSCORE ID.
void oc_init_oscore(size_t device_index)
initialize OSCORE for the device
oc_at_profile_t
The token profiles see section 3.5.4.2 Access Token Resource Object.
@ OC_PROFILE_COAP_PASE
"coap_pase" [OSCORE] with PASE credentials
@ OC_PROFILE_UNKNOWN
unknown profile
@ OC_PROFILE_COAP_TLS
coap_tls" [OSCORE] for [X.509] certificates with TLS
@ OC_PROFILE_COAP_OSCORE
"coap_oscore"
@ OC_PROFILE_COAP_DTLS
"coap_dtls"
int oc_core_find_at_entry_with_context_id(size_t device_index, char *context_id)
find the entry with context_id as id
char * oc_at_profile_to_string(oc_at_profile_t at_profile)
access token profile to string
void oc_create_knx_sec_resources(size_t device)
Creation of the KNX security resources.
void oc_init_oscore_from_storage(size_t device_index, bool from_storage)
initialize OSCORE for the device
int oc_core_set_at_table(size_t device_index, int index, oc_auth_at_t entry, bool store)
set an entry in the auth/at table
void oc_print_auth_at_entry(size_t device_index, int index)
print the auth/at entry
int oc_core_find_at_entry_empty_slot(size_t device_index)
find empty slot
bool oc_if_method_allowed_according_to_mask(oc_interface_mask_t iface_mask, oc_method_t method)
is the method allowed according to the interface mask
uint64_t oc_oscore_get_osndelay()
retrieve the oscore sequence number delay value
uint64_t oc_oscore_get_rplwdo()
retrieve the replay window
void oc_reset_at_table(size_t device_index, int erase_code)
reset the /auth/at table will be used in reset of the device erase_code:
struct oc_auth_at_t oc_auth_at_t
Access Token (at) Information payload for a unicast message Example(JSON):
oc_at_profile_t oc_string_to_at_profile(oc_string_t str)
string to access token profile
void oc_oscore_set_auth_device(char *client_senderid, int client_senderid_size, char *clientrecipient_id, int clientrecipient_id_size, uint8_t *shared_key, int shared_key_size)
set shared (SPAKE) key to the auth at table, on the Device side
bool oc_knx_contains_interface(oc_interface_mask_t at_interface, oc_interface_mask_t resource_interface)
function to check if the at_interface is listed in the resource interfaces
void oc_delete_at_table(size_t device_index)
delete the /auth/at table will be used in reset of the device
oc_interface_mask_t
interface masks security access scopes defined as interfaces note that scope = 1 is not used.
Access Token (at) Information payload for a unicast message Example(JSON):
uint8_t osc_alg
(18:4:4) OSCORE cnf:osc:alg (optional- not used) default: decimal value 10
oc_string_t osc_salt
(18:4:5) OSCORE cnf:osc:salt (optional) empty string
oc_string_t kid
(8:2) DTLS (not used) cnf:kid
int ga_len
length of the group addresses (ga) in the scope
uint8_t osc_hkdf
(18:4:3) OSCORE cnf:osc:hkdf (optional-not used) (decimal value)
oc_string_t osc_id
(18:4:0) OSCORE cnf:osc:id (used as SID & KID) (byte string), max 7 bytes
oc_string_t id
(0) auth/at/{id}, encoding: HEX
oc_string_t osc_rid
(18:4:7) OSCORE cnf:osc:rid (recipient ID) (byte string)
int nbf
token not valid before (optional)
oc_at_profile_t profile
(38) "coap_oscore" or "coap_dtls", only oscore implemented
oc_string_t osc_ms
(18:4:2) OSCORE cnf:osc:ms (byte string)
int64_t * ga
(scope) array of group addresses, for the group objects in the scope, int64_t for framing arrays
oc_interface_mask_t scope
(9) the scope (interfaces)
oc_string_t aud
not used anymore, references
oc_string_t osc_version
(18:4:1) OSCORE cnf:osc:version (optional)
oc_string_t sub
(2) DTLS (not used) 2 sub
oc_string_t osc_contextid
(18:4:6) OSCORE cnf:osc:contextid used as "kid_context" (byte string, 6 bytes)