[PATCH] Fix ATT error code response for authentication

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

 



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

--
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