Loading system/conf/bt_stack.conf +11 −11 Original line number Diff line number Diff line Loading @@ -53,17 +53,17 @@ TRC_HID_DEV=2 #PTS_SmpOptions=0xD,0x4,0xf,0xf,0x10 # SMP Certification Failure Cases # Fail case number range from 1 to 9 will set up remote device for test # case execution. Setting PTS_SmpFailureCase to 0 means normal operation. # Set any of the following SMP error values (from smp_api_types.h) # to induce pairing failues for various PTS SMP test cases. # Setting PTS_SmpFailureCase to 0 means normal operation. # Failure modes: # 1 = SMP_CONFIRM_VALUE_ERR # 2 = SMP_PAIR_AUTH_FAIL # 3 = SMP_PAIR_FAIL_UNKNOWN # 4 = SMP_PAIR_NOT_SUPPORT # 5 = SMP_PASSKEY_ENTRY_FAIL # 6 = SMP_REPEATED_ATTEMPTS # 7 = PIN generation failure? # 8 = SMP_PASSKEY_ENTRY_FAIL # 9 = SMP_NUMERIC_COMPAR_FAIL; # # SMP_PASSKEY_ENTRY_FAIL = 1 # SMP_PAIR_AUTH_FAIL = 3 # SMP_CONFIRM_VALUE_ERR = 4 # SMP_PAIR_NOT_SUPPORT = 5 # SMP_PAIR_FAIL_UNKNOWN = 8 # SMP_REPEATED_ATTEMPTS = 9 # SMP_NUMERIC_COMPAR_FAIL = 12 #PTS_SmpFailureCase=0 system/stack/smp/smp_act.cc +20 −32 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ extern fixed_queue_t* btu_general_alarm_queue; #define SMP_KEY_DIST_TYPE_MAX 4 const tSMP_ACT smp_distribute_act[] = {smp_generate_ltk, smp_send_id_info, smp_generate_csrk, smp_set_derive_link_key}; Loading @@ -44,37 +45,14 @@ static bool lmp_version_below(BD_ADDR bda, uint8_t version) { } static bool pts_test_send_authentication_complete_failure(tSMP_CB* p_cb) { uint8_t reason = 0; if (p_cb->cert_failure < 2 || p_cb->cert_failure > 6) return false; SMP_TRACE_ERROR("%s failure case = %d", __func__, p_cb->cert_failure); switch (p_cb->cert_failure) { case 2: reason = SMP_PAIR_AUTH_FAIL; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); break; case 3: reason = SMP_PAIR_FAIL_UNKNOWN; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); break; case 4: reason = SMP_PAIR_NOT_SUPPORT; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); break; case 5: reason = SMP_PASSKEY_ENTRY_FAIL; uint8_t reason = p_cb->cert_failure; if (reason == SMP_PAIR_AUTH_FAIL || reason == SMP_PAIR_FAIL_UNKNOWN || reason == SMP_PAIR_NOT_SUPPORT || reason == SMP_PASSKEY_ENTRY_FAIL || reason == SMP_REPEATED_ATTEMPTS) { smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); break; case 6: reason = SMP_REPEATED_ATTEMPTS; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); break; } return true; ; } return false; } /******************************************************************************* Loading Loading @@ -1556,12 +1534,21 @@ void smp_process_peer_nonce(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { SMP_TRACE_DEBUG("%s start ", __func__); // PTS Testing failure modes if (p_cb->cert_failure == 1) { if (p_cb->cert_failure == SMP_CONFIRM_VALUE_ERR) { SMP_TRACE_ERROR("%s failure case = %d", __func__, p_cb->cert_failure); reason = p_cb->failure = SMP_CONFIRM_VALUE_ERR; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); return; } // PTS Testing failure modes (for LT) if ((p_cb->cert_failure == SMP_NUMERIC_COMPAR_FAIL) && (p_cb->selected_association_model == SMP_MODEL_SEC_CONN_JUSTWORKS) && (p_cb->role == HCI_ROLE_SLAVE)) { SMP_TRACE_ERROR("%s failure case = %d", __func__, p_cb->cert_failure); reason = p_cb->failure = SMP_NUMERIC_COMPAR_FAIL; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); return; } switch (p_cb->selected_association_model) { case SMP_MODEL_SEC_CONN_JUSTWORKS: Loading Loading @@ -1589,7 +1576,8 @@ void smp_process_peer_nonce(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { break; case SMP_MODEL_SEC_CONN_PASSKEY_ENT: case SMP_MODEL_SEC_CONN_PASSKEY_DISP: if (!smp_check_commitment(p_cb) && p_cb->cert_failure != 9) { if (!smp_check_commitment(p_cb) && p_cb->cert_failure != SMP_NUMERIC_COMPAR_FAIL) { reason = p_cb->failure = SMP_CONFIRM_VALUE_ERR; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); break; Loading system/stack/smp/smp_api.cc +3 −4 Original line number Diff line number Diff line Loading @@ -212,10 +212,9 @@ bool SMP_PairCancel(BD_ADDR bd_addr) { bool status = false; // PTS SMP failure test cases if (p_cb->cert_failure == 7) err_code = SMP_PASSKEY_ENTRY_FAIL; else if (p_cb->cert_failure == 8) err_code = SMP_NUMERIC_COMPAR_FAIL; if (p_cb->cert_failure == SMP_PASSKEY_ENTRY_FAIL || p_cb->cert_failure == SMP_NUMERIC_COMPAR_FAIL) err_code = p_cb->cert_failure; BTM_TRACE_EVENT("SMP_CancelPair state=%d flag=0x%x ", p_cb->state, p_cb->flags); Loading Loading
system/conf/bt_stack.conf +11 −11 Original line number Diff line number Diff line Loading @@ -53,17 +53,17 @@ TRC_HID_DEV=2 #PTS_SmpOptions=0xD,0x4,0xf,0xf,0x10 # SMP Certification Failure Cases # Fail case number range from 1 to 9 will set up remote device for test # case execution. Setting PTS_SmpFailureCase to 0 means normal operation. # Set any of the following SMP error values (from smp_api_types.h) # to induce pairing failues for various PTS SMP test cases. # Setting PTS_SmpFailureCase to 0 means normal operation. # Failure modes: # 1 = SMP_CONFIRM_VALUE_ERR # 2 = SMP_PAIR_AUTH_FAIL # 3 = SMP_PAIR_FAIL_UNKNOWN # 4 = SMP_PAIR_NOT_SUPPORT # 5 = SMP_PASSKEY_ENTRY_FAIL # 6 = SMP_REPEATED_ATTEMPTS # 7 = PIN generation failure? # 8 = SMP_PASSKEY_ENTRY_FAIL # 9 = SMP_NUMERIC_COMPAR_FAIL; # # SMP_PASSKEY_ENTRY_FAIL = 1 # SMP_PAIR_AUTH_FAIL = 3 # SMP_CONFIRM_VALUE_ERR = 4 # SMP_PAIR_NOT_SUPPORT = 5 # SMP_PAIR_FAIL_UNKNOWN = 8 # SMP_REPEATED_ATTEMPTS = 9 # SMP_NUMERIC_COMPAR_FAIL = 12 #PTS_SmpFailureCase=0
system/stack/smp/smp_act.cc +20 −32 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ extern fixed_queue_t* btu_general_alarm_queue; #define SMP_KEY_DIST_TYPE_MAX 4 const tSMP_ACT smp_distribute_act[] = {smp_generate_ltk, smp_send_id_info, smp_generate_csrk, smp_set_derive_link_key}; Loading @@ -44,37 +45,14 @@ static bool lmp_version_below(BD_ADDR bda, uint8_t version) { } static bool pts_test_send_authentication_complete_failure(tSMP_CB* p_cb) { uint8_t reason = 0; if (p_cb->cert_failure < 2 || p_cb->cert_failure > 6) return false; SMP_TRACE_ERROR("%s failure case = %d", __func__, p_cb->cert_failure); switch (p_cb->cert_failure) { case 2: reason = SMP_PAIR_AUTH_FAIL; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); break; case 3: reason = SMP_PAIR_FAIL_UNKNOWN; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); break; case 4: reason = SMP_PAIR_NOT_SUPPORT; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); break; case 5: reason = SMP_PASSKEY_ENTRY_FAIL; uint8_t reason = p_cb->cert_failure; if (reason == SMP_PAIR_AUTH_FAIL || reason == SMP_PAIR_FAIL_UNKNOWN || reason == SMP_PAIR_NOT_SUPPORT || reason == SMP_PASSKEY_ENTRY_FAIL || reason == SMP_REPEATED_ATTEMPTS) { smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); break; case 6: reason = SMP_REPEATED_ATTEMPTS; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); break; } return true; ; } return false; } /******************************************************************************* Loading Loading @@ -1556,12 +1534,21 @@ void smp_process_peer_nonce(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { SMP_TRACE_DEBUG("%s start ", __func__); // PTS Testing failure modes if (p_cb->cert_failure == 1) { if (p_cb->cert_failure == SMP_CONFIRM_VALUE_ERR) { SMP_TRACE_ERROR("%s failure case = %d", __func__, p_cb->cert_failure); reason = p_cb->failure = SMP_CONFIRM_VALUE_ERR; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); return; } // PTS Testing failure modes (for LT) if ((p_cb->cert_failure == SMP_NUMERIC_COMPAR_FAIL) && (p_cb->selected_association_model == SMP_MODEL_SEC_CONN_JUSTWORKS) && (p_cb->role == HCI_ROLE_SLAVE)) { SMP_TRACE_ERROR("%s failure case = %d", __func__, p_cb->cert_failure); reason = p_cb->failure = SMP_NUMERIC_COMPAR_FAIL; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); return; } switch (p_cb->selected_association_model) { case SMP_MODEL_SEC_CONN_JUSTWORKS: Loading Loading @@ -1589,7 +1576,8 @@ void smp_process_peer_nonce(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { break; case SMP_MODEL_SEC_CONN_PASSKEY_ENT: case SMP_MODEL_SEC_CONN_PASSKEY_DISP: if (!smp_check_commitment(p_cb) && p_cb->cert_failure != 9) { if (!smp_check_commitment(p_cb) && p_cb->cert_failure != SMP_NUMERIC_COMPAR_FAIL) { reason = p_cb->failure = SMP_CONFIRM_VALUE_ERR; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); break; Loading
system/stack/smp/smp_api.cc +3 −4 Original line number Diff line number Diff line Loading @@ -212,10 +212,9 @@ bool SMP_PairCancel(BD_ADDR bd_addr) { bool status = false; // PTS SMP failure test cases if (p_cb->cert_failure == 7) err_code = SMP_PASSKEY_ENTRY_FAIL; else if (p_cb->cert_failure == 8) err_code = SMP_NUMERIC_COMPAR_FAIL; if (p_cb->cert_failure == SMP_PASSKEY_ENTRY_FAIL || p_cb->cert_failure == SMP_NUMERIC_COMPAR_FAIL) err_code = p_cb->cert_failure; BTM_TRACE_EVENT("SMP_CancelPair state=%d flag=0x%x ", p_cb->state, p_cb->flags); Loading