From: Szymon Janc <szymon.janc@tieto.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/6] android/gatt: Fix client signed write on encrypted link
Date: Fri, 27 Feb 2015 22:33:18 +0100 [thread overview]
Message-ID: <5319647.NCCsdqgCcL@leonov> (raw)
In-Reply-To: <1425049274-11552-1-git-send-email-szymon.janc@tieto.com>
On Friday 27 of February 2015 16:01:09 Szymon Janc wrote:
> As defined in Core Specification 4.2:
> "If a connection is already encrypted with LE security mode 1, level 2
> or level 3 as defined in [Vol 3] Part C, Section 10.2 then, a Write
> Without Response as defined in Section 4.9.1 shall be used instead of
> a Signed Write Without Response."
> ---
> android/gatt.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/android/gatt.c b/android/gatt.c
> index 53b1983..9e348d7 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -3358,14 +3358,14 @@ static void handle_client_write_characteristic(const
> void *buf, uint16_t len) goto failed;
> }
>
> - if (get_sec_level(conn->device) != BT_SECURITY_LOW) {
> - error("gatt: Cannot write signed on encrypted link");
> - status = HAL_STATUS_FAILED;
> - goto failed;
> - }
> -
> - res = signed_write_cmd(conn->device, ch->ch.value_handle,
> - cmd->value, cmd->len);
> + if (get_sec_level(conn->device) > BT_SECURITY_LOW)
> + res = gatt_write_cmd(conn->device->attrib,
> + ch->ch.value_handle, cmd->value,
> + cmd->len, NULL, NULL);
> + else
> + res = signed_write_cmd(conn->device,
> + ch->ch.value_handle, cmd->value,
> + cmd->len);
> break;
> default:
> error("gatt: Write type %d unsupported", cmd->write_type);
Patches 1-5 are applied.
--
BR
Szymon Janc
prev parent reply other threads:[~2015-02-27 21:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 15:01 [PATCH 1/6] android/gatt: Fix client signed write on encrypted link Szymon Janc
2015-02-27 15:01 ` [PATCH 2/6] android/bluetooth: Store if CSRK is authenticated Szymon Janc
2015-02-27 15:01 ` [PATCH 3/6] android/bluetooth: Add support for CSRK authetication level Szymon Janc
2015-02-27 15:01 ` [PATCH 4/6] android/gatt: Fix check if CSRK is authenticated Szymon Janc
2015-02-27 15:01 ` [PATCH 5/6] android/gatt: Fix error message in signed_write_cmd Szymon Janc
2015-02-27 15:01 ` [PATCH 6/6] shared/att: Fix signed write without transparent signing Szymon Janc
2015-02-27 15:21 ` Michael Janssen
2015-02-27 15:27 ` Szymon Janc
2015-02-27 16:02 ` Luiz Augusto von Dentz
2015-02-27 21:33 ` 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=5319647.NCCsdqgCcL@leonov \
--to=szymon.janc@tieto.com \
--cc=linux-bluetooth@vger.kernel.org \
/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