<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pairing, Bonding, and Resolvable Private Address</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94116/pairing-bonding-and-resolvable-private-address</link><description>I’m at the tail end of my project, and I’m turning my focus to the pairing/bonding issue. 
 The project includes a Central/Client device that connects to several Peripheral/Server devices. The Peripheral unit advertises its serial number and the Central</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Dec 2022 09:43:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94116/pairing-bonding-and-resolvable-private-address" /><item><title>RE: Pairing, Bonding, and Resolvable Private Address</title><link>https://devzone.nordicsemi.com/thread/398482?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2022 09:43:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e413b6a-d296-47f4-9395-99f9a18a3f80</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It should be able to do identity resolution, but only after bonding (not just pairing). I am not sure about the link to authentication here, but perhaps the problem is that you have not configured nRF Connect for Desktop Bluetooth to do bonding and with full I/O capabilities? See &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrfconnect_ble/UG/nRF_Connect_BLE/nRF_Connect_Pairing_devices.html"&gt;Pairing devices&lt;/a&gt;&amp;nbsp;for details about that. (Not that it is related to privacy, though, so perhaps you are asking about two different things?).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing, Bonding, and Resolvable Private Address</title><link>https://devzone.nordicsemi.com/thread/398417?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2022 21:26:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27e54c7e-1e26-4e84-acc1-650a8bd774ac</guid><dc:creator>David Ormand</dc:creator><description>&lt;p&gt;Just to finish this off:&lt;/p&gt;
