linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Return an error if the attribute requires authorization
@ 2011-03-23 19:40 Claudio Takahasi
  2011-03-23 19:40 ` [PATCH] TODO: Add item related to authorization and authentication Claudio Takahasi
  2011-03-24  9:20 ` [PATCH] Return an error if the attribute requires authorization Johan Hedberg
  0 siblings, 2 replies; 4+ messages in thread
From: Claudio Takahasi @ 2011-03-23 19:40 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Claudio Takahasi

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 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/attrib-server.c b/src/attrib-server.c
index 9543da6..dc05d7e 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:
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] TODO: Add item related to authorization and authentication
  2011-03-23 19:40 [PATCH] Return an error if the attribute requires authorization Claudio Takahasi
@ 2011-03-23 19:40 ` Claudio Takahasi
  2011-03-24  9:21   ` Johan Hedberg
  2011-03-24  9:20 ` [PATCH] Return an error if the attribute requires authorization Johan Hedberg
  1 sibling, 1 reply; 4+ messages in thread
From: Claudio Takahasi @ 2011-03-23 19:40 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Claudio Takahasi

---
 TODO |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/TODO b/TODO
index b05cfc0..0e06f99 100644
--- a/TODO
+++ b/TODO
@@ -124,6 +124,15 @@ ATT/GATT
   Priority: Medium
   Complexity: C1
 
+- At the moment authentication and authorization is not supported at the
+  same time, read/write requirements in the attribute server needs to
+  be extended. According to Bluetooth Specification a server shall check
+  authentication and authorization requirements before any other check is
+  performed.
+
+  Priority: Medium
+  Complexity: C1
+
 - ATT/GATT parsing to hcidump. Partially implemented, missing to fix
   multiple advertises in the same event and RSSI.
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Return an error if the attribute requires authorization
  2011-03-23 19:40 [PATCH] Return an error if the attribute requires authorization Claudio Takahasi
  2011-03-23 19:40 ` [PATCH] TODO: Add item related to authorization and authentication Claudio Takahasi
@ 2011-03-24  9:20 ` Johan Hedberg
  1 sibling, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2011-03-24  9:20 UTC (permalink / raw)
  To: Claudio Takahasi; +Cc: linux-bluetooth

Hi Claudio,

On Wed, Mar 23, 2011, Claudio Takahasi wrote:
> 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 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/src/attrib-server.c b/src/attrib-server.c
> index 9543da6..dc05d7e 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:

Pushed upstream. Thanks.

Btw, I'm not really a fan of those "authen" and "autho" short versions.
Since you're already spelling the words out in other defines (e.g.
ATT_AUTHENTICATION) I suppose it'd make sense to do the same for the
error codes as well.

Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] TODO: Add item related to authorization and authentication
  2011-03-23 19:40 ` [PATCH] TODO: Add item related to authorization and authentication Claudio Takahasi
@ 2011-03-24  9:21   ` Johan Hedberg
  0 siblings, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2011-03-24  9:21 UTC (permalink / raw)
  To: Claudio Takahasi; +Cc: linux-bluetooth

Hi Claudio,

On Wed, Mar 23, 2011, Claudio Takahasi wrote:
> ---
>  TODO |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-24  9:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-23 19:40 [PATCH] Return an error if the attribute requires authorization Claudio Takahasi
2011-03-23 19:40 ` [PATCH] TODO: Add item related to authorization and authentication Claudio Takahasi
2011-03-24  9:21   ` Johan Hedberg
2011-03-24  9:20 ` [PATCH] Return an error if the attribute requires authorization 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).