Skip to contentSkip to conversation

LE Kernel (bluetooth-le-2.6) and LE Security Manager

DISCUSSION Brian Gix 5 participants 18 messages Dec 3, 2010 – Jan 29, 2011 Bluetooth drivers

lore
Share & tools
lore

Brian Gix

author
#0 lore raw

Hi Claudio, Johan & All,

Is this LE capable kernel that Ville is working on, the development stream for the LE Security Manager?  And if so, is it in a partial fleshed out state?

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/vtervo/bluetooth-le-2.6.git

Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

#1 lore raw

Hi Brian,

Quoted 6 lines · Brian Gix

Hi Claudio, Johan & All,

Is this LE capable kernel that Ville is working on, the development stream for the LE Security Manager?  And if so, is it in a partial fleshed out state?

There is a simple implementation of SMP here[1] on my "devel" branch. I am cleaning it up for sending it for review.

If you want to help, have any comments or just want to tell us what you are working on, please drop by #bluez on freenode, or send an email.

Quoted 10 lines
Quoted 2 lines

git://git.kernel.org/pub/scm/linux/kernel/git/vtervo/bluetooth-le-2.6.git

Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Cheers,

Signature · 3 lines
Vinicius

[1] git://git.infradead.org/users/vcgomes/linux-2.6.git 
author
#2 lore raw

Hi Vinicius & Gustavo,

-----Original Message-----
From: Vinicius Costa Gomes [mailto:[email protected]]
Sent: 03 December, 2010 2:06 PM
To: Brian Gix
Cc: [email protected]
Subject: Re: LE Kernel (bluetooth-le-2.6) and LE Security Manager

Hi Brian,

Quoted 6 lines · Brian Gix

Hi Claudio, Johan & All,

Is this LE capable kernel that Ville is working on, the development stream for the LE Security Manager?  And if so, is it in a partial fleshed out state?

There is a simple implementation of SMP here[1] on my "devel" branch. I am cleaning it up for sending it for review.

If you want to help, have any comments or just want to tell us what you are working on, please drop by #bluez on freenode, or send an email.

[Gix] Unfortunately, I can't access git.infradead.org. Gustavo, would it be possible for you to pull Vinicius' devel branch from
git://git.infradead.org/users/vcgomes/linux-2.6.git to an le-devel branch on your bluetooth-testing repository?

[Gix] I am trying to integrate Qualcomm's latest LE capable (BR/EDR/LE) chipset with bluez. Additionally, I do have a working non-open-source [Gix] host which has had it's LE Security Manager UPF tested, which I hope to be able to use to help test/solidify the bluez version.

Quoted 2 lines
Quoted 2 lines

git://git.kernel.org/pub/scm/linux/kernel/git/vtervo/bluetooth-le-2.6.git

Quoted 10 lines

Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"

in

Quoted 2 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Cheers,

Signature · 3 lines
Vinicius

[1] git://git.infradead.org/users/vcgomes/linux-2.6.git 
#3 lore raw

Hi Brian,

Quoted 25 lines · Brian Gix

Hi Vinicius & Gustavo,

-----Original Message-----
From: Vinicius Costa Gomes [mailto:[email protected]]
Sent: 03 December, 2010 2:06 PM
To: Brian Gix
Cc: [email protected]
Subject: Re: LE Kernel (bluetooth-le-2.6) and LE Security Manager

Hi Brian,

Quoted 6 lines · Brian Gix

Hi Claudio, Johan & All,

Is this LE capable kernel that Ville is working on, the development stream for the LE Security Manager?  And if so, is it in a partial fleshed out state?

There is a simple implementation of SMP here[1] on my "devel" branch. I am cleaning it up for sending it for review.

Quoted 8 lines

If you want to help, have any comments or just want to tell us what you are working on, please drop by #bluez on freenode, or send an email.

[Gix] Unfortunately, I can't access git.infradead.org. Gustavo, would it be possible for you to pull Vinicius' devel branch from
git://git.infradead.org/users/vcgomes/linux-2.6.git to an le-devel branch on your bluetooth-testing repository?

Sorry for the delay.

I pushed a copy to gitorious:

http://gitorious.org/bluetooth-next branch devel.

Quoted 17 lines

[Gix] I am trying to integrate Qualcomm's latest LE capable (BR/EDR/LE) chipset with bluez. Additionally, I do have a working non-open-source [Gix] host which has had it's LE Security Manager UPF tested, which I hope to be able to use to help test/solidify the bluez version.

Quoted 2 lines
Quoted 2 lines

git://git.kernel.org/pub/scm/linux/kernel/git/vtervo/bluetooth-le-2.6.git

Quoted 8 lines

Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

Quoted 17 lines
Quoted 2 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"

in

Quoted 2 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Cheers,

Signature · 8 lines
Vinicius

[1] git://git.infradead.org/users/vcgomes/linux-2.6.git 

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Cheers,

Signature · 1 line
Vinicius
author
#4 lore raw
In reply to Vinicius Costa Gomes

Hi Vinicius,

I am sorry that it has taken so long to test the snapshot that you placed on gitorious, but I have now done so.

Quoted 10 lines · Vinicius Costa Gomes

Hi Brian,

Quoted 6 lines · Brian Gix

Hi Claudio, Johan & All,

