linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: josephsih@chromium.org
To: linux-bluetooth@vger.kernel.org
Cc: luiz.von.dentz@intel.com
Subject: [PATCH] shared/att: change security as needed
Date: Wed,  2 Mar 2016 21:28:39 +0800	[thread overview]
Message-ID: <1456925319-16594-1-git-send-email-josephsih@chromium.org> (raw)

From: Joseph Hwang <josephsih@chromium.org>

When pairing with a BLE keyboard, bluetoothd suffers from
authentication errors as follows:

ERR bluetoothd[1103]: Report Map read failed:
                    Attribute requires authentication before read/write
ERR bluetoothd[1103]: Protocol Mode characteristic read failed:
                    Attribute requires authentication before read/write
ERR bluetoothd[1103]: HID Information read failed:
                    Attribute requires authentication before read/write

This is because the original security level is BT_ATT_SECURITY_LOW,
while BT_ATT_SECURITY_HIGH is required for pairing. This patch enables
the security elevation so that handle_error_rsp() could push the
operation back to request queue properly.

---
 src/shared/att.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/shared/att.c b/src/shared/att.c
index 3a84783..331fae7 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
@@ -574,9 +574,6 @@ static bool change_security(struct bt_att *att, uint8_t ecode)
 	int security;
 
 	security = bt_att_get_security(att);
-	if (security != BT_ATT_SECURITY_AUTO)
-		return false;
-
 	if (ecode == BT_ATT_ERROR_INSUFFICIENT_ENCRYPTION &&
 					security < BT_ATT_SECURITY_MEDIUM)
 		security = BT_ATT_SECURITY_MEDIUM;
-- 
2.7.0.rc3.207.g0ac5344


             reply	other threads:[~2016-03-02 13:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 13:28 josephsih [this message]
2016-03-02 13:55 ` [PATCH] shared/att: change security as needed Luiz Augusto von Dentz
2016-03-02 14:04   ` Luiz Augusto von Dentz
     [not found]     ` <CAHFy41-4o+01KSTB1G-FKRLu2Ym9-QBtqhEeWPV0EsR1bWLtvw@mail.gmail.com>
2016-03-02 14:20       ` Luiz Augusto von Dentz
     [not found]         ` <CAHFy418JQ=TW2ZRsSPFe5BFidgnq-kBiempYv=9TviX8uPN-VQ@mail.gmail.com>
2016-03-03 11:55           ` Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456925319-16594-1-git-send-email-josephsih@chromium.org \
    --to=josephsih@chromium.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.von.dentz@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).