From: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v2 08/12] Bluetooth: Use the stored LTK for restabilishing security
Date: Mon, 4 Jul 2011 14:51:32 -0300 [thread overview]
Message-ID: <20110704175132.GB20837@piper> (raw)
In-Reply-To: <20110701192852.GH23683@joana>
Hi Gustavo,
On 16:28 Fri 01 Jul, Gustavo F. Padovan wrote:
> * Vinicius Costa Gomes <vinicius.gomes@openbossa.org> [2011-07-01 16:07:43 -0300]:
>
> > Now that it's possible that the exchanged key is present in
> > the link key list, we may be able to estabilish security with
> > an already existing key, without need to perform any SMP
> > procedure.
> >
> > Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
> > ---
> > net/bluetooth/smp.c | 15 +++++++++++++++
> > 1 files changed, 15 insertions(+), 0 deletions(-)
> >
> > diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
> > index 34d236d..191aaec 100644
> > --- a/net/bluetooth/smp.c
> > +++ b/net/bluetooth/smp.c
> > @@ -476,6 +476,20 @@ int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level)
> > authreq = seclevel_to_authreq(sec_level);
> >
> > if (hcon->link_mode & HCI_LM_MASTER) {
> > + struct link_key *key;
> > +
> > + key = hci_find_link_key_type(hcon->hdev, conn->dst,
> > + HCI_LK_SMP_LTK);
> > + if (key) {
> > + struct key_master_id *master = (void *) key->data;
> > +
> > + hci_le_start_enc(hcon, master->ediv, master->rand,
> > + key->val);
> > + goto done;
> > + }
> > + }
> > +
> > + if (hcon->link_mode & HCI_LM_MASTER) {
>
> hey, why do you need this if? it is the same comparison as above.
Nothing too important, just to emphasize that each block is a different
step of the protocol: first we check if we already have an LTK for that
device, then we start the Pairing negotiation. But I fixed this, if I
need to write this email, then the code needed changing ;-) Thanks.
>
> Gustavo
Cheers,
--
Vinicius
next prev parent reply other threads:[~2011-07-04 17:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-01 19:07 [PATCH v2 00/12] Bluetooth: SMP Keys exchange and storage Vinicius Costa Gomes
2011-07-01 19:07 ` [PATCH v2 01/12] Bluetooth: Add support for SMP phase 3 (key distribution) Vinicius Costa Gomes
2011-07-01 19:07 ` [PATCH v2 02/12] Bluetooth: Add new structures for supporting SM key distribution Vinicius Costa Gomes
2011-07-01 19:07 ` [PATCH v2 03/12] Bluetooth: Add functions to manipulate the link key list for SMP Vinicius Costa Gomes
2011-07-01 19:23 ` Gustavo F. Padovan
2011-07-04 17:38 ` Vinicius Costa Gomes
2011-07-06 19:23 ` [PATCH v3 " Vinicius Costa Gomes
2011-07-07 8:09 ` Marcel Holtmann
2011-07-07 21:56 ` Vinicius Costa Gomes
2011-07-01 19:07 ` [PATCH v2 04/12] Bluetooth: Reject an encryption request when the key isn't found Vinicius Costa Gomes
2011-07-01 19:07 ` [PATCH v2 05/12] Bluetooth: Fix SM pairing parameters negotiation Vinicius Costa Gomes
2011-07-01 19:07 ` [PATCH v2 06/12] Bluetooth: Add support for storing the LTK Vinicius Costa Gomes
2011-07-01 19:07 ` [PATCH v2 07/12] Bluetooth: Use the link key list to temporarily store the STK Vinicius Costa Gomes
2011-07-01 19:07 ` [PATCH v2 08/12] Bluetooth: Use the stored LTK for restabilishing security Vinicius Costa Gomes
2011-07-01 19:28 ` Gustavo F. Padovan
2011-07-04 17:51 ` Vinicius Costa Gomes [this message]
2011-07-01 19:07 ` [PATCH v2 09/12] Bluetooth: Remove unused field in hci_conn Vinicius Costa Gomes
2011-07-01 19:07 ` [PATCH v2 10/12] Bluetooth: Add support for communicating keys with userspace Vinicius Costa Gomes
2011-07-01 19:07 ` [PATCH v2 11/12] Bluetooth: Add support for storing the key size Vinicius Costa Gomes
2011-07-01 19:07 ` [PATCH v2 12/12] Bluetooth: Add support for returning the encryption " Vinicius Costa Gomes
2011-07-06 19:24 ` [PATCH v3 08/12] Bluetooth: Use the stored LTK for restabilishing security Vinicius Costa Gomes
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=20110704175132.GB20837@piper \
--to=vinicius.gomes@openbossa.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.