Loading system/stack/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -648,6 +648,7 @@ cc_fuzz { "l2cap/*.cc", ], static_libs: [ "bluetooth_flags_c_lib", "libbluetooth-types", "libbluetooth_hci_pdl", "libbluetooth_l2cap_pdl", Loading @@ -657,6 +658,9 @@ cc_fuzz { "libbt_shim_bridge", "libbt_shim_ffi", ], shared_libs: [ "server_configurable_flags", ], target: { android: { shared_libs: [ Loading system/stack/l2cap/l2c_link.cc +52 −18 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ ******************************************************************************/ #define LOG_TAG "l2c_link" #include <android_bluetooth_flags.h> #include <bluetooth/log.h> #include <cstdint> Loading Loading @@ -214,6 +215,38 @@ void l2c_link_sec_comp(const RawAddress* p_bda, return; } if (IS_FLAG_ENABLED(l2cap_p_ccb_check_rewrite)) { if (!p_ref_data) { log::warn("Argument p_ref_data is NULL"); return; } /* Match p_ccb with p_ref_data returned by sec manager */ p_ccb = (tL2C_CCB*)p_ref_data; if (p_lcb != p_ccb->p_lcb) { log::warn("p_ref_data doesn't match with sec manager record"); return; } switch (status) { case BTM_SUCCESS: l2c_csm_execute(p_ccb, L2CEVT_SEC_COMP, &ci); break; case BTM_DELAY_CHECK: /* start a timer - encryption change not received before L2CAP connect * req */ alarm_set_on_mloop(p_ccb->l2c_ccb_timer, L2CAP_DELAY_CHECK_SM4_TIMEOUT_MS, l2c_ccb_timer_timeout, p_ccb); return; default: l2c_csm_execute(p_ccb, L2CEVT_SEC_COMP_NEG, &ci); break; } } else { /* Match p_ccb with p_ref_data returned by sec manager */ for (p_ccb = p_lcb->ccb_queue.p_first_ccb; p_ccb; p_ccb = p_next_ccb) { p_next_ccb = p_ccb->p_next_ccb; Loading @@ -225,8 +258,8 @@ void l2c_link_sec_comp(const RawAddress* p_bda, break; case BTM_DELAY_CHECK: /* start a timer - encryption change not received before L2CAP connect * req */ /* start a timer - encryption change not received before L2CAP * connect req */ alarm_set_on_mloop(p_ccb->l2c_ccb_timer, L2CAP_DELAY_CHECK_SM4_TIMEOUT_MS, l2c_ccb_timer_timeout, p_ccb); Loading @@ -239,6 +272,7 @@ void l2c_link_sec_comp(const RawAddress* p_bda, } } } } /******************************************************************************* ** Loading Loading
system/stack/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -648,6 +648,7 @@ cc_fuzz { "l2cap/*.cc", ], static_libs: [ "bluetooth_flags_c_lib", "libbluetooth-types", "libbluetooth_hci_pdl", "libbluetooth_l2cap_pdl", Loading @@ -657,6 +658,9 @@ cc_fuzz { "libbt_shim_bridge", "libbt_shim_ffi", ], shared_libs: [ "server_configurable_flags", ], target: { android: { shared_libs: [ Loading
system/stack/l2cap/l2c_link.cc +52 −18 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ ******************************************************************************/ #define LOG_TAG "l2c_link" #include <android_bluetooth_flags.h> #include <bluetooth/log.h> #include <cstdint> Loading Loading @@ -214,6 +215,38 @@ void l2c_link_sec_comp(const RawAddress* p_bda, return; } if (IS_FLAG_ENABLED(l2cap_p_ccb_check_rewrite)) { if (!p_ref_data) { log::warn("Argument p_ref_data is NULL"); return; } /* Match p_ccb with p_ref_data returned by sec manager */ p_ccb = (tL2C_CCB*)p_ref_data; if (p_lcb != p_ccb->p_lcb) { log::warn("p_ref_data doesn't match with sec manager record"); return; } switch (status) { case BTM_SUCCESS: l2c_csm_execute(p_ccb, L2CEVT_SEC_COMP, &ci); break; case BTM_DELAY_CHECK: /* start a timer - encryption change not received before L2CAP connect * req */ alarm_set_on_mloop(p_ccb->l2c_ccb_timer, L2CAP_DELAY_CHECK_SM4_TIMEOUT_MS, l2c_ccb_timer_timeout, p_ccb); return; default: l2c_csm_execute(p_ccb, L2CEVT_SEC_COMP_NEG, &ci); break; } } else { /* Match p_ccb with p_ref_data returned by sec manager */ for (p_ccb = p_lcb->ccb_queue.p_first_ccb; p_ccb; p_ccb = p_next_ccb) { p_next_ccb = p_ccb->p_next_ccb; Loading @@ -225,8 +258,8 @@ void l2c_link_sec_comp(const RawAddress* p_bda, break; case BTM_DELAY_CHECK: /* start a timer - encryption change not received before L2CAP connect * req */ /* start a timer - encryption change not received before L2CAP * connect req */ alarm_set_on_mloop(p_ccb->l2c_ccb_timer, L2CAP_DELAY_CHECK_SM4_TIMEOUT_MS, l2c_ccb_timer_timeout, p_ccb); Loading @@ -239,6 +272,7 @@ void l2c_link_sec_comp(const RawAddress* p_bda, } } } } /******************************************************************************* ** Loading