Is this LE capable kernel that Ville is working on, the development stream for the LE Security Manager? And if so, is it in a partial fleshed out state?

Quoted 5 lines

There is a simple implementation of SMP here[1] on my "devel" branch. I am cleaning it up for sending it for review.

If you want to help, have any comments or just want to tell us what you are working on, please drop by #bluez on freenode, or send an email.

I have been able to verify that the Just Works negotiation of the Short Term Key does work against an independent implementation of the LE Security Manager, as long as I have requested no MITM protection. I have the following comments:

1. You currently reject security if I *do* request MITM protection. This should not be done. The correct functionality should be to continue the negotiation. Even though I requested MITM, it will be clear to both sides that JUST_WORKS methodology has been used, and so when the Keys are generated and exchanged, both sides will indicate in their Key Database that they are no-MITM keys. If I then actually *needed* MITM protection, then whatever functionality requiring that level of security will fail with an insufficient security error code. However, security should *never* be rejected unless there is a fundamental incompatibility such as no level of security actually supported. This is the only functionality that I found to be actually incorrect.

2. Currently, you are not exchanging any permanent keys, which I am sure you are aware. This makes it impossible to test much else, such as command signing, or security requests that use the generated keys.

If you have a later version of SM that could be uploaded to your devel branch on gitorious, I would be more than happy (and in fact would love to be able) to test that for you as well.

This is the git configuration I used for testing, which only has your SM up to the end of last December, and is so about a month old:

remote.origin.url=git://gitorious.org/bluetooth-next/bluetooth-next.git branch.devel.remote=origin branch.devel.merge=refs/heads/devel

Thanks for doing the SM,

Signature · 4 lines
Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
#5 lore raw

Hi,

Quoted 27 lines · Brian Gix

Hi Vinicius,

I am sorry that it has taken so long to test the snapshot that you placed on gitorious, but I have now done so.

Quoted 10 lines · Vinicius Costa Gomes

Hi Brian,

Quoted 6 lines · Brian Gix

Hi Claudio, Johan & All,

Is this LE capable kernel that Ville is working on, the development stream for the LE Security Manager?  And if so, is it in a partial fleshed out state?

Quoted 5 lines

There is a simple implementation of SMP here[1] on my "devel" branch. I am cleaning it up for sending it for review.

If you want to help, have any comments or just want to tell us what you are working on, please drop by #bluez on freenode, or send an email.

I have been able to verify that the Just Works negotiation of the Short Term Key does work against an independent implementation of the LE Security Manager, as long as I have requested no MITM protection.  I have the following comments:

Quoted 12 lines

1. You currently reject security if I *do* request MITM protection. This should not be done.  The correct functionality should be to continue the negotiation.  Even though I requested MITM, it will be clear to both sides that JUST_WORKS methodology has been used, and so when the Keys are generated and exchanged, both sides will indicate in their Key Database that they are no-MITM keys. If I then actually *needed* MITM protection, then whatever functionality requiring that level of security will fail with an insufficient security error code. However, security should *never* be rejected unless there is a fundamental incompatibility such as no level of security actually supported.  This is the only functionality that I found to be actually incorrect.

But the point of MITM is man in the middle protection, so if we end up with a key which is not MITM there is no protection why store the link key? Actually if we do that we can end up in a situation where insufficient security is always triggered and the other stack may attempt to repair but with current code it will never succeed to generate a valid MITM link key. Anyway I suppose supporting MITM is mandatory so obviously the only possible fix for this is to support MITM.

Quoted 29 lines

2. Currently, you are not exchanging any permanent keys, which I am sure you are aware.  This makes it impossible to test much else, such as command signing, or security requests that use the generated keys.

If you have a later version of SM that could be uploaded to your devel branch on gitorious, I would be more than happy (and in fact would love to be able) to test that for you as well.

This is the git configuration I used for testing, which only has your SM up to the end of last December, and is so about a month old:

remote.origin.url=git://gitorious.org/bluetooth-next/bluetooth-next.git branch.devel.remote=origin branch.devel.merge=refs/heads/devel

Thanks for doing the SM,

--
Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Luiz Augusto von Dentz
Computer Engineer
author
#6 lore raw

Hi Luiz,

Quoted 5 lines · Luiz Augusto von Dentz

Hi,

Quoted 2 lines · Brian Gix

Hi Vinicius,

[...]

Quoted 14 lines
Quoted 13 lines

1. You currently reject security if I *do* request MITM protection. This should not be done. The correct functionality should be to continue the negotiation. Even though I requested MITM, it will be clear to both sides that JUST_WORKS methodology has been used, and so when the Keys are generated and exchanged, both sides will indicate in their Key Database that they are no-MITM keys. If I then actually *needed* MITM protection, then whatever functionality requiring that level of security will fail with an insufficient security error code. However, security should *never* be rejected unless there is a fundamental incompatibility such as no level of security actually supported. This is the only functionality that I found to be actually incorrect.

Quoted 8 lines

But the point of MITM is man in the middle protection, so if we end up with a key which is not MITM there is no protection why store the link key? Actually if we do that we can end up in a situation where insufficient security is always triggered and the other stack may attempt to repair but with current code it will never succeed to generate a valid MITM link key. Anyway I suppose supporting MITM is mandatory so obviously the only possible fix for this is to support MITM.

