Loading system/stack/btm/btm_sec.cc +11 −15 Original line number Diff line number Diff line Loading @@ -456,10 +456,10 @@ bool BTM_SetSecurityLevel(bool is_originator, const char* p_name, #endif /* clear out the old setting, just in case it exists */ { p_srec->security_flags &= ~( BTM_SEC_OUT_AUTHORIZE | BTM_SEC_OUT_ENCRYPT | BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_MITM | BTM_SEC_FORCE_MASTER | BTM_SEC_ATTEMPT_MASTER | BTM_SEC_FORCE_SLAVE | BTM_SEC_ATTEMPT_SLAVE); p_srec->security_flags &= ~(BTM_SEC_OUT_ENCRYPT | BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_MITM | BTM_SEC_FORCE_MASTER | BTM_SEC_ATTEMPT_MASTER | BTM_SEC_FORCE_SLAVE | BTM_SEC_ATTEMPT_SLAVE); } /* Parameter validation. Originator should not set requirements for Loading Loading @@ -495,8 +495,8 @@ bool BTM_SetSecurityLevel(bool is_originator, const char* p_name, /* Parameter validation. Acceptor should not set requirements for outgoing * connections */ sec_level &= ~(BTM_SEC_OUT_AUTHORIZE | BTM_SEC_OUT_ENCRYPT | BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_MITM); sec_level &= ~(BTM_SEC_OUT_ENCRYPT | BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_MITM); if (btm_cb.security_mode == BTM_SEC_MODE_SP || btm_cb.security_mode == BTM_SEC_MODE_SC) { Loading Loading @@ -2009,9 +2009,7 @@ tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr, uint16_t psm, /* the security in BTM_SEC_IN_FLAGS is fullfilled so far, check the * requirements in */ /* btm_sec_execute_procedure */ if ((is_originator && (p_serv_rec->security_flags & BTM_SEC_OUT_AUTHORIZE)) || (!is_originator && false)) { if ((is_originator && false) || (!is_originator && false)) { BTM_TRACE_EVENT("%s: still need authorization", __func__); rc = BTM_CMD_STARTED; } Loading Loading @@ -4654,8 +4652,7 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) { /* If connection is not authorized and authorization is required */ /* start authorization and return PENDING to the caller */ if (!(p_dev_rec->sec_flags & BTM_SEC_AUTHORIZED) && ((p_dev_rec->is_originator && (p_dev_rec->security_required & BTM_SEC_OUT_AUTHORIZE)) || ((p_dev_rec->is_originator && false) || (!p_dev_rec->is_originator && false))) { BTM_TRACE_EVENT( "service id:%d, is trusted:%d", p_dev_rec->p_cur_service->service_id, Loading @@ -4672,10 +4669,9 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) { /* All required security procedures already established */ p_dev_rec->security_required &= ~(BTM_SEC_OUT_AUTHORIZE | BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_IN_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT | BTM_SEC_IN_ENCRYPT | BTM_SEC_FORCE_MASTER | BTM_SEC_ATTEMPT_MASTER | BTM_SEC_FORCE_SLAVE | BTM_SEC_ATTEMPT_SLAVE); ~(BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_IN_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT | BTM_SEC_IN_ENCRYPT | BTM_SEC_FORCE_MASTER | BTM_SEC_ATTEMPT_MASTER | BTM_SEC_FORCE_SLAVE | BTM_SEC_ATTEMPT_SLAVE); BTM_TRACE_EVENT("Security Manager: trusted:0x%04x%04x", p_dev_rec->trusted_mask[1], p_dev_rec->trusted_mask[0]); Loading system/stack/btm/security_device_record.h +1 −2 Original line number Diff line number Diff line Loading @@ -279,8 +279,7 @@ extern void btm_sco_disc_chk_pend_for_modechange(uint16_t hci_handle); * Define structure for Security Service Record. * A record exists for each service registered with the Security Manager */ #define BTM_SEC_OUT_FLAGS \ (BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT | BTM_SEC_OUT_AUTHORIZE) #define BTM_SEC_OUT_FLAGS (BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT) #define BTM_SEC_IN_FLAGS (BTM_SEC_IN_AUTHENTICATE | BTM_SEC_IN_ENCRYPT) #define BTM_SEC_OUT_LEVEL4_FLAGS \ Loading system/stack/gap/gap_conn.cc +1 −2 Original line number Diff line number Diff line Loading @@ -292,8 +292,7 @@ uint16_t GAP_ConnOpen(const char* p_serv_name, uint8_t service_id, p_ccb->con_state = GAP_CCB_STATE_CONN_SETUP; /* mark security done flag, when security is not required */ if ((security & (BTM_SEC_OUT_AUTHORIZE | BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT)) == 0) if ((security & (BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT)) == 0) p_ccb->con_flags |= GAP_CCB_FLAGS_SEC_DONE; /* Check if L2CAP started the connection process */ Loading system/stack/include/btm_api_types.h +0 −2 Original line number Diff line number Diff line Loading @@ -638,8 +638,6 @@ typedef void(tBTM_ESCO_CBACK)(tBTM_ESCO_EVT event, tBTM_ESCO_EVT_DATA* p_data); #define BTM_SEC_IN_AUTHENTICATE 0x0002 /* Inbound call requires encryption */ #define BTM_SEC_IN_ENCRYPT 0x0004 /* Outbound call requires authorization */ #define BTM_SEC_OUT_AUTHORIZE 0x0008 /* Outbound call requires authentication */ #define BTM_SEC_OUT_AUTHENTICATE 0x0010 /* Outbound call requires encryption */ Loading Loading
system/stack/btm/btm_sec.cc +11 −15 Original line number Diff line number Diff line Loading @@ -456,10 +456,10 @@ bool BTM_SetSecurityLevel(bool is_originator, const char* p_name, #endif /* clear out the old setting, just in case it exists */ { p_srec->security_flags &= ~( BTM_SEC_OUT_AUTHORIZE | BTM_SEC_OUT_ENCRYPT | BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_MITM | BTM_SEC_FORCE_MASTER | BTM_SEC_ATTEMPT_MASTER | BTM_SEC_FORCE_SLAVE | BTM_SEC_ATTEMPT_SLAVE); p_srec->security_flags &= ~(BTM_SEC_OUT_ENCRYPT | BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_MITM | BTM_SEC_FORCE_MASTER | BTM_SEC_ATTEMPT_MASTER | BTM_SEC_FORCE_SLAVE | BTM_SEC_ATTEMPT_SLAVE); } /* Parameter validation. Originator should not set requirements for Loading Loading @@ -495,8 +495,8 @@ bool BTM_SetSecurityLevel(bool is_originator, const char* p_name, /* Parameter validation. Acceptor should not set requirements for outgoing * connections */ sec_level &= ~(BTM_SEC_OUT_AUTHORIZE | BTM_SEC_OUT_ENCRYPT | BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_MITM); sec_level &= ~(BTM_SEC_OUT_ENCRYPT | BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_MITM); if (btm_cb.security_mode == BTM_SEC_MODE_SP || btm_cb.security_mode == BTM_SEC_MODE_SC) { Loading Loading @@ -2009,9 +2009,7 @@ tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr, uint16_t psm, /* the security in BTM_SEC_IN_FLAGS is fullfilled so far, check the * requirements in */ /* btm_sec_execute_procedure */ if ((is_originator && (p_serv_rec->security_flags & BTM_SEC_OUT_AUTHORIZE)) || (!is_originator && false)) { if ((is_originator && false) || (!is_originator && false)) { BTM_TRACE_EVENT("%s: still need authorization", __func__); rc = BTM_CMD_STARTED; } Loading Loading @@ -4654,8 +4652,7 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) { /* If connection is not authorized and authorization is required */ /* start authorization and return PENDING to the caller */ if (!(p_dev_rec->sec_flags & BTM_SEC_AUTHORIZED) && ((p_dev_rec->is_originator && (p_dev_rec->security_required & BTM_SEC_OUT_AUTHORIZE)) || ((p_dev_rec->is_originator && false) || (!p_dev_rec->is_originator && false))) { BTM_TRACE_EVENT( "service id:%d, is trusted:%d", p_dev_rec->p_cur_service->service_id, Loading @@ -4672,10 +4669,9 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) { /* All required security procedures already established */ p_dev_rec->security_required &= ~(BTM_SEC_OUT_AUTHORIZE | BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_IN_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT | BTM_SEC_IN_ENCRYPT | BTM_SEC_FORCE_MASTER | BTM_SEC_ATTEMPT_MASTER | BTM_SEC_FORCE_SLAVE | BTM_SEC_ATTEMPT_SLAVE); ~(BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_IN_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT | BTM_SEC_IN_ENCRYPT | BTM_SEC_FORCE_MASTER | BTM_SEC_ATTEMPT_MASTER | BTM_SEC_FORCE_SLAVE | BTM_SEC_ATTEMPT_SLAVE); BTM_TRACE_EVENT("Security Manager: trusted:0x%04x%04x", p_dev_rec->trusted_mask[1], p_dev_rec->trusted_mask[0]); Loading
system/stack/btm/security_device_record.h +1 −2 Original line number Diff line number Diff line Loading @@ -279,8 +279,7 @@ extern void btm_sco_disc_chk_pend_for_modechange(uint16_t hci_handle); * Define structure for Security Service Record. * A record exists for each service registered with the Security Manager */ #define BTM_SEC_OUT_FLAGS \ (BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT | BTM_SEC_OUT_AUTHORIZE) #define BTM_SEC_OUT_FLAGS (BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT) #define BTM_SEC_IN_FLAGS (BTM_SEC_IN_AUTHENTICATE | BTM_SEC_IN_ENCRYPT) #define BTM_SEC_OUT_LEVEL4_FLAGS \ Loading
system/stack/gap/gap_conn.cc +1 −2 Original line number Diff line number Diff line Loading @@ -292,8 +292,7 @@ uint16_t GAP_ConnOpen(const char* p_serv_name, uint8_t service_id, p_ccb->con_state = GAP_CCB_STATE_CONN_SETUP; /* mark security done flag, when security is not required */ if ((security & (BTM_SEC_OUT_AUTHORIZE | BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT)) == 0) if ((security & (BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT)) == 0) p_ccb->con_flags |= GAP_CCB_FLAGS_SEC_DONE; /* Check if L2CAP started the connection process */ Loading
system/stack/include/btm_api_types.h +0 −2 Original line number Diff line number Diff line Loading @@ -638,8 +638,6 @@ typedef void(tBTM_ESCO_CBACK)(tBTM_ESCO_EVT event, tBTM_ESCO_EVT_DATA* p_data); #define BTM_SEC_IN_AUTHENTICATE 0x0002 /* Inbound call requires encryption */ #define BTM_SEC_IN_ENCRYPT 0x0004 /* Outbound call requires authorization */ #define BTM_SEC_OUT_AUTHORIZE 0x0008 /* Outbound call requires authentication */ #define BTM_SEC_OUT_AUTHENTICATE 0x0010 /* Outbound call requires encryption */ Loading