From 28a755273c28a4acc374829b82ec42f86ee08eca Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 23 Mar 2011 16:40:11 -0300 Subject: [PATCH] Return an error if the attribute requires authorization If an attribute requires authorization, Insuficient Authorization will be returned by the attribute server until the Agent supports a method to authorize attribute access. --- src/attrib-server.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/attrib-server.c b/src/attrib-server.c index 9543da6de..dc05d7edf 100644 --- a/src/attrib-server.c +++ b/src/attrib-server.c @@ -173,6 +173,8 @@ static uint8_t att_check_reqs(struct gatt_channel *channel, uint8_t opcode, channel->encrypted = g_attrib_is_encrypted(channel->attrib); if (reqs == ATT_AUTHENTICATION && !channel->encrypted) return ATT_ECODE_INSUFF_AUTHEN; + else if (reqs == ATT_AUTHORIZATION) + return ATT_ECODE_INSUFF_AUTHO; switch (opcode) { case ATT_OP_READ_BY_GROUP_REQ: -- 2.47.3