Loading system/btif/src/btif_av.cc +8 −0 Original line number Diff line number Diff line Loading @@ -536,6 +536,7 @@ class BtifAvSource { std::set<RawAddress> silenced_peers_; RawAddress active_peer_; std::map<uint8_t, tBTA_AV_HNDL> peer_id2bta_handle_; std::mutex mutex_; }; class BtifAvSink { Loading Loading @@ -654,6 +655,7 @@ class BtifAvSink { std::map<RawAddress, BtifAvPeer*> peers_; RawAddress active_peer_; std::map<uint8_t, tBTA_AV_HNDL> peer_id2bta_handle_; std::mutex mutex_; }; /***************************************************************************** Loading Loading @@ -1041,6 +1043,7 @@ BtifAvPeer* BtifAvSource::FindPeerByPeerId(uint8_t peer_id) { BtifAvPeer* BtifAvSource::FindOrCreatePeer(const RawAddress& peer_address, tBTA_AV_HNDL bta_handle) { std::unique_lock<std::mutex> lock(mutex_); BTIF_TRACE_DEBUG("%s: peer_address=%s bta_handle=0x%x", __PRETTY_FUNCTION__, peer_address.ToString().c_str(), bta_handle); Loading Loading @@ -1145,6 +1148,7 @@ void BtifAvSource::RegisterAllBtaHandles() { } void BtifAvSource::DeregisterAllBtaHandles() { std::unique_lock<std::mutex> lock(mutex_); for (auto it : peer_id2bta_handle_) { tBTA_AV_HNDL bta_handle = it.second; BTA_AvDeregister(bta_handle); Loading @@ -1154,6 +1158,7 @@ void BtifAvSource::DeregisterAllBtaHandles() { void BtifAvSource::BtaHandleRegistered(uint8_t peer_id, tBTA_AV_HNDL bta_handle) { std::unique_lock<std::mutex> lock(mutex_); peer_id2bta_handle_.insert(std::make_pair(peer_id, bta_handle)); // Set the BTA Handle for the Peer (if exists) Loading Loading @@ -1246,6 +1251,7 @@ BtifAvPeer* BtifAvSink::FindPeerByPeerId(uint8_t peer_id) { BtifAvPeer* BtifAvSink::FindOrCreatePeer(const RawAddress& peer_address, tBTA_AV_HNDL bta_handle) { std::unique_lock<std::mutex> lock(mutex_); BTIF_TRACE_DEBUG("%s: peer_address=%s bta_handle=0x%x", __PRETTY_FUNCTION__, peer_address.ToString().c_str(), bta_handle); Loading Loading @@ -1353,6 +1359,7 @@ void BtifAvSink::RegisterAllBtaHandles() { } void BtifAvSink::DeregisterAllBtaHandles() { std::unique_lock<std::mutex> lock(mutex_); for (auto it : peer_id2bta_handle_) { tBTA_AV_HNDL bta_handle = it.second; BTA_AvDeregister(bta_handle); Loading @@ -1361,6 +1368,7 @@ void BtifAvSink::DeregisterAllBtaHandles() { } void BtifAvSink::BtaHandleRegistered(uint8_t peer_id, tBTA_AV_HNDL bta_handle) { std::unique_lock<std::mutex> lock(mutex_); peer_id2bta_handle_.insert(std::make_pair(peer_id, bta_handle)); // Set the BTA Handle for the Peer (if exists) Loading system/btif/src/btif_sock_l2cap.cc +1 −0 Original line number Diff line number Diff line Loading @@ -624,6 +624,7 @@ static void on_l2cap_data_ind(tBTA_JV* evt, uint32_t id) { sock->id); BTA_JvL2capClose(sock->handle); btsock_l2cap_free_l(sock); return; } } } Loading system/stack/avrc/avrc_api.cc +4 −3 Original line number Diff line number Diff line Loading @@ -633,9 +633,10 @@ static void avrc_msg_cback(uint8_t handle, uint8_t label, uint8_t cr, tAVRC_MSG_VENDOR* p_msg = &msg.vendor; if (cr == AVCT_CMD && (p_pkt->layer_specific & AVCT_DATA_CTRL && AVRC_PACKET_LEN < sizeof(p_pkt->len))) { /* Ignore the invalid AV/C command frame */ p_drop_msg = "dropped - too long AV/C cmd frame size"; p_pkt->len > AVRC_PACKET_LEN)) { android_errorWriteLog(0x534e4554, "177611958"); AVRC_TRACE_WARNING("%s: Command length %d too long: must be at most %d", __func__, p_pkt->len, AVRC_PACKET_LEN); osi_free(p_pkt); return; } Loading system/stack/smp/smp_act.cc +10 −0 Original line number Diff line number Diff line Loading @@ -695,6 +695,16 @@ void smp_process_pairing_public_key(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { memcpy(pt.x, p_cb->peer_publ_key.x, BT_OCTET32_LEN); memcpy(pt.y, p_cb->peer_publ_key.y, BT_OCTET32_LEN); if (!memcmp(p_cb->peer_publ_key.x, p_cb->loc_publ_key.x, BT_OCTET32_LEN) && !memcmp(p_cb->peer_publ_key.y, p_cb->loc_publ_key.y, BT_OCTET32_LEN)) { android_errorWriteLog(0x534e4554, "174886838"); SMP_TRACE_WARNING("Remote and local public keys can't match"); tSMP_INT_DATA smp; smp.status = SMP_PAIR_AUTH_FAIL; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp); return; } if (!ECC_ValidatePoint(pt)) { android_errorWriteLog(0x534e4554, "72377774"); tSMP_INT_DATA smp; Loading Loading
system/btif/src/btif_av.cc +8 −0 Original line number Diff line number Diff line Loading @@ -536,6 +536,7 @@ class BtifAvSource { std::set<RawAddress> silenced_peers_; RawAddress active_peer_; std::map<uint8_t, tBTA_AV_HNDL> peer_id2bta_handle_; std::mutex mutex_; }; class BtifAvSink { Loading Loading @@ -654,6 +655,7 @@ class BtifAvSink { std::map<RawAddress, BtifAvPeer*> peers_; RawAddress active_peer_; std::map<uint8_t, tBTA_AV_HNDL> peer_id2bta_handle_; std::mutex mutex_; }; /***************************************************************************** Loading Loading @@ -1041,6 +1043,7 @@ BtifAvPeer* BtifAvSource::FindPeerByPeerId(uint8_t peer_id) { BtifAvPeer* BtifAvSource::FindOrCreatePeer(const RawAddress& peer_address, tBTA_AV_HNDL bta_handle) { std::unique_lock<std::mutex> lock(mutex_); BTIF_TRACE_DEBUG("%s: peer_address=%s bta_handle=0x%x", __PRETTY_FUNCTION__, peer_address.ToString().c_str(), bta_handle); Loading Loading @@ -1145,6 +1148,7 @@ void BtifAvSource::RegisterAllBtaHandles() { } void BtifAvSource::DeregisterAllBtaHandles() { std::unique_lock<std::mutex> lock(mutex_); for (auto it : peer_id2bta_handle_) { tBTA_AV_HNDL bta_handle = it.second; BTA_AvDeregister(bta_handle); Loading @@ -1154,6 +1158,7 @@ void BtifAvSource::DeregisterAllBtaHandles() { void BtifAvSource::BtaHandleRegistered(uint8_t peer_id, tBTA_AV_HNDL bta_handle) { std::unique_lock<std::mutex> lock(mutex_); peer_id2bta_handle_.insert(std::make_pair(peer_id, bta_handle)); // Set the BTA Handle for the Peer (if exists) Loading Loading @@ -1246,6 +1251,7 @@ BtifAvPeer* BtifAvSink::FindPeerByPeerId(uint8_t peer_id) { BtifAvPeer* BtifAvSink::FindOrCreatePeer(const RawAddress& peer_address, tBTA_AV_HNDL bta_handle) { std::unique_lock<std::mutex> lock(mutex_); BTIF_TRACE_DEBUG("%s: peer_address=%s bta_handle=0x%x", __PRETTY_FUNCTION__, peer_address.ToString().c_str(), bta_handle); Loading Loading @@ -1353,6 +1359,7 @@ void BtifAvSink::RegisterAllBtaHandles() { } void BtifAvSink::DeregisterAllBtaHandles() { std::unique_lock<std::mutex> lock(mutex_); for (auto it : peer_id2bta_handle_) { tBTA_AV_HNDL bta_handle = it.second; BTA_AvDeregister(bta_handle); Loading @@ -1361,6 +1368,7 @@ void BtifAvSink::DeregisterAllBtaHandles() { } void BtifAvSink::BtaHandleRegistered(uint8_t peer_id, tBTA_AV_HNDL bta_handle) { std::unique_lock<std::mutex> lock(mutex_); peer_id2bta_handle_.insert(std::make_pair(peer_id, bta_handle)); // Set the BTA Handle for the Peer (if exists) Loading
system/btif/src/btif_sock_l2cap.cc +1 −0 Original line number Diff line number Diff line Loading @@ -624,6 +624,7 @@ static void on_l2cap_data_ind(tBTA_JV* evt, uint32_t id) { sock->id); BTA_JvL2capClose(sock->handle); btsock_l2cap_free_l(sock); return; } } } Loading
system/stack/avrc/avrc_api.cc +4 −3 Original line number Diff line number Diff line Loading @@ -633,9 +633,10 @@ static void avrc_msg_cback(uint8_t handle, uint8_t label, uint8_t cr, tAVRC_MSG_VENDOR* p_msg = &msg.vendor; if (cr == AVCT_CMD && (p_pkt->layer_specific & AVCT_DATA_CTRL && AVRC_PACKET_LEN < sizeof(p_pkt->len))) { /* Ignore the invalid AV/C command frame */ p_drop_msg = "dropped - too long AV/C cmd frame size"; p_pkt->len > AVRC_PACKET_LEN)) { android_errorWriteLog(0x534e4554, "177611958"); AVRC_TRACE_WARNING("%s: Command length %d too long: must be at most %d", __func__, p_pkt->len, AVRC_PACKET_LEN); osi_free(p_pkt); return; } Loading
system/stack/smp/smp_act.cc +10 −0 Original line number Diff line number Diff line Loading @@ -695,6 +695,16 @@ void smp_process_pairing_public_key(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { memcpy(pt.x, p_cb->peer_publ_key.x, BT_OCTET32_LEN); memcpy(pt.y, p_cb->peer_publ_key.y, BT_OCTET32_LEN); if (!memcmp(p_cb->peer_publ_key.x, p_cb->loc_publ_key.x, BT_OCTET32_LEN) && !memcmp(p_cb->peer_publ_key.y, p_cb->loc_publ_key.y, BT_OCTET32_LEN)) { android_errorWriteLog(0x534e4554, "174886838"); SMP_TRACE_WARNING("Remote and local public keys can't match"); tSMP_INT_DATA smp; smp.status = SMP_PAIR_AUTH_FAIL; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp); return; } if (!ECC_ValidatePoint(pt)) { android_errorWriteLog(0x534e4554, "72377774"); tSMP_INT_DATA smp; Loading