The basic use case envisioned is that the two sides do not necessarily know what the other side can support or has available until it attempts this "pairing" operation. So we want to avoid this catch 22:

1. We support MITM but don't know if the other side does, nor if it requires it. With the code I just tested, the remote side (bluez) indicated that it doesn't not support MITM and therefore rejects pairing.

2. However, if we support MITM but don't know if the other side does and we *do not* request MITM, then a remote side that *requires* MITM should reject us for *not* requesting it.

The solution is therefore to *always* request MITM, if you are capable of supporting it. If it turns out that neither side actually needs it, then there is no harm in having provided it. If one side does not support it (as bluez currently does not) and the other side requires it, then it is up to the side that *requested* MITM to reject the pairing attempt, if it determines that MITM is required.

A low security device like the current bluez should *never* reject a pairing request because the other side needs MITM. It is up to the side that has the MITM requirement to issue the Security Failure packet.

So until bluez can support MITM, it should *accept* remote requests for MITM, knowing that the remote side may reject it. As long as bluez advertises no OOB and NO_IN_NO_OUT, there will be no MITM. It should just not request MITM, and then provide no way to achieve it.

[...]

Signature · 4 lines
Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
#7 lore raw
In reply to Brian Gix

Hi Brian,

Quoted 27 lines · Brian Gix

Hi Vinicius,

I am sorry that it has taken so long to test the snapshot that you placed on gitorious, but I have now done so.

Quoted 10 lines · Vinicius Costa Gomes

Hi Brian,

Quoted 6 lines · Brian Gix

Hi Claudio, Johan & All,

Is this LE capable kernel that Ville is working on, the development stream for the LE Security Manager? And if so, is it in a partial fleshed out state?

Quoted 5 lines

There is a simple implementation of SMP here[1] on my "devel" branch. I am cleaning it up for sending it for review.

If you want to help, have any comments or just want to tell us what you are working on, please drop by #bluez on freenode, or send an email.

I have been able to verify that the Just Works negotiation of the Short Term Key does work against an independent implementation of the LE Security Manager, as long as I have requested no MITM protection. I have the following comments:

Quoted 13 lines

1. You currently reject security if I *do* request MITM protection. This should not be done. The correct functionality should be to continue the negotiation. Even though I requested MITM, it will be clear to both sides that JUST_WORKS methodology has been used, and so when the Keys are generated and exchanged, both sides will indicate in their Key Database that they are no-MITM keys. If I then actually *needed* MITM protection, then whatever functionality requiring that level of security will fail with an insufficient security error code. However, security should *never* be rejected unless there is a fundamental incompatibility such as no level of security actually supported. This is the only functionality that I found to be actually incorrect.

I was assuming that the meaning of setting the MITM protection bit, was that it was *requiring* MITM protection, and when that couldn't be fulfilled the Pairing Request should be rejected.

So my assumption was incorrect, going to fix it soon.

Quoted 4 lines

2. Currently, you are not exchanging any permanent keys, which I am sure you are aware. This makes it impossible to test much else, such as command signing, or security requests that use the generated keys.

This is being worked on, but nothing ready for testing yet.

Quoted 7 lines

If you have a later version of SM that could be uploaded to your devel branch on gitorious, I would be more than happy (and in fact would love to be able) to test that for you as well.

This is the git configuration I used for testing, which only has your SM up to the end of last December, and is so about a month old:

Quoted 13 lines

remote.origin.url=git://gitorious.org/bluetooth-next/bluetooth-next.git branch.devel.remote=origin branch.devel.merge=refs/heads/devel

Thanks for doing the SM,

Signature · 4 lines
Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

Cheers,

Signature · 1 line
Vinicius
#8 lore raw

Hi Vinicius,

Quoted 44 lines · Vinicius Costa Gomes

Hi Brian,

Quoted 27 lines · Brian Gix

Hi Vinicius,

I am sorry that it has taken so long to test the snapshot that you placed on gitorious, but I have now done so.

Quoted 10 lines · Vinicius Costa Gomes

Hi Brian,

Quoted 6 lines · Brian Gix

Hi Claudio, Johan & All,

Is this LE capable kernel that Ville is working on, the development stream for the LE Security Manager?  And if so, is it in a partial fleshed out state?

Quoted 5 lines

There is a simple implementation of SMP here[1] on my "devel" branch. I am cleaning it up for sending it for review.

If you want to help, have any comments or just want to tell us what you are working on, please drop by #bluez on freenode, or send an email.

I have been able to verify that the Just Works negotiation of the Short Term Key does work against an independent implementation of the LE Security Manager, as long as I have requested no MITM protection.  I have the following comments:

Quoted 13 lines

1. You currently reject security if I *do* request MITM protection. This should not be done.  The correct functionality should be to continue the negotiation.  Even though I requested MITM, it will be clear to both sides that JUST_WORKS methodology has been used, and so when the Keys are generated and exchanged, both sides will indicate in their Key Database that they are no-MITM keys. If I then actually *needed* MITM protection, then whatever functionality requiring that level of security will fail with an insufficient security error code. However, security should *never* be rejected unless there is a fundamental incompatibility such as no level of security actually supported.  This is the only functionality that I found to be actually incorrect.

Quoted 5 lines

I was assuming that the meaning of setting the MITM protection bit, was that it was *requiring* MITM protection, and when that couldn't be fulfilled the Pairing Request should be rejected.

So my assumption was incorrect, going to fix it soon.

Well the spec says it is a requirement:

"If the STK generation method does not result in an STK that provides sufficient security properties then the device shall send the Pairing Failed command with the error code “Authentication Requirements”" - 2.3.5.1 Selecting STK Generation Method - Page 608

In my interpretation this is exactly what should happen when MITM is set but there is no way to generate an authenticated key as Table 2.4:
Mapping of IO Capabilities to STK Generation Method suggest, in other words if one of sides has NoInputNoOutput and MITM is set we should return "Authentication Requirements" error.

Signature · 2 lines
Luiz Augusto von Dentz
Computer Engineer
author
#9 lore raw
Quoted 52 lines · Luiz Augusto von Dentz

Hi Vinicius,

Quoted 48 lines · Vinicius Costa Gomes

Hi Brian,

Quoted 27 lines · Brian Gix

Hi Vinicius,

I am sorry that it has taken so long to test the snapshot that you placed on gitorious, but I have now done so.

Quoted 10 lines · Vinicius Costa Gomes

Hi Brian,

Quoted 6 lines · Brian Gix

Hi Claudio, Johan & All,

Is this LE capable kernel that Ville is working on, the development stream for the LE Security Manager? And if so, is it in a partial fleshed out state?

Quoted 5 lines

There is a simple implementation of SMP here[1] on my "devel" branch. I am cleaning it up for sending it for review.

If you want to help, have any comments or just want to tell us what you are working on, please drop by #bluez on freenode, or send an email.

I have been able to verify that the Just Works negotiation of the Short Term Key does work against an independent implementation of the LE Security Manager, as long as I have requested no MITM protection. I have the following comments:

Quoted 13 lines

1. You currently reject security if I *do* request MITM protection. This should not be done. The correct functionality should be to continue the negotiation. Even though I requested MITM, it will be clear to both sides that JUST_WORKS methodology has been used, and so when the Keys are generated and exchanged, both sides will indicate in their Key Database that they are no-MITM keys. If I then actually *needed* MITM protection, then whatever functionality requiring that level of security will fail with an insufficient security error code. However, security should *never* be rejected unless there is a fundamental incompatibility such as no level of security actually supported. This is the only functionality that I found to be actually incorrect.

I was assuming that the meaning of setting the MITM protection bit, was that it was *requiring* MITM protection, and when that couldn't be fulfilled the Pairing Request should be rejected.

Quoted 10 lines
Quoted 1 line

So my assumption was incorrect, going to fix it soon.

Well the spec says it is a requirement:

"If the STK generation method does not result in an STK that provides sufficient security properties then the device shall send the Pairing Failed command with the error code “Authentication Requirements”" - 2.3.5.1 Selecting STK Generation Method - Page 608

Quoted 1 line

From Page 607:

"If both devices have out of band authentication data, then the Authentication Requirements Flags shall be ignored when selecting the pairing method and the Out of Band pairing method shall be used. If both devices have not set the MITM option in the Authentication Requirements Flags, then the IO capabilities shall be ignored and the Just Works association model shall be used. Otherwise the IO capabilities of the devices shall be used to determine the pairing method as defined in Table 2.4."

In the test case I ran, only One device (i.e. NOT BOTH) had the MITM option set. So my reading is that the IO Capabilities should be ignored, and JUST_WORKS used.

Remember the phone use case: When it needs to pair with a remote device, it is usually a GATT client that can support any level of security. It does not know if this new remote device requires MITM security, or No security. However as the link Master and Initiator, it has to choose one. It Chooses MITM, and if the remote side supports MITM, then pairing proceeds with a resulting MITM protection level. If the remote device is a simple dumb device with no security, it also needs to proceed without failing, but this time it completes with NO-MITM as the protection level. If it fails because the remote doesn't require security, then there is a fundamental incompatibility between the devices, which in the SIG we have tried to avoid.

Quoted 7 lines

In my interpretation this is exactly what should happen when MITM is set but there is no way to generate an authenticated key as Table 2.4:
Mapping of IO Capabilities to STK Generation Method suggest, in other words if one of sides has NoInputNoOutput and MITM is set we should return "Authentication Requirements" error.

Signature · 4 lines
Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
author
#10 lore raw

Hi Luiz & Vinicius,

Quoted 53 lines · Brian Gix
Quoted 52 lines · Luiz Augusto von Dentz

Hi Vinicius,

Quoted 48 lines · Vinicius Costa Gomes

Hi Brian,

Quoted 27 lines · Brian Gix

Hi Vinicius,

I am sorry that it has taken so long to test the snapshot that you placed on gitorious, but I have now done so.

Quoted 10 lines · Vinicius Costa Gomes

Hi Brian,

Quoted 6 lines · Brian Gix

Hi Claudio, Johan & All,

Is this LE capable kernel that Ville is working on, the development stream for the LE Security Manager? And if so, is it in a partial fleshed out state?

Quoted 5 lines

There is a simple implementation of SMP here[1] on my "devel" branch. I am cleaning it up for sending it for review.

