Loading system/bta/dm/bta_dm_act.cc +7 −10 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ static uint8_t bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, bool min_16_digit); static uint8_t bta_dm_new_link_key_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, LINK_KEY key, uint8_t key_type); const LinkKey& key, uint8_t key_type); static uint8_t bta_dm_authentication_complete_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, Loading Loading @@ -343,7 +343,6 @@ static void bta_dm_sys_hw_cback(tBTA_SYS_HW_EVT status) { DEV_CLASS dev_class; tBTA_DM_SEC_CBACK* temp_cback; uint8_t key_mask = 0; BT_OCTET16 er; tBTA_BLE_LOCAL_ID_KEYS id_key; APPL_TRACE_DEBUG("%s with event: %i", __func__, status); Loading Loading @@ -406,7 +405,8 @@ static void bta_dm_sys_hw_cback(tBTA_SYS_HW_EVT status) { BTM_SetDeviceClass(dev_class); /* load BLE local information: ID keys, ER if available */ bta_dm_co_ble_load_local_keys(&key_mask, er, &id_key); Octet16 er; bta_dm_co_ble_load_local_keys(&key_mask, &er, &id_key); if (key_mask & BTA_BLE_LOCAL_KEY_TYPE_ER) { BTM_BleLoadLocalKeys(BTA_BLE_LOCAL_KEY_TYPE_ER, Loading Loading @@ -705,11 +705,10 @@ void bta_dm_remove_device(const RawAddress& bd_addr) { * Description This function adds a Link Key to an security database entry. * It is normally called during host startup to restore all * required information stored in the NVRAM. *** ******************************************************************************/ void bta_dm_add_device(std::unique_ptr<tBTA_DM_API_ADD_DEVICE> msg) { uint8_t* p_dc = NULL; uint8_t* p_lc = NULL; LinkKey* p_lc = NULL; uint32_t trusted_services_mask[BTM_SEC_SERVICE_ARRAY_SIZE]; uint8_t index = 0; uint8_t btm_mask_index = 0; Loading @@ -719,7 +718,7 @@ void bta_dm_add_device(std::unique_ptr<tBTA_DM_API_ADD_DEVICE> msg) { /* If not all zeros, the device class has been specified */ if (msg->dc_known) p_dc = (uint8_t*)msg->dc; if (msg->link_key_known) p_lc = (uint8_t*)msg->link_key; if (msg->link_key_known) p_lc = &msg->link_key; if (msg->is_trusted) { /* covert BTA service mask to BTM mask */ Loading Loading @@ -2365,7 +2364,7 @@ static uint8_t bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, ******************************************************************************/ static uint8_t bta_dm_new_link_key_cback(const RawAddress& bd_addr, UNUSED_ATTR DEV_CLASS dev_class, BD_NAME bd_name, LINK_KEY key, BD_NAME bd_name, const LinkKey& key, uint8_t key_type) { tBTA_DM_SEC sec_event; tBTA_DM_AUTH_CMPL* p_auth_cmpl; Loading @@ -2382,12 +2381,10 @@ static uint8_t bta_dm_new_link_key_cback(const RawAddress& bd_addr, memcpy(p_auth_cmpl->bd_name, bd_name, (BD_NAME_LEN - 1)); p_auth_cmpl->bd_name[BD_NAME_LEN - 1] = 0; p_auth_cmpl->key_present = true; p_auth_cmpl->key_type = key_type; p_auth_cmpl->success = true; memcpy(p_auth_cmpl->key, key, LINK_KEY_LEN); p_auth_cmpl->key = key; sec_event.auth_cmpl.fail_reason = HCI_SUCCESS; // Report the BR link key based on the BR/EDR address and type Loading system/bta/dm/bta_dm_api.cc +4 −7 Original line number Diff line number Diff line Loading @@ -296,7 +296,7 @@ void BTA_DmConfirm(const RawAddress& bd_addr, bool accept) { * ******************************************************************************/ void BTA_DmAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class, LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask, const LinkKey& link_key, tBTA_SERVICE_MASK trusted_mask, bool is_trusted, uint8_t key_type, tBTA_IO_CAP io_cap, uint8_t pin_length) { std::unique_ptr<tBTA_DM_API_ADD_DEVICE> msg = Loading @@ -306,12 +306,9 @@ void BTA_DmAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class, msg->tm = trusted_mask; msg->is_trusted = is_trusted; msg->io_cap = io_cap; if (link_key) { msg->link_key_known = true; msg->key_type = key_type; memcpy(msg->link_key, link_key, LINK_KEY_LEN); } msg->link_key = link_key; /* Load device class if specified */ if (dev_class) { Loading system/bta/dm/bta_dm_ci.cc +4 −4 Original line number Diff line number Diff line Loading @@ -60,15 +60,15 @@ void bta_dm_ci_io_req(const RawAddress& bd_addr, tBTA_IO_CAP io_cap, * Returns void * ******************************************************************************/ void bta_dm_ci_rmt_oob(bool accept, const RawAddress& bd_addr, BT_OCTET16 c, BT_OCTET16 r) { void bta_dm_ci_rmt_oob(bool accept, const RawAddress& bd_addr, const Octet16& c, const Octet16& r) { std::unique_ptr<tBTA_DM_CI_RMT_OOB> msg = std::make_unique<tBTA_DM_CI_RMT_OOB>(); msg->bd_addr = bd_addr; msg->accept = accept; memcpy(msg->c, c, BT_OCTET16_LEN); memcpy(msg->r, r, BT_OCTET16_LEN); msg->c = c; msg->r = r; do_in_bta_thread(FROM_HERE, base::Bind(bta_dm_ci_rmt_oob_act, base::Passed(&msg))); Loading system/bta/dm/bta_dm_int.h +3 −3 Original line number Diff line number Diff line Loading @@ -118,8 +118,8 @@ typedef struct { typedef struct { RawAddress bd_addr; BT_OCTET16 c; BT_OCTET16 r; Octet16 c; Octet16 r; bool accept; } tBTA_DM_CI_RMT_OOB; Loading Loading @@ -150,7 +150,7 @@ typedef struct { typedef struct { RawAddress bd_addr; DEV_CLASS dc; LINK_KEY link_key; LinkKey link_key; tBTA_SERVICE_MASK tm; bool is_trusted; uint8_t key_type; Loading system/bta/include/bta_api.h +9 −8 Original line number Diff line number Diff line Loading @@ -485,9 +485,9 @@ typedef union { typedef uint8_t tBTA_DM_BLE_LOCAL_KEY_MASK; typedef struct { BT_OCTET16 ir; BT_OCTET16 irk; BT_OCTET16 dhk; Octet16 ir; Octet16 irk; Octet16 dhk; } tBTA_BLE_LOCAL_ID_KEYS; #define BTA_DM_SEC_GRANTED BTA_SUCCESS Loading @@ -512,7 +512,7 @@ typedef struct { RawAddress bd_addr; /* BD address peer device. */ BD_NAME bd_name; /* Name of peer device. */ bool key_present; /* Valid link key value in key element */ LINK_KEY key; /* Link key associated with peer device. */ LinkKey key; /* Link key associated with peer device. */ uint8_t key_type; /* The type of Link Key */ bool success; /* true of authentication succeeded, false if failed. */ uint8_t fail_reason; /* The HCI reason/error code for when success=false */ Loading Loading @@ -689,7 +689,7 @@ typedef union { tBTA_DM_BLE_SEC_REQ ble_req; /* BLE SMP related request */ tBTA_DM_BLE_KEY ble_key; /* BLE SMP keys used when pairing */ tBTA_BLE_LOCAL_ID_KEYS ble_id_keys; /* IR event */ BT_OCTET16 ble_er; /* ER event data */ Octet16 ble_er; /* ER event data */ } tBTA_DM_SEC; /* Security callback */ Loading Loading @@ -1289,9 +1289,10 @@ extern void BTA_DmConfirm(const RawAddress& bd_addr, bool accept); * ******************************************************************************/ extern void BTA_DmAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class, LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask, bool is_trusted, uint8_t key_type, tBTA_IO_CAP io_cap, uint8_t pin_length); const LinkKey& link_key, tBTA_SERVICE_MASK trusted_mask, bool is_trusted, uint8_t key_type, tBTA_IO_CAP io_cap, uint8_t pin_length); /******************************************************************************* * Loading Loading
system/bta/dm/bta_dm_act.cc +7 −10 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ static uint8_t bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, bool min_16_digit); static uint8_t bta_dm_new_link_key_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, LINK_KEY key, uint8_t key_type); const LinkKey& key, uint8_t key_type); static uint8_t bta_dm_authentication_complete_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, Loading Loading @@ -343,7 +343,6 @@ static void bta_dm_sys_hw_cback(tBTA_SYS_HW_EVT status) { DEV_CLASS dev_class; tBTA_DM_SEC_CBACK* temp_cback; uint8_t key_mask = 0; BT_OCTET16 er; tBTA_BLE_LOCAL_ID_KEYS id_key; APPL_TRACE_DEBUG("%s with event: %i", __func__, status); Loading Loading @@ -406,7 +405,8 @@ static void bta_dm_sys_hw_cback(tBTA_SYS_HW_EVT status) { BTM_SetDeviceClass(dev_class); /* load BLE local information: ID keys, ER if available */ bta_dm_co_ble_load_local_keys(&key_mask, er, &id_key); Octet16 er; bta_dm_co_ble_load_local_keys(&key_mask, &er, &id_key); if (key_mask & BTA_BLE_LOCAL_KEY_TYPE_ER) { BTM_BleLoadLocalKeys(BTA_BLE_LOCAL_KEY_TYPE_ER, Loading Loading @@ -705,11 +705,10 @@ void bta_dm_remove_device(const RawAddress& bd_addr) { * Description This function adds a Link Key to an security database entry. * It is normally called during host startup to restore all * required information stored in the NVRAM. *** ******************************************************************************/ void bta_dm_add_device(std::unique_ptr<tBTA_DM_API_ADD_DEVICE> msg) { uint8_t* p_dc = NULL; uint8_t* p_lc = NULL; LinkKey* p_lc = NULL; uint32_t trusted_services_mask[BTM_SEC_SERVICE_ARRAY_SIZE]; uint8_t index = 0; uint8_t btm_mask_index = 0; Loading @@ -719,7 +718,7 @@ void bta_dm_add_device(std::unique_ptr<tBTA_DM_API_ADD_DEVICE> msg) { /* If not all zeros, the device class has been specified */ if (msg->dc_known) p_dc = (uint8_t*)msg->dc; if (msg->link_key_known) p_lc = (uint8_t*)msg->link_key; if (msg->link_key_known) p_lc = &msg->link_key; if (msg->is_trusted) { /* covert BTA service mask to BTM mask */ Loading Loading @@ -2365,7 +2364,7 @@ static uint8_t bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, ******************************************************************************/ static uint8_t bta_dm_new_link_key_cback(const RawAddress& bd_addr, UNUSED_ATTR DEV_CLASS dev_class, BD_NAME bd_name, LINK_KEY key, BD_NAME bd_name, const LinkKey& key, uint8_t key_type) { tBTA_DM_SEC sec_event; tBTA_DM_AUTH_CMPL* p_auth_cmpl; Loading @@ -2382,12 +2381,10 @@ static uint8_t bta_dm_new_link_key_cback(const RawAddress& bd_addr, memcpy(p_auth_cmpl->bd_name, bd_name, (BD_NAME_LEN - 1)); p_auth_cmpl->bd_name[BD_NAME_LEN - 1] = 0; p_auth_cmpl->key_present = true; p_auth_cmpl->key_type = key_type; p_auth_cmpl->success = true; memcpy(p_auth_cmpl->key, key, LINK_KEY_LEN); p_auth_cmpl->key = key; sec_event.auth_cmpl.fail_reason = HCI_SUCCESS; // Report the BR link key based on the BR/EDR address and type Loading
system/bta/dm/bta_dm_api.cc +4 −7 Original line number Diff line number Diff line Loading @@ -296,7 +296,7 @@ void BTA_DmConfirm(const RawAddress& bd_addr, bool accept) { * ******************************************************************************/ void BTA_DmAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class, LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask, const LinkKey& link_key, tBTA_SERVICE_MASK trusted_mask, bool is_trusted, uint8_t key_type, tBTA_IO_CAP io_cap, uint8_t pin_length) { std::unique_ptr<tBTA_DM_API_ADD_DEVICE> msg = Loading @@ -306,12 +306,9 @@ void BTA_DmAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class, msg->tm = trusted_mask; msg->is_trusted = is_trusted; msg->io_cap = io_cap; if (link_key) { msg->link_key_known = true; msg->key_type = key_type; memcpy(msg->link_key, link_key, LINK_KEY_LEN); } msg->link_key = link_key; /* Load device class if specified */ if (dev_class) { Loading
system/bta/dm/bta_dm_ci.cc +4 −4 Original line number Diff line number Diff line Loading @@ -60,15 +60,15 @@ void bta_dm_ci_io_req(const RawAddress& bd_addr, tBTA_IO_CAP io_cap, * Returns void * ******************************************************************************/ void bta_dm_ci_rmt_oob(bool accept, const RawAddress& bd_addr, BT_OCTET16 c, BT_OCTET16 r) { void bta_dm_ci_rmt_oob(bool accept, const RawAddress& bd_addr, const Octet16& c, const Octet16& r) { std::unique_ptr<tBTA_DM_CI_RMT_OOB> msg = std::make_unique<tBTA_DM_CI_RMT_OOB>(); msg->bd_addr = bd_addr; msg->accept = accept; memcpy(msg->c, c, BT_OCTET16_LEN); memcpy(msg->r, r, BT_OCTET16_LEN); msg->c = c; msg->r = r; do_in_bta_thread(FROM_HERE, base::Bind(bta_dm_ci_rmt_oob_act, base::Passed(&msg))); Loading
system/bta/dm/bta_dm_int.h +3 −3 Original line number Diff line number Diff line Loading @@ -118,8 +118,8 @@ typedef struct { typedef struct { RawAddress bd_addr; BT_OCTET16 c; BT_OCTET16 r; Octet16 c; Octet16 r; bool accept; } tBTA_DM_CI_RMT_OOB; Loading Loading @@ -150,7 +150,7 @@ typedef struct { typedef struct { RawAddress bd_addr; DEV_CLASS dc; LINK_KEY link_key; LinkKey link_key; tBTA_SERVICE_MASK tm; bool is_trusted; uint8_t key_type; Loading
system/bta/include/bta_api.h +9 −8 Original line number Diff line number Diff line Loading @@ -485,9 +485,9 @@ typedef union { typedef uint8_t tBTA_DM_BLE_LOCAL_KEY_MASK; typedef struct { BT_OCTET16 ir; BT_OCTET16 irk; BT_OCTET16 dhk; Octet16 ir; Octet16 irk; Octet16 dhk; } tBTA_BLE_LOCAL_ID_KEYS; #define BTA_DM_SEC_GRANTED BTA_SUCCESS Loading @@ -512,7 +512,7 @@ typedef struct { RawAddress bd_addr; /* BD address peer device. */ BD_NAME bd_name; /* Name of peer device. */ bool key_present; /* Valid link key value in key element */ LINK_KEY key; /* Link key associated with peer device. */ LinkKey key; /* Link key associated with peer device. */ uint8_t key_type; /* The type of Link Key */ bool success; /* true of authentication succeeded, false if failed. */ uint8_t fail_reason; /* The HCI reason/error code for when success=false */ Loading Loading @@ -689,7 +689,7 @@ typedef union { tBTA_DM_BLE_SEC_REQ ble_req; /* BLE SMP related request */ tBTA_DM_BLE_KEY ble_key; /* BLE SMP keys used when pairing */ tBTA_BLE_LOCAL_ID_KEYS ble_id_keys; /* IR event */ BT_OCTET16 ble_er; /* ER event data */ Octet16 ble_er; /* ER event data */ } tBTA_DM_SEC; /* Security callback */ Loading Loading @@ -1289,9 +1289,10 @@ extern void BTA_DmConfirm(const RawAddress& bd_addr, bool accept); * ******************************************************************************/ extern void BTA_DmAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class, LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask, bool is_trusted, uint8_t key_type, tBTA_IO_CAP io_cap, uint8_t pin_length); const LinkKey& link_key, tBTA_SERVICE_MASK trusted_mask, bool is_trusted, uint8_t key_type, tBTA_IO_CAP io_cap, uint8_t pin_length); /******************************************************************************* * Loading