File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
features/FEATURE_BLE/targets/TARGET_CORDIO/source Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -552,12 +552,21 @@ bool CordioSecurityManager::sm_handler(const wsfMsgHdr_t* msg) {
552
552
}
553
553
554
554
case DM_SEC_LTK_REQ_IND: {
555
+ uint8_t null_rand[HCI_RAND_LEN] = { 0 };
555
556
hciLeLtkReqEvt_t* evt = (hciLeLtkReqEvt_t*) msg;
556
- handler->on_ltk_request (
557
- evt->hdr .param ,
558
- reinterpret_cast <uint8_t *>(&evt->encDiversifier ),
559
- evt->randNum
560
- );
557
+
558
+ if (evt->encDiversifier == 0 &&
559
+ memcmp (evt->randNum , null_rand, sizeof (null_rand))) {
560
+ handler->on_ltk_request (
561
+ evt->hdr .param
562
+ );
563
+ } else {
564
+ handler->on_ltk_request (
565
+ evt->hdr .param ,
566
+ reinterpret_cast <uint8_t *>(&evt->encDiversifier ),
567
+ evt->randNum
568
+ );
569
+ }
561
570
return true ;
562
571
}
563
572
You can’t perform that action at this time.
0 commit comments