Bluetooth: BR/EDR: Rename pair method field

Refines pairing method holder name to be more generic in connection object
representing applied method during authentication process.

Change-Id: Ia6f51788912974fbbda26b760d187c0f7e24bb0b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This commit is contained in:
Arkadiusz Lichwa 2016-03-29 10:39:44 +02:00 committed by Johan Hedberg
commit 8f844fac29
2 changed files with 8 additions and 8 deletions

View file

@ -866,14 +866,14 @@ static int ssp_confirm_neg_reply(struct bt_conn *conn)
void bt_conn_ssp_auth(struct bt_conn *conn, uint32_t passkey) void bt_conn_ssp_auth(struct bt_conn *conn, uint32_t passkey)
{ {
conn->br.ssp_method = ssp_pair_method(conn); conn->br.pairing_method = ssp_pair_method(conn);
/* /*
* If local required security is HIGH then MITM is mandatory. * If local required security is HIGH then MITM is mandatory.
* MITM protection is no achievable when SSP 'justworks' is applied. * MITM protection is no achievable when SSP 'justworks' is applied.
*/ */
if (conn->required_sec_level > BT_SECURITY_MEDIUM && if (conn->required_sec_level > BT_SECURITY_MEDIUM &&
conn->br.ssp_method == JUST_WORKS) { conn->br.pairing_method == JUST_WORKS) {
BT_DBG("MITM protection infeasible for required security"); BT_DBG("MITM protection infeasible for required security");
ssp_confirm_neg_reply(conn); ssp_confirm_neg_reply(conn);
return; return;
@ -882,7 +882,7 @@ void bt_conn_ssp_auth(struct bt_conn *conn, uint32_t passkey)
/* TODO: As pairing acceptor call user pairing consent API callback. */ /* TODO: As pairing acceptor call user pairing consent API callback. */
/* Start interactive authentication if valid, default to justworks. */ /* Start interactive authentication if valid, default to justworks. */
switch (conn->br.ssp_method) { switch (conn->br.pairing_method) {
case PASSKEY_CONFIRM: case PASSKEY_CONFIRM:
atomic_set_bit(conn->flags, BT_CONN_USER); atomic_set_bit(conn->flags, BT_CONN_USER);
bt_auth->passkey_confirm(conn, passkey); bt_auth->passkey_confirm(conn, passkey);
@ -1460,7 +1460,7 @@ int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey)
return -EPERM; return -EPERM;
} }
if (conn->br.ssp_method == PASSKEY_INPUT) { if (conn->br.pairing_method == PASSKEY_INPUT) {
return ssp_passkey_reply(conn, passkey); return ssp_passkey_reply(conn, passkey);
} }
} }
@ -1510,15 +1510,15 @@ int bt_conn_auth_cancel(struct bt_conn *conn)
return -EPERM; return -EPERM;
} }
if (conn->br.ssp_method == PASSKEY_CONFIRM) { if (conn->br.pairing_method == PASSKEY_CONFIRM) {
return ssp_confirm_neg_reply(conn); return ssp_confirm_neg_reply(conn);
} }
if (conn->br.ssp_method == PASSKEY_INPUT) { if (conn->br.pairing_method == PASSKEY_INPUT) {
return ssp_passkey_neg_reply(conn); return ssp_passkey_neg_reply(conn);
} }
if (conn->br.ssp_method == PASSKEY_DISPLAY) { if (conn->br.pairing_method == PASSKEY_DISPLAY) {
return bt_conn_disconnect(conn, return bt_conn_disconnect(conn,
BT_HCI_ERR_AUTHENTICATION_FAIL); BT_HCI_ERR_AUTHENTICATION_FAIL);
} }

View file

@ -56,7 +56,7 @@ struct bt_conn_br {
bt_addr_t dst; bt_addr_t dst;
uint8_t remote_io_capa; uint8_t remote_io_capa;
uint8_t remote_auth; uint8_t remote_auth;
uint8_t ssp_method; uint8_t pairing_method;
}; };
#endif #endif