If you want to help, have any comments or just want to tell us what you are working on, please drop by #bluez on freenode, or send an email.

I have been able to verify that the Just Works negotiation of the Short Term Key does work against an independent implementation of the LE Security Manager, as long as I have requested no MITM protection. I have the following comments:

Quoted 13 lines

1. You currently reject security if I *do* request MITM protection. This should not be done. The correct functionality should be to continue the negotiation. Even though I requested MITM, it will be clear to both sides that JUST_WORKS methodology has been used, and so when the Keys are generated and exchanged, both sides will indicate in their Key Database that they are no-MITM keys. If I then actually *needed* MITM protection, then whatever functionality requiring that level of security will fail with an insufficient security error code. However, security should *never* be rejected unless there is a fundamental incompatibility such as no level of security actually supported. This is the only functionality that I found to be actually incorrect.

I was assuming that the meaning of setting the MITM protection bit, was that it was *requiring* MITM protection, and when that couldn't be fulfilled the Pairing Request should be rejected.

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

So my assumption was incorrect, going to fix it soon.

Well the spec says it is a requirement:

"If the STK generation method does not result in an STK that provides sufficient security properties then the device shall send the Pairing Failed command with the error code “Authentication Requirements”" - 2.3.5.1 Selecting STK Generation Method - Page 608

My interpretation of the paragraph at the end of page 608 is that if a device realizes that the security level that will results will not meet it's minimum security requirements, then it may reject and abort the pairing.

I think it is a bad reading, though, for a device to reject a pairing if it thinks that the *other* device will not be satisfied. However that is the case here. In this case, it was the device that did *not* have the MITM option set (the low security device) that was rejecting the device *with* the MITM option set.

Quoted 35 lines
Quoted 2 lines

From Page 607:

"If both devices have out of band authentication data, then the Authentication Requirements Flags shall be ignored when selecting the pairing method and the Out of Band pairing method shall be used. If both devices have not set the MITM option in the Authentication Requirements Flags, then the IO capabilities shall be ignored and the Just Works association model shall be used. Otherwise the IO capabilities of the devices shall be used to determine the pairing method as defined in Table 2.4."

In the test case I ran, only One device (i.e. NOT BOTH) had the MITM option set. So my reading is that the IO Capabilities should be ignored, and JUST_WORKS used.

Remember the phone use case: When it needs to pair with a remote device, it is usually a GATT client that can support any level of security. It does not know if this new remote device requires MITM security, or No security. However as the link Master and Initiator, it has to choose one. It Chooses MITM, and if the remote side supports MITM, then pairing proceeds with a resulting MITM protection level. If the remote device is a simple dumb device with no security, it also needs to proceed without failing, but this time it completes with NO-MITM as the protection level. If it fails because the remote doesn't require security, then there is a fundamental incompatibility between the devices, which in the SIG we have tried to avoid.

Quoted 7 lines

In my interpretation this is exactly what should happen when MITM is set but there is no way to generate an authenticated key as Table 2.4:
Mapping of IO Capabilities to STK Generation Method suggest, in other words if one of sides has NoInputNoOutput and MITM is set we should return "Authentication Requirements" error.

Signature · 4 lines
Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
#11 lore raw
In reply to Brian Gix

Hi Brian,

Quoted 10 lines · Brian Gix
Quoted 1 line

From Page 607:

"If both devices have out of band authentication data, then the Authentication Requirements Flags shall be ignored when selecting the pairing method and the Out of Band pairing method shall be used. If both devices have not set the MITM option in the Authentication Requirements Flags, then the IO capabilities shall be ignored and the Just Works association model shall be used. Otherwise the IO capabilities of the devices shall be used to determine the pairing method as defined in Table 2.4."

Quoted 3 lines

In the test case I ran, only One device (i.e. NOT BOTH) had the MITM option set. So my reading is that the IO Capabilities should be ignored, and JUST_WORKS used.

It certainly is an unusual form of English. It's saying "If both devices have <x>", i.e. the condition <x> needs to be fulfilled by both devices for the statement to be true. In this case the condition is "not set the MITM option", i.e. both devices need to fulfill the condition "not set the MITM option". Doesn't that then mean that it's not enough for one device to not set the MITM flag, but both devices need to have it unset for just-works to take place?

Johan

author
#12 lore raw

Hi Johan,

Quoted 17 lines · Johan Hedberg

Hi Brian,

Quoted 10 lines · Brian Gix
Quoted 1 line

From Page 607:

"If both devices have out of band authentication data, then the Authentication Requirements Flags shall be ignored when selecting the pairing method and the Out of Band pairing method shall be used. If both devices have not set the MITM option in the Authentication Requirements Flags, then the IO capabilities shall be ignored and the Just Works association model shall be used. Otherwise the IO capabilities of the devices shall be used to determine the pairing method as defined in Table 2.4."

Quoted 3 lines

In the test case I ran, only One device (i.e. NOT BOTH) had the MITM option set. So my reading is that the IO Capabilities should be ignored, and JUST_WORKS used.

Quoted 7 lines

It certainly is an unusual form of English. It's saying "If both devices have <x>", i.e. the condition <x> needs to be fulfilled by both devices for the statement to be true. In this case the condition is "not set the MITM option", i.e. both devices need to fulfill the condition "not set the MITM option". Doesn't that then mean that it's not enough for one device to not set the MITM flag, but both devices need to have it unset for just-works to take place?

Yes, it is very unfortunate and awkward English.

I am going to look for any errata that might be more explicit, so that an absolute truth table based on: MITM, OOB, and IO-Caps can be constructed.

But the Truth table as I understood it from conversations at UPFs and WGs and in my notes was:

1. If BOTH devices have OOB available, it is used and results in MITM
2. If NEITHER device wants MITM, JUST_WORKS used resulting in no MITM 3, If One or more want MITM, the IO Caps Table 2.4 on page 608 is used and MAY or MAY NOT result in MITM.

In every case, MITM outcome is known, and propagated up the stack.

I have nothing to prove this, but it appears to be what the mature stacks were using at UPF in Barcelona. But it is apparent that the spec is not 100% clear, and that an errata is required to explicitly spell it out.

I am going to either find the errata if it exists, or propose one to the Core Working Group if it doesn't. Whatever the outcome, I will post it here.

Signature · 4 lines
Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
#13 lore raw

Hi,

Quoted 34 lines · Brian Gix

Hi Johan,

Quoted 17 lines · Johan Hedberg

Hi Brian,

Quoted 10 lines · Brian Gix
Quoted 1 line

From Page 607:

"If both devices have out of band authentication data, then the Authentication Requirements Flags shall be ignored when selecting the pairing method and the Out of Band pairing method shall be used. If both devices have not set the MITM option in the Authentication Requirements Flags, then the IO capabilities shall be ignored and the Just Works association model shall be used. Otherwise the IO capabilities of the devices shall be used to determine the pairing method as defined in Table 2.4."

Quoted 3 lines

In the test case I ran, only One device (i.e. NOT BOTH) had the MITM option set. So my reading is that the IO Capabilities should be ignored, and JUST_WORKS used.

Quoted 7 lines

It certainly is an unusual form of English. It's saying "If both devices have <x>", i.e. the condition <x> needs to be fulfilled by both devices for the statement to be true. In this case the condition is "not set the MITM option", i.e. both devices need to fulfill the condition "not set the MITM option". Doesn't that then mean that it's not enough for one device to not set the MITM flag, but both devices need to have it unset for just-works to take place?

Yes, it is very unfortunate and awkward English.

I am going to look for any errata that might be more explicit, so that an absolute truth table based on: MITM, OOB, and IO-Caps can be constructed.

Quoted 7 lines

But the Truth table as I understood it from conversations at UPFs and WGs and in my notes was:

1. If BOTH devices have OOB available, it is used and results in MITM
2. If NEITHER device wants MITM, JUST_WORKS used resulting in no MITM 3, If One or more want MITM, the IO Caps Table 2.4 on page 608 is used and MAY or MAY NOT result in MITM.

At least for ssp yapparently you are right that may or may not result on MITM being used, this is the code we use on BlueZ:

        if (*auth == 0x00 || *auth == 0x04) {
                 /* If remote requests dedicated bonding follow that lead */
                 if (device_get_auth(device) == 0x02 ||
                                 device_get_auth(device) == 0x03) {

                         /* If both remote and local IO capabilities allow MITM
                          * then require it, otherwise don't */
                         if (device_get_cap(device) == 0x03 ||
                                                         agent_cap == 0x03)
                                *auth = 0x02;
                         else
                                 *auth = 0x03;
                 }

                 /* If remote indicates no bonding then follow that. This
                  * is important since the kernel might give general bonding
                  * as default. */
                 if (device_get_auth(device) == 0x00 ||
                                         device_get_auth(device) == 0x01)
                         *auth = 0x00;

                 /* If remote requires MITM then also require it, unless
                  * our IO capability is NoInputNoOutput (so some
                  * just-works security cases can be tested) */
                 if (device_get_auth(device) != 0xff &&
                                         (device_get_auth(device) & 0x01) &&
                                         agent_cap != 0x03)
                         *auth |= 0x01;
         }

So we only set MITM if the other side also support it, hopefully it works the same way on LE. I still think it is a waste of time for no bonding case to use just-works when MITM was marked as required by one of parties, but I guess pretty everybody does that way.

Quoted 10 lines

In every case, MITM outcome is known, and propagated up the stack.

I have nothing to prove this, but it appears to be what the mature stacks were using at UPF in Barcelona. But it is apparent that the spec is not 100% clear, and that an errata is required to explicitly spell it out.

I am going to either find the errata if it exists, or propose one to the Core Working Group if it doesn't. Whatever the outcome, I will post it here.

Signature · 2 lines
Luiz Augusto von Dentz
Computer Engineer
author
#14 lore raw

Hi Luiz & all,

Quoted 78 lines · Luiz Augusto von Dentz

Hi,

Quoted 34 lines · Brian Gix

Hi Johan,

Quoted 17 lines · Johan Hedberg

Hi Brian,

Quoted 10 lines · Brian Gix
Quoted 1 line

From Page 607:

"If both devices have out of band authentication data, then the Authentication Requirements Flags shall be ignored when selecting the pairing method and the Out of Band pairing method shall be used. If both devices have not set the MITM option in the Authentication Requirements Flags, then the IO capabilities shall be ignored and the Just Works association model shall be used. Otherwise the IO capabilities of the devices shall be used to determine the pairing method as defined in Table 2.4."

Quoted 3 lines

In the test case I ran, only One device (i.e. NOT BOTH) had the MITM option set. So my reading is that the IO Capabilities should be ignored, and JUST_WORKS used.

Quoted 7 lines

It certainly is an unusual form of English. It's saying "If both devices have <x>", i.e. the condition <x> needs to be fulfilled by both devices for the statement to be true. In this case the condition is "not set the MITM option", i.e. both devices need to fulfill the condition "not set the MITM option". Doesn't that then mean that it's not enough for one device to not set the MITM flag, but both devices need to have it unset for just-works to take place?

Yes, it is very unfortunate and awkward English.

I am going to look for any errata that might be more explicit, so that an absolute truth table based on: MITM, OOB, and IO-Caps can be constructed.

Quoted 7 lines

But the Truth table as I understood it from conversations at UPFs and WGs and in my notes was:

1. If BOTH devices have OOB available, it is used and results in MITM
2. If NEITHER device wants MITM, JUST_WORKS used resulting in no MITM 3, If One or more want MITM, the IO Caps Table 2.4 on page 608 is used and MAY or MAY NOT result in MITM.

At least for ssp yapparently you are right that may or may not result on MITM being used, this is the code we use on BlueZ:

        if (*auth == 0x00 || *auth == 0x04) {
                 /* If remote requests dedicated bonding follow that lead */
                 if (device_get_auth(device) == 0x02 ||
                                 device_get_auth(device) == 0x03) {

                         /* If both remote and local IO capabilities allow MITM
                          * then require it, otherwise don't */
                         if (device_get_cap(device) == 0x03 ||
                                                         agent_cap == 0x03)
                                *auth = 0x02;
                         else
                                 *auth = 0x03;
                 }

                 /* If remote indicates no bonding then follow that. This
                  * is important since the kernel might give general bonding
                  * as default. */
                 if (device_get_auth(device) == 0x00 ||
                                         device_get_auth(device) == 0x01)
                         *auth = 0x00;

                 /* If remote requires MITM then also require it, unless
                  * our IO capability is NoInputNoOutput (so some
                  * just-works security cases can be tested) */
                 if (device_get_auth(device) != 0xff &&
                                         (device_get_auth(device) & 0x01) &&
                                         agent_cap != 0x03)
                         *auth |= 0x01;
         }
Quoted 15 lines

So we only set MITM if the other side also support it, hopefully it works the same way on LE. I still think it is a waste of time for no bonding case to use just-works when MITM was marked as required by one of parties, but I guess pretty everybody does that way.

Quoted 10 lines

In every case, MITM outcome is known, and propagated up the stack.

I have nothing to prove this, but it appears to be what the mature stacks were using at UPF in Barcelona. But it is apparent that the spec is not 100% clear, and that an errata is required to explicitly spell it out.

I am going to either find the errata if it exists, or propose one to the Core Working Group if it doesn't. Whatever the outcome, I will post it here.

I have filed errata #4249. This errata can be looked up on bluetooth.org in the specifications area under number:
"4249"
title:
"Clarification of STK generation"
Part:
"Security Manager 4.0"
Paragraph:
"2.3.5.1 Selecting STK Generation Method"

The Core Working Group (CWG) is meeting this week in Israel, and our guy on the group, Brian Redding, has told me that he will try to get some face time for it. So in the next day or two, we could either get a definitive statement, or at least a few comments. If you don't have access to the BT Sigs errata system, let me know & I will copy the errata here.

Quoted 2 lines
Signature · 4 lines
Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
author
#15 lore raw

Hi Luiz, Vinicius & all,

Quoted 97 lines · Brian Gix

Hi Luiz & all,

Quoted 78 lines · Luiz Augusto von Dentz

Hi,

Quoted 34 lines · Brian Gix

Hi Johan,

Quoted 17 lines · Johan Hedberg

Hi Brian,

Quoted 10 lines · Brian Gix
Quoted 1 line

From Page 607:

"If both devices have out of band authentication data, then the Authentication Requirements Flags shall be ignored when selecting the pairing method and the Out of Band pairing method shall be used. If both devices have not set the MITM option in the Authentication Requirements Flags, then the IO capabilities shall be ignored and the Just Works association model shall be used. Otherwise the IO capabilities of the devices shall be used to determine the pairing method as defined in Table 2.4."

Quoted 3 lines

In the test case I ran, only One device (i.e. NOT BOTH) had the MITM option set. So my reading is that the IO Capabilities should be ignored, and JUST_WORKS used.

Quoted 7 lines

It certainly is an unusual form of English. It's saying "If both devices have <x>", i.e. the condition <x> needs to be fulfilled by both devices for the statement to be true. In this case the condition is "not set the MITM option", i.e. both devices need to fulfill the condition "not set the MITM option". Doesn't that then mean that it's not enough for one device to not set the MITM flag, but both devices need to have it unset for just-works to take place?

Yes, it is very unfortunate and awkward English.

I am going to look for any errata that might be more explicit, so that an absolute truth table based on: MITM, OOB, and IO-Caps can be constructed.

Quoted 7 lines

But the Truth table as I understood it from conversations at UPFs and WGs and in my notes was:

1. If BOTH devices have OOB available, it is used and results in MITM
2. If NEITHER device wants MITM, JUST_WORKS used resulting in no MITM 3, If One or more want MITM, the IO Caps Table 2.4 on page 608 is used and MAY or MAY NOT result in MITM.

At least for ssp yapparently you are right that may or may not result on MITM being used, this is the code we use on BlueZ:

        if (*auth == 0x00 || *auth == 0x04) {
                 /* If remote requests dedicated bonding follow that lead */
                 if (device_get_auth(device) == 0x02 ||
                                 device_get_auth(device) == 0x03) {

                         /* If both remote and local IO capabilities allow MITM
                          * then require it, otherwise don't */
                         if (device_get_cap(device) == 0x03 ||
                                                         agent_cap == 0x03)
                                *auth = 0x02;
                         else
                                 *auth = 0x03;
                 }

                 /* If remote indicates no bonding then follow that. This
                  * is important since the kernel might give general bonding
                  * as default. */
                 if (device_get_auth(device) == 0x00 ||
                                         device_get_auth(device) == 0x01)
                         *auth = 0x00;

                 /* If remote requires MITM then also require it, unless
                  * our IO capability is NoInputNoOutput (so some
                  * just-works security cases can be tested) */
                 if (device_get_auth(device) != 0xff &&
                                         (device_get_auth(device) & 0x01) &&
                                         agent_cap != 0x03)
                         *auth |= 0x01;
         }
Quoted 15 lines

So we only set MITM if the other side also support it, hopefully it works the same way on LE. I still think it is a waste of time for no bonding case to use just-works when MITM was marked as required by one of parties, but I guess pretty everybody does that way.

Quoted 10 lines

In every case, MITM outcome is known, and propagated up the stack.

I have nothing to prove this, but it appears to be what the mature stacks were using at UPF in Barcelona. But it is apparent that the spec is not 100% clear, and that an errata is required to explicitly spell it out.

I am going to either find the errata if it exists, or propose one to the Core Working Group if it doesn't. Whatever the outcome, I will post it here.

Quoted 9 lines

I have filed errata #4249. This errata can be looked up on bluetooth.org in the specifications area under number:
"4249"
title:
"Clarification of STK generation"
Part:
"Security Manager 4.0"
Paragraph:
"2.3.5.1 Selecting STK Generation Method"

I got a response from Steven Wenhem of CSR and the CSWG and he offered the opinion on the errata (4249) that aligns with my understanding of the truth table:

1. If BOTH devices have OOB available, it is used and results in MITM
2. If NEITHER device wants MITM, JUST_WORKS used resulting in no MITM 3, If One or more want MITM, the IO Caps Table 2.4 on page 608 is used and MAY or MAY NOT result in MITM.

Note that this is an opinion only at this point, and has not been approved or adopted. I believe that it is how more than one stack with a more mature SM currently work, though.

Based on other conversations with members of the working group, I believe that it is also generally accepted that a device with weak security requirements (such as JUST WORKS) should *never* Reject the pairing attempt because the remote device requests stronger (MITM) security. It is the responsibility of the Strong Security device to reject the pairing if it will not meet the minimum security requirements of the Strong Security Device.

This principle applies to not only MITM, but also the Key Length, which is specified in the same SM packets. The key length used will be the MIN of the two devices "max key length" field, but either side can reject the pairing if the resulting length is shorter than it's Minimum key length.

But again, these are stated opinions only, and not published (specification) fact.

Signature · 4 lines
Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
#16 lore raw

GATT and D-Bus

In reply to Vinicius Costa Gomes

Hi Vinicus,

Not sure who to ask, but it seems that you are the active contributor to the part of the code that I am interested in :)
I am looking at using D-Bus to talk to GATT just over BR/EDR. The support for that seems to be partially there ( I am working off the current bluez tip). However, in the current code it does not seem possible to get GATT over D-Bus working if the device is not LE. Am I missing something here? Also, I can see that you were sending GATT patches upstream: "[PATCH 00/18] Making GATT a first class citizen", not all of them have been pushed through. Are you planning on re-submitting the changes?

Thank you,

Inga Stotland

[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

#17 lore raw

Re: GATT and D-Bus

Hi Inga,

Quoted 11 lines · Inga Stotland

Hi Vinicus,

Not sure who to ask, but it seems that you are the active contributor to the part of the code that I am interested in :)
I am looking at using D-Bus to talk to GATT just over BR/EDR. The support for that seems to be partially there ( I am working off the current bluez tip). However, in the current code it does not seem possible to get GATT over D-Bus working if the device is not LE. Am I missing something here? Also, I can see that you were sending GATT patches upstream: "[PATCH 00/18] Making GATT a first class citizen", not all of them have been pushed through. Are you planning on re-submitting the changes?

Those patches are already upstream, it was just that the "applied" message came via IRC.

What is missing for the BR/EDR case is that we need to trigger GATT Service Discovery after the SDP Browse, if the Device has the GATT Service Record.

SMP is still taking a lot of my time, that I didn't have the time to go back and solve this issue, but it is still on the top of my todo list ;-)

Quoted 12 lines

Thank you,

Inga Stotland

[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

Cheers,

Signature · 1 line
Vinicius