Tool/software: TI-RTOS
Hi
I'm working on the latest SDK "simplelink_cc13x2_sdk_2_20_00_71".
(1) Does TI provides any document for describing the implementation of security in 15.4 stack? I got some problems on setting up the security, it's hard to understand these variables...
/****************************************************************************** Local security variables *****************************************************************************/ static CONST ApiMac_keyIdLookupDescriptor_t keyIdLookupList[] = { { /* Key identity data */ { 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x03 }, 0x01 /* 9 octets */ } }; /* Key device list can be modified at run time */ static CONST ApiMac_keyDeviceDescriptor_t keyDeviceList[] = { { 0x00, false, false }, { 0x00, false, false }, { 0x00, false, false }, { 0x00, false, false }, { 0x00, false, false }, { 0x00, false, false }, { 0x00, false, false }, { 0x00, false, false } }; static CONST ApiMac_keyUsageDescriptor_t keyUsageList[] = { { MAC_FRAME_TYPE_DATA, MAC_DATA_REQ_FRAME } }; #ifdef SUPPORT_MOXA_BOARD STATIC ApiMac_keyDescriptor_t keyTable[] = #else STATIC CONST ApiMac_keyDescriptor_t keyTable[] = #endif { { (ApiMac_keyIdLookupDescriptor_t *)keyIdLookupList, KEY_ID_LOOKUP_ENTRIES, (ApiMac_keyDeviceDescriptor_t *)keyDeviceList, KEY_DEVICE_TABLE_ENTRIES, (ApiMac_keyUsageDescriptor_t *)keyUsageList, KEY_USAGE_TABLE_ENTRIES, KEY_TABLE_DEFAULT_KEY, 0 /* frame counter */ } }; STATIC CONST ApiMac_securityPibSecurityLevelEntry_t securityLevelEntry = { 0, { MAC_FRAME_TYPE_DATA, MAC_DATA_REQ_FRAME, 0, false } }; STATIC CONST ApiMac_secLevel_t secLevel = ApiMac_secLevel_encMic32; STATIC CONST ApiMac_keyIdMode_t secKeyIdMode = ApiMac_keyIdMode_8; /* cant be zero for implicit key identifier */ STATIC CONST uint8_t secKeyIndex = 3; STATIC bool macSecurity = CONFIG_SECURE; #endif /* FEATURE_MAC_SECURITY */
(2) By using the default setting in the SDK, I can see the packets are encrypted.
I want to reduce the transmitted packet length by modifying the "secKeyIdMode" from "ApiMac_keyIdMode_8" to "ApiMac_keyIdMode_implicit", packets are unable to be transmitted and the dataCnfCb returns with the status "ApiMac_status_unavailableKey". Did I miss any configuration?
(3) Base on the "IEEE std 802.15.4", if I set the key identified mode to 0x00(ApiMac_keyIdMode_implicit), then the key is determined implicitly from the originator and recipient(s) of the frame, as indicated in the frame header. So the key that set by "keyTable[0].key" would not be used?
Thanks!