Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232475
b: refs/heads/master
c: 765c2a9
h: refs/heads/master
i:
  232473: 3a32de1
  232471: 5d6ee75
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo F. Padovan committed Jan 19, 2011
1 parent 497e464 commit d5b12c1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d00ef24fc2923b65fdd440dc6445903e965841ac
refs/heads/master: 765c2a964b49bd06b61a52991519281c85d82b67
1 change: 1 addition & 0 deletions trunk/include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ struct hci_conn {
__u32 link_mode;
__u8 auth_type;
__u8 sec_level;
__u8 pending_sec_level;
__u8 power_save;
__u16 disc_timeout;
unsigned long pend;
Expand Down
8 changes: 6 additions & 2 deletions trunk/net/bluetooth/hci_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
hci_conn_hold(acl);

if (acl->state == BT_OPEN || acl->state == BT_CLOSED) {
acl->sec_level = sec_level;
acl->sec_level = BT_SECURITY_LOW;
acl->pending_sec_level = sec_level;
acl->auth_type = auth_type;
hci_acl_connect(acl);
}
Expand Down Expand Up @@ -437,8 +438,11 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
{
BT_DBG("conn %p", conn);

if (conn->pending_sec_level > sec_level)
sec_level = conn->pending_sec_level;

if (sec_level > conn->sec_level)
conn->sec_level = sec_level;
conn->pending_sec_level = sec_level;
else if (conn->link_mode & HCI_LM_AUTH)
return 1;

Expand Down
9 changes: 5 additions & 4 deletions trunk/net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,13 +692,13 @@ static int hci_outgoing_auth_needed(struct hci_dev *hdev,
if (conn->state != BT_CONFIG || !conn->out)
return 0;

if (conn->sec_level == BT_SECURITY_SDP)
if (conn->pending_sec_level == BT_SECURITY_SDP)
return 0;

/* Only request authentication for SSP connections or non-SSP
* devices with sec_level HIGH */
if (!(hdev->ssp_mode > 0 && conn->ssp_mode > 0) &&
conn->sec_level != BT_SECURITY_HIGH)
conn->pending_sec_level != BT_SECURITY_HIGH)
return 0;

return 1;
Expand Down Expand Up @@ -1095,9 +1095,10 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s

conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
if (conn) {
if (!ev->status)
if (!ev->status) {
conn->link_mode |= HCI_LM_AUTH;
else
conn->sec_level = conn->pending_sec_level;
} else
conn->sec_level = BT_SECURITY_LOW;

clear_bit(HCI_CONN_AUTH_PEND, &conn->pend);
Expand Down

0 comments on commit d5b12c1

Please sign in to comment.