Revision as of 13:19, 15 December 2021 by Registered User

1. Introduction

For maximizing security, ZigBee 3.0 provides Install Code process to create link key known as Install Code Link Key.

2. Definitions

Link Key: is unique between each pair of nodes and are used to encrypt/decrypt the communication between the nodes.
Trust Center: usually is a ZigBee coordinator. It handles security of the network.

3. Install Code Link Key Format

Install code is made up of 6,8, 12 or 16 bytes random, hexadecimal number with 2 bytes CRC. The CRC should be appended to the installation code in little endian format. ZigBee 3.0 Base Device Behavior Specification requires the use of 16-byte Install Code.

4. Trust center behavior

The trust center should decide whether a joining node shall use the default link key or an Install Code Link Key depending on the value of bdbJoinUsesInstallCodeKey.
If bdbJoinUsesInstallCodeKey is FALSE, the Trust Center permits a node to join its network without having a corresponding install code link key. If bdbJoinUsesInstallCodeKey is TRUE, the Trust Center only permits a node to join its network if a corresponding install code link key associated with the node has been preinstalled before the node joins. The Trust Center shall add an entry into its Link Key Table based on ZED EUI64 address.

5. Trust Center (ZC) API

Form ZigBee network using whatever Link key:

/* Attempt to join a ZigBee network */
ZbStartupConfigGetProDefaults(&config);

/* Set the centralized network */
APP_DBG("Network config : APP_STARTUP_CENTRALIZED_COORDINATOR");
config.startupControl = ZbStartTypeForm;

/* Using the default HA preconfigured Link Key */
memcpy(config.security.preconfiguredLinkKey, sec_key_ha, ZB_SEC_KEYSIZE);

config.channelList.count = 1;
config.channelList.list[0].page = 0;
config.channelList.list[0].channelMask = 1 << CHANNEL; /*Channel in use */

/* Using ZbStartupWait (blocking) */
status = ZbStartupWait(zigbee_app_info.zb, &config);

Enable Install Code:

uint32_t tcPolicy = 0;
ZbApsGet(zigbee_app_info.zb, ZB_APS_IB_ID_TRUST_CENTER_POLICY, &tcPolicy, sizeof(tcPolicy));
tcPolicy |= (ZB_APSME_POLICY_IC_SUPPORTED | ZB_APSME_POLICY_TCLK_UPDATE_REQUIRED);
ZbApsSet(zigbee_app_info.zb, ZB_APS_IB_ID_TRUST_CENTER_POLICY, &tcPolicy, sizeof(tcPolicy));
Node Install Code Steps