mirror of https://github.com/ARMmbed/mbed-os.git
BLE - Cordio PAL SM: Select correct on_ltk_request overload.
parent
628ffea6de
commit
da6ede34a8
|
@ -552,12 +552,21 @@ bool CordioSecurityManager::sm_handler(const wsfMsgHdr_t* msg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case DM_SEC_LTK_REQ_IND: {
|
case DM_SEC_LTK_REQ_IND: {
|
||||||
|
uint8_t null_rand[HCI_RAND_LEN] = { 0 };
|
||||||
hciLeLtkReqEvt_t* evt = (hciLeLtkReqEvt_t*) msg;
|
hciLeLtkReqEvt_t* evt = (hciLeLtkReqEvt_t*) msg;
|
||||||
|
|
||||||
|
if (evt->encDiversifier == 0 &&
|
||||||
|
memcmp(evt->randNum, null_rand, sizeof(null_rand))) {
|
||||||
|
handler->on_ltk_request(
|
||||||
|
evt->hdr.param
|
||||||
|
);
|
||||||
|
} else {
|
||||||
handler->on_ltk_request(
|
handler->on_ltk_request(
|
||||||
evt->hdr.param,
|
evt->hdr.param,
|
||||||
reinterpret_cast<uint8_t*>(&evt->encDiversifier),
|
reinterpret_cast<uint8_t*>(&evt->encDiversifier),
|
||||||
evt->randNum
|
evt->randNum
|
||||||
);
|
);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue