Re: [PATCH BlueZ 01/12] Add messages to the mgmt interface to handle SMP key storage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johan,

On 11:07 Wed 31 Aug, Johan Hedberg wrote:
> Hi Vinicius,
> 
> On Fri, Aug 19, 2011, Vinicius Costa Gomes wrote:
> > +Load SMP Keys Command
> > +=====================
> > +
> > +	Command Code:		0x001F
> > +	Controller Index:	<controller id>
> > +	Command Parameters:	Debug Keys (1 Octet)
> > +				Key Count (2 Octets)
> > +				Key1 {
> > +					Address (6 Octets)
> > +					Type (1 Octet)
> > +					PIN_Length (1 Octet)
> 
> Isn't the PIN Length completely irrelevant here since the "Passkey
> Entry" pairing method of SSP always requires a 6-digit passkey?

_If_ the Passkey Entry method is used. If Just Works is used, PIN Length
will be zero, and as Carles pointed out, if OOB is used it should be
something else.

> 
> > +					Value (16 Octets)
> > +					[
> > +						Encryption Size (1 Octet)
> > +						Enc. Diversifier (2 Octets)
> > +						Random Number (8 Octets)
> > +					] || [
> > +						Address Type (1 Octet)
> > +					]
> 
> Having unions within mgmt messages starts to push their complexity over
> the level that I feel comfortable with. Would it make sense to instead
> have separate "Load LTKs" and "Load IRKs" commands (though you'd then
> need to have two separate "New LTK" and "New IRK" events too).

Glad that this discussion is happening, as it was not an easy decision
and I made a compromise in favor of adding less messages to the mgmt
protocol (less API) and less lines of code in exchange of adding 
(debatably[1]) more complexity.

One point in favor of this union is that for most the time (if not all) 
userspace doesn't need to know what is inside that union, userspace
will only be storing those keys. 

And there's one more key type, the Connection Signature Resolving Key,
CSRK, used to sign commands, this key type doesn't have any associated
data with it. So it will mean six more messages.

[1] IMHO using new messages will mean just about moving the switch statement
that selects what to do in each key type case nearer to the protocol
level, the complexity will be almost the same, with just more repeated
code.

> 
> Btw, what exactly do you need the Address Type for in the case of IRKs
> and why don't you need it in the case of LTKs?

I am just exporting all the information that I receive from the SMP
messages. That address type is the address type of the _resolved_
address not the address type that was used in the connection that
was used for exchange the keys.

Having the address type along with the LTK would be useful if I could
use it for reconnections, but that's another problem.

> 
> Johan


Cheers,
-- 
Vinicius
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux