Thread (2 messages) 2 messages, 2 authors, 2011-03-23

[PATCH] Fix ATT error code response for authentication

STALE5671d

From: Claudio Takahasi <hidden>
Date: 2011-03-22 20:51:21
Subsystem: the rest · Maintainer: Linus Torvalds

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help