* [PATCH] Fix ATT error code response for authentication
@ 2011-03-22 20:51 Claudio Takahasi
2011-03-23 13:07 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Claudio Takahasi @ 2011-03-22 20:51 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
This patch fix the error code in the Error Response PDU. If an attribute
requires authentication and the link security level doesn't meet the
requirements the server should reply Insufficient Authentication(0x05).
---
src/attrib-server.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/attrib-server.c b/src/attrib-server.c
index 74a1c8d..9543da6 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -167,11 +167,12 @@ static uint8_t att_check_reqs(struct gatt_channel *channel, uint8_t opcode,
{
/* FIXME: currently, it is assumed an encrypted link is enough for
* authentication. This will allow to enable the SMP negotiation once
- * it is on upstream kernel. */
+ * it is on upstream kernel. High security level should be mapped
+ * to authentication and medium to encryption permission. */
if (!channel->encrypted)
channel->encrypted = g_attrib_is_encrypted(channel->attrib);
if (reqs == ATT_AUTHENTICATION && !channel->encrypted)
- return ATT_ECODE_INSUFF_ENC;
+ return ATT_ECODE_INSUFF_AUTHEN;
switch (opcode) {
case ATT_OP_READ_BY_GROUP_REQ:
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix ATT error code response for authentication
2011-03-22 20:51 [PATCH] Fix ATT error code response for authentication Claudio Takahasi
@ 2011-03-23 13:07 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2011-03-23 13:07 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
Hi Claudio,
On Tue, Mar 22, 2011, Claudio Takahasi wrote:
> This patch fix the error code in the Error Response PDU. If an attribute
> requires authentication and the link security level doesn't meet the
> requirements the server should reply Insufficient Authentication(0x05).
> ---
> src/attrib-server.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
Pushed upstream. Thanks.
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-23 13:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-22 20:51 [PATCH] Fix ATT error code response for authentication Claudio Takahasi
2011-03-23 13:07 ` Johan Hedberg
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).