Merge branch 'bugfix/btdm_smp_decide_association_model' into 'master'

component/bt: Fix bug of function smp_decide_association_model

See merge request !1377
This commit is contained in:
Jiang Jiang Jian 2017-10-31 14:34:41 +08:00
commit 07f92f0bd1

View File

@ -1221,14 +1221,6 @@ void smp_decide_association_model(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
switch (p_cb->selected_association_model) { switch (p_cb->selected_association_model) {
case SMP_MODEL_ENCRYPTION_ONLY: /* TK = 0, go calculate Confirm */ case SMP_MODEL_ENCRYPTION_ONLY: /* TK = 0, go calculate Confirm */
if (p_cb->role == HCI_ROLE_MASTER &&
((p_cb->peer_auth_req & SMP_AUTH_YN_BIT) != 0) &&
((p_cb->loc_auth_req & SMP_AUTH_YN_BIT) == 0)) {
SMP_TRACE_ERROR ("IO capability does not meet authentication requirement\n");
failure = SMP_PAIR_AUTH_FAIL;
p = (tSMP_INT_DATA *)&failure;
int_evt = SMP_AUTH_CMPL_EVT;
} else {
p_cb->sec_level = SMP_SEC_UNAUTHENTICATE; p_cb->sec_level = SMP_SEC_UNAUTHENTICATE;
SMP_TRACE_EVENT ("p_cb->sec_level =%d (SMP_SEC_UNAUTHENTICATE) \n", p_cb->sec_level ); SMP_TRACE_EVENT ("p_cb->sec_level =%d (SMP_SEC_UNAUTHENTICATE) \n", p_cb->sec_level );
@ -1239,7 +1231,6 @@ void smp_decide_association_model(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
memset(p_cb->tk, 0, BT_OCTET16_LEN); memset(p_cb->tk, 0, BT_OCTET16_LEN);
/* TK, ready */ /* TK, ready */
int_evt = SMP_KEY_READY_EVT; int_evt = SMP_KEY_READY_EVT;
}
break; break;
case SMP_MODEL_PASSKEY: case SMP_MODEL_PASSKEY: