Skip to content

Commit 021c452

Browse files
replaced lesc field usage with ediv&rand check
1 parent fbb926d commit 021c452

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xPalSecurityManager.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,10 @@ bool nRF5xSecurityManager::sm_handler(const ble_evt_t *evt)
956956
peer_dist = pairing_cb->initiator_dist;
957957
}
958958

959-
if (status.lesc) {
959+
uint8_t invalid_rand[BLE_GAP_SEC_RAND_LEN] = { 0 };
960+
if (pairing_cb->own_enc_key.master_id.ediv == 0 &&
961+
memcmp(pairing_cb->own_enc_key.master_id.rand, invalid_rand, sizeof(invalid_rand) == 0)
962+
) {
960963
handler->on_secure_connections_ltk_generated(
961964
connection,
962965
ltk_t(pairing_cb->own_enc_key.enc_info.ltk)

0 commit comments

Comments
 (0)