Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Marcin Kraglak <marcin.kraglak@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/4] android/gatt: Change check permissions order
Date: Thu, 12 Jun 2014 13:39:33 +0200	[thread overview]
Message-ID: <1893660.GnYVkntkUv@uw000953> (raw)
In-Reply-To: <1402564106-27044-1-git-send-email-marcin.kraglak@tieto.com>

Hi Marcin,

On Thursday 12 of June 2014 11:08:23 Marcin Kraglak wrote:
> Firstly we should check if characteristic needs MITM permissions,
> and next check for ENCRYPTION permissions. Now remote device can
> increase security to MITM immediatelly (i.e. from sec LOW to HIGH).
> ---
>  android/gatt.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/android/gatt.c b/android/gatt.c
> index 558b203..cfcfd9b 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -4063,14 +4063,14 @@ static uint8_t check_device_permissions(struct gatt_device *device,
>  		if (!(permissions & GATT_PERM_READ))
>  			return ATT_ECODE_READ_NOT_PERM;
>  
> -		if ((permissions & GATT_PERM_READ_ENCRYPTED) &&
> -						sec_level < BT_SECURITY_MEDIUM)
> -			return ATT_ECODE_INSUFF_ENC;
> -
>  		if ((permissions & GATT_PERM_READ_MITM) &&
>  						sec_level < BT_SECURITY_HIGH)
>  			return ATT_ECODE_AUTHENTICATION;
>  
> +		if ((permissions & GATT_PERM_READ_ENCRYPTED) &&
> +						sec_level < BT_SECURITY_MEDIUM)
> +			return ATT_ECODE_INSUFF_ENC;
> +
>  		if (permissions & GATT_PERM_READ_AUTHORIZATION)
>  			return ATT_ECODE_AUTHORIZATION;
>  		break;
> @@ -4081,14 +4081,14 @@ static uint8_t check_device_permissions(struct gatt_device *device,
>  		if (!(permissions & GATT_PERM_WRITE))
>  			return ATT_ECODE_WRITE_NOT_PERM;
>  
> -		if ((permissions & GATT_PERM_WRITE_ENCRYPTED) &&
> -						sec_level < BT_SECURITY_MEDIUM)
> -			return ATT_ECODE_INSUFF_ENC;
> -
>  		if ((permissions & GATT_PERM_WRITE_MITM) &&
>  						sec_level < BT_SECURITY_HIGH)
>  			return ATT_ECODE_AUTHENTICATION;
>  
> +		if ((permissions & GATT_PERM_WRITE_ENCRYPTED) &&
> +						sec_level < BT_SECURITY_MEDIUM)
> +			return ATT_ECODE_INSUFF_ENC;
> +
>  		if (permissions & GATT_PERM_WRITE_AUTHORIZATION)
>  			return ATT_ECODE_AUTHORIZATION;
>  		break;
> 

All patches applied. Thanks.

-- 
Best regards, 
Szymon Janc

      parent reply	other threads:[~2014-06-12 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12  9:08 [PATCH 1/4] android/gatt: Change check permissions order Marcin Kraglak
2014-06-12  9:08 ` [PATCH 2/4] android/gatt: Fix incorrect entry check Marcin Kraglak
2014-06-12  9:08 ` [PATCH 3/4] android/gatt: Set state of pending responses Marcin Kraglak
2014-06-12  9:08 ` [PATCH 4/4] android/pts: Update GAP pts test results Marcin Kraglak
2014-06-12 11:39 ` Szymon Janc [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1893660.GnYVkntkUv@uw000953 \
    --to=szymon.janc@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcin.kraglak@tieto.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox