RE: [PATCH] Bluetooth: Double check sec req for pre 2.1 device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, 

>+int hci_conn_accept_secure(struct hci_conn *conn, __u8 sec_level) {
>+	BT_DBG("conn %p", conn);
>+
>+	if (sec_level != BT_SECURITY_HIGH)
>+		return 1; /* Accept if non-secure is required */
>+
>+	if (conn->key_type == HCI_LK_AUTH_COMBINATION ||
>+			(conn->key_type == HCI_LK_COMBINATION &&
>+			conn->pin_length == 16))

Checking againt conn->sec_level is tricky. This function is called indirectly by hci_auth_complete_evt which first sets sec_level to pending_sec_level even for pre-2.1 units. Thus, this always will return true while re-authentication of pre-2.1 devices because sec_level is already updated with the pending one. 

I've tried to check, in hci_auth_complete_evt, if we deal with pre-2.1 dev and if a link key already exists and then set sec_level, but the link key in this point always exists.  

Any suggestions how to solve this?  A new flag in conn->pre21_reauth?


Thanks,
Waldek--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux