Skip to content

Commit e8f29f7

Browse files
committed
BLE - Cordio - PAL SM: refine comments and formating.
1 parent 36247b3 commit e8f29f7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ ble_error_t CordioSecurityManager::set_csrk(const csrk_t& csrk)
255255

256256
ble_error_t CordioSecurityManager::generate_public_key()
257257
{
258+
// FIXME
258259
return BLE_ERROR_NOT_IMPLEMENTED;
259260
}
260261

@@ -356,7 +357,7 @@ ble_error_t CordioSecurityManager::passkey_request_reply(
356357
) {
357358
DmSecAuthRsp(
358359
connection,
359-
3,
360+
/* datalength */ 3,
360361
reinterpret_cast<uint8_t*>(&passkey)
361362
);
362363

@@ -369,7 +370,7 @@ ble_error_t CordioSecurityManager::legacy_pairing_oob_data_request_reply(
369370
) {
370371
DmSecAuthRsp(
371372
connection,
372-
16,
373+
/* data length */16,
373374
const_cast<uint8_t*>(oob_data.data())
374375
);
375376

@@ -379,6 +380,7 @@ ble_error_t CordioSecurityManager::legacy_pairing_oob_data_request_reply(
379380
ble_error_t CordioSecurityManager::confirmation_entered(
380381
connection_handle_t connection, bool confirmation
381382
) {
383+
// FIXME:
382384
return BLE_ERROR_NOT_IMPLEMENTED;
383385
}
384386

@@ -397,6 +399,7 @@ ble_error_t CordioSecurityManager::oob_data_verified(
397399
const oob_lesc_value_t &local_random,
398400
const oob_lesc_value_t &peer_random
399401
) {
402+
// FIXME:
400403
return BLE_ERROR_NOT_IMPLEMENTED;
401404
}
402405

@@ -454,6 +457,7 @@ bool CordioSecurityManager::sm_handler(const wsfMsgHdr_t* msg) {
454457
dmSecEncryptIndEvt_t* evt = (dmSecEncryptIndEvt_t*) msg;
455458
// note: the field usingLtk of the message indicates if an LTK was
456459
// used to encrypt the link
460+
// FIXME: How to indicate the level of encryption ?
457461
handler->on_link_encryption_result(evt->hdr.param, link_encryption_t::ENCRYPTED);
458462
return true;
459463
}
@@ -498,6 +502,7 @@ bool CordioSecurityManager::sm_handler(const wsfMsgHdr_t* msg) {
498502
}
499503

500504
case DM_SEC_KEY_IND: {
505+
// NOTE: also report security level and encryption key len
501506
dmSecKeyIndEvt_t* evt = (dmSecKeyIndEvt_t*) msg;
502507
connection_handle_t connection = evt->hdr.param;
503508

@@ -520,6 +525,7 @@ bool CordioSecurityManager::sm_handler(const wsfMsgHdr_t* msg) {
520525
connection,
521526
ltk_t(reinterpret_cast<uint8_t*>(evt->keyData.ltk.key))
522527
);
528+
523529
handler->on_keys_distributed_ediv_rand(
524530
connection,
525531
ediv_t(reinterpret_cast<uint8_t*>(&(evt->keyData.ltk.ediv))),
@@ -533,6 +539,7 @@ bool CordioSecurityManager::sm_handler(const wsfMsgHdr_t* msg) {
533539
(advertising_peer_address_type_t::type) evt->keyData.irk.addrType,
534540
evt->keyData.irk.bdAddr
535541
);
542+
536543
handler->on_keys_distributed_irk(
537544
connection,
538545
irk_t(reinterpret_cast<uint8_t*>(evt->keyData.irk.key))
@@ -546,8 +553,6 @@ bool CordioSecurityManager::sm_handler(const wsfMsgHdr_t* msg) {
546553
break;
547554
}
548555

549-
// TODO: what to do with the security level and encryption key len ???
550-
551556
return true;
552557
}
553558

0 commit comments

Comments
 (0)