&lt;p&gt;Is the nRF Connect for Desktop not configured to handle Privacy?&amp;nbsp; My Peripheral was definitely set up for RPA, and nRF Connect was recognizing a &amp;quot;RandomPrivateResolvable&amp;quot; address type, but the expected behavior for identity resolution or even security elevation during bonding was not occurring.&lt;/p&gt;
&lt;p&gt;Well, I see one use of pairing_complete in the Zephyr Bluetooth samples, namely peripheral_sc_only, and more generally of the&amp;nbsp;&lt;span&gt;bt_conn_auth_info_cb structure of which pairing_complete is a member, and that project does passkey authentication.&amp;nbsp; So I figured the callbacks of the&amp;nbsp;bt_conn_&lt;strong&gt;auth&lt;/strong&gt;_info_cb would only work if authentication was being performed, which my project was not doing.&amp;nbsp; Didn&amp;#39;t surprise me.&amp;nbsp; But the system crashing did.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing, Bonding, and Resolvable Private Address</title><link>https://devzone.nordicsemi.com/thread/397489?ContentTypeID=1</link><pubDate>Thu, 24 Nov 2022 15:34:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3677461-048c-4200-b009-a6d768e7a0d1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;IRKs are only exchanged when bonding (not&amp;nbsp;when pairing without bonding), and not necessarily&amp;nbsp;when neither of the peers use privacy (RPA). When not using privacy in any peers, you will not get any identity_resolved callbacks, because there is nothing to resolve.&lt;/p&gt;
&lt;p&gt;You are right that nRF Connect for Dekstop Bluetooth use firmware on the nRF that is based on (a quite old) SoftDevice and nRF5 SDK version.&lt;/p&gt;
&lt;p&gt;Using the&amp;nbsp;pairing_complete callback is the right way to see if bonding occured (and not just pairing). I cannot say based on what you write what happended in your case, but this should normally work and if you search for &amp;quot;pairing_complete&amp;quot; it in the nRF Connect SDK you can see many examples of it being used.&lt;/p&gt;
&lt;p&gt;Pairing does not imply bonding in the sense that there is no problem to pair without bonding. But normally this is something you don&amp;#39;t want to change dynamically, and there are some configuration parameters that can be adjusted for this. For instance CONFIG_BT_BONDABLE&amp;nbsp; (which you don&amp;#39;t see that much as it defaults to y), and CONFIG_BT_BONDING_REQUIRED which enforces bonding.&lt;/p&gt;
&lt;p&gt;The function&amp;nbsp;bt_set_bondable() is only if you want to change dynamically between bonding and pairing. As stated in the API doc: &amp;quot;For the vast majority of applications calling this function shouldn&amp;#39;t be needed.&amp;quot;. But if your use case is one of the few where it makes sense to sometimes bond and sometimes pair, then this is what you want to use.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing, Bonding, and Resolvable Private Address</title><link>https://devzone.nordicsemi.com/thread/397288?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2022 23:10:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1366e94-f605-466f-b399-72a1b35c676e</guid><dc:creator>David Ormand</dc:creator><description>&lt;p&gt;Thank you, Einar, for setting me straight on the right way to do things.&amp;nbsp; I took out the &amp;quot;CONFIG_BT_PRIVACY&amp;quot; from prj.conf and things work as expected.&lt;/p&gt;
&lt;p&gt;With RPA:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;quot;CONFIG_BT_PRIVACY=y&amp;quot; present in prj.conf&lt;/li&gt;
&lt;li&gt;Bond info erased (freshly programmed, bulk erase, does not report any bond info present at boot)&lt;/li&gt;
&lt;li&gt;nRF Connect sees address as &amp;quot;RandomPrivateResolvable&amp;quot;&lt;/li&gt;
&lt;li&gt;Connects fine.&lt;/li&gt;
&lt;li&gt;Upon &amp;quot;Pair&amp;quot;, with &amp;quot;Perform bonding&amp;quot; box checked, succeeds; both sides report security updated to level 2 (no auth, link encrypted), and nRF Connect says &amp;quot;Storing bond info for device &amp;lt;address&amp;gt;&amp;quot;, where address is the same address picked up from the advertising&lt;/li&gt;
&lt;li&gt;Reset Peripheral. Peripheral reports the presence of bond info at boot. When advertising detected at nRF Connect, connect. No report of security update. Pairing (with/without bonding) fails with error 4 (BT_SECURITY_ERR_AUTH_REQUIREMENT)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;* Unexpected behavior *&lt;/p&gt;
&lt;p&gt;Without RPA:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Removed &amp;quot;CONFIG_BT_PRIVACY=y&amp;quot; from prj.conf&lt;/li&gt;
&lt;li&gt;Bond info erased (freshly programmed, bulk erase, does not report any bond info present at boot)&lt;/li&gt;
&lt;li&gt;nRF Connect sees address as &amp;quot;RandomStatic&amp;quot;&lt;/li&gt;
&lt;li&gt;Connects fine.&lt;/li&gt;
&lt;li&gt;Upon &amp;quot;Pair&amp;quot;, with &amp;quot;Perform bonding&amp;quot; box checked, succeeds; both sides report security updated to level 2 (no auth, link encrypted), and nRF Connect says &amp;quot;Storing bond info for device &amp;lt;address&amp;gt;&amp;quot;, where address is the same address picked up from the advertising&lt;/li&gt;
&lt;li&gt;Reset Peripheral. Peripheral reports the presence of bond info at boot. When advertising detected at nRF Connect, connect. Both sides report security updated to level 2.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;* Expected behavior - automatic security update *&lt;/p&gt;
&lt;p&gt;Questions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Why does automatic repairing not work for RPA like it does for Random Static?&lt;/li&gt;
&lt;li&gt;I&amp;#39;ve got a &amp;quot;identity_resolved()&amp;quot; callback, but it is not being called. Is the sharing of IRK and use for resolving RPA actually happening?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I know I&amp;#39;m not using RPA anymore at this point, but I don&amp;#39;t understand what I&amp;#39;m seeing and suspect there&amp;#39;s something more required than just &amp;quot;CONFIG_BT_PRIVACY&amp;quot;.&lt;/p&gt;
&lt;p&gt;Also: I&amp;#39;m picking up (based on seeing a &amp;quot;&lt;span&gt;BLE_GAP_SEC_STATUS_AUTH_REQ&amp;quot; error) that nRF Connect is built under nRF SDK (has not been updated to NCS).&amp;nbsp; nRF Connect has a checkbox for &amp;quot;Perform bonding&amp;quot; that allows pairing (upgrade the security) to be commanded without bonding (committing the pairing info to persistent memory).&amp;nbsp;&amp;nbsp;&lt;/span&gt;Some additional questions related to pairing/bonding:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;4.&amp;nbsp; nRF Connect separately reports pairing (&amp;quot;Security updated, mode: x, level: y&amp;quot;) and bonding (&amp;quot;&lt;span&gt;Storing bond info for device &amp;lt;address&amp;gt;&amp;quot;).&amp;nbsp; Zephyr has a means of reporting pairing results via the&amp;nbsp;security_changed() callback but I don&amp;#39;t see how to get bonding results or even that bonding occurred.&lt;/span&gt;&amp;nbsp; Can some technique be used to do this? Registering a &amp;quot;pairing_complete()&amp;quot; callback via &amp;quot;bt_conn_auth_info_cb_register()&amp;quot; causes the Peripheral to reset upon connection (this feels like a bug).&amp;nbsp; I guess calling &amp;quot;bt_foreach_bond()&amp;quot; at some delay after &amp;quot;security_changed()&amp;quot; and looking for the address in the callback might work, but that seems a bit clunky.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;5. Looking through the Connection Management docs, it looks like pairing implies bonding. There&amp;#39;s only &amp;quot;bt_conn_set_security()&amp;quot;.&amp;nbsp; However,&amp;nbsp;&amp;nbsp;nRF Connect allows this.&amp;nbsp;&amp;nbsp;But it looks like&amp;nbsp;bt_set_bondable() will do this.&amp;nbsp; It works, but is that the intended use?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing, Bonding, and Resolvable Private Address</title><link>https://devzone.nordicsemi.com/thread/396836?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 09:35:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e92560ad-2962-4754-b860-b64f1b81bb92</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I suggest you backtrack a bit and revise your strategy. As I understand it, the data is always sent in a connection (not advertised). You also write that you want to prevent and attacker from sending bogus data, but you do not need encryption. However, I do not see a need to explicitly avoid encryption. You are thinking to use random resolvable address as a way to detect if the peer is the same as before (as it has to have the right IRK). That does not seem sound sound,&amp;nbsp;and I would suggest using the standard Bluetooth approach instead of using mechanisms for other purposes than intended, hoping you did not get anything wrong. Privacy (random resolvable addresses) is only intended to be used to prevent tracking. Regarding why this is not sound, an attacker could still spoof the address (the address change regularly but not often, perhaps every 15 minutes, and he could also jump right into a connection. A key point about encryption is that it does not only protect the data from being visible, but it also provide authenticity, which you want.&lt;/p&gt;
&lt;p&gt;The only standard way to obtain the IRK is to do bonding, so you would need to do that anyway. And that is also why your link gets level 2, which means unauthenticated encrypted link. Unauthenticated here is because you do not use any man in the middle protection mechanisms here (like passkey entry or numeric comparison). In any case, that means you already have an encrypted link. Then it would be enough to require that a pair you are already bonded to will not be allowed to re-pair (meaning if the peer lost bonding information either because it really did or an attacker is spoofing it, the link will be disconnected as it cannot be encrypted).&lt;/p&gt;
&lt;p&gt;So, unless I misunderstood something, the simplest and&amp;nbsp;most secure (as you are using well though out standard approaches in stead of&amp;nbsp;devising your own), would be to forget about resolvable addresses and just use encryption and require level 2 for your characteristics, and you are ready to go.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>