Part Number: CC2642R
Hello,
I'm working on making sure all of the security requirements are met for a BLE product and have a few questions. We'll be running the latest BT 5 stack on a CC2642 when we go to production in our peripheral device, and the central will be running at least BT 4.2. Neither device has input or display capability, so we won't be able to enable MITM protection, i.e. we have to use the "Just Works" pairing association.
We want to use the highest level of security possible given our constraints. With this in mind I have the bond manager configured as follows on our peripheral:
void appBleInitBondMgr(void)
{
// No I/O capability in central or peripheral
uint8_t mitm = FALSE;
uint8_t ioCap = GAPBOND_IO_CAP_NO_INPUT_NO_OUTPUT;
uint8_t pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
uint8_t bonding = TRUE;
uint8_t bondFailAction = GAPBOND_FAIL_TERMINATE_LINK;
uint8_t secureConn = GAPBOND_SECURE_CONNECTION_ONLY;
GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);
GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm);
GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);
GAPBondMgr_SetParameter(GAPBOND_BOND_FAIL_ACTION, sizeof(uint8_t), &bondFailAction);
GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding);
GAPBondMgr_SetParameter(GAPBOND_SECURE_CONNECTION, sizeof(uint8_t), &secureConn);
}
Now for a few questions:
- What exactly does setting the GAPBOND_SECURE_CONNECTION parameter to GAPBOND_SECURE_CONNECTION_ONLY do? My interpretation of sections 10.2.4 and 10.3 (Vol 3, Part C) of the Bluetooth specification is that "Secure Connections Only" is only possible when pairing is performed via LE Secure Connections and MITM protection is also used. Is "GAPBOND_SECURE_CONNECTION_ONLY" a valid configuration when MITM protection isn't supported? The only difference I've noticed between GAPBOND_SECURE_CONNECTION_ONLY and GAPBOND_SECURE_CONNECTION_ALLOW is that the bond manager rejects pairing requests from centrals that only support the LE Legacy Pairing procedure when the setting is GAPBOND_SECURE_CONNECTION_ONLY. This is desirable, as we want to avoid key generation via Legacy Pairing, I just want to make sure this configuration is acceptable.
- Does the "GAPBOND_BOND_FAIL_ACTION" do anything on a perihperal? Looking at the bond manager code, it appears this setting only applies to centrals...
- As far as securing our applications custom GATT service goes, I'm thinking I need elevate the permission levels on our characteristic value attributes to "GATT_PERMIT_ENCRYPT_READ and/or GATT_PERMIT_ENCRYPT_WRITE", and require a 16-byte encryption key size when registering the service via GATTServApp_RegisterService(). Is this configuration correct for locking down the characteristics so they can only be read/written when the link is encrypted with a key generated via the LE secure connections procedure?
Thanks
Josh