<?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>the usage of an IRK for the default setting and how to change an IRK each bonding cycle.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47722/the-usage-of-an-irk-for-the-default-setting-and-how-to-change-an-irk-each-bonding-cycle</link><description>Hello, 
 
 Please let me check about the usage of an IRK for the default setting and how to change an IRK each bonding cycle. 
 We use the resolvable address for our application, and I&amp;#39;ve met an issue like the following scenario: 
 
 Connect and bond</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Jun 2019 11:10:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47722/the-usage-of-an-irk-for-the-default-setting-and-how-to-change-an-irk-each-bonding-cycle" /><item><title>RE: the usage of an IRK for the default setting and how to change an IRK each bonding cycle.</title><link>https://devzone.nordicsemi.com/thread/190476?ContentTypeID=1</link><pubDate>Mon, 03 Jun 2019 11:10:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5301aeae-17a3-447f-b987-e276d65a16df</guid><dc:creator>Daisuke</dc:creator><description>&lt;p&gt;Hello Einar,&lt;/p&gt;
&lt;p&gt;Let me ask the additional questions related with sd_ble_gap_privacy_set() function, please.&lt;/p&gt;
&lt;p&gt;i. sd_ble_gap_privacy_set() and sd_ble_gap_privacy_get() function does not use the flash memory, does they? (When the nRF device turns off, The IRK is gone.) Is it correct? &lt;br /&gt;ii. Do we need to store the IRK which is generated by nrf_crypto_rng() to the flash memory by our selves? What is the assumed implementation with sd_ble_gap_privacy_set() ?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Daisuke&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the usage of an IRK for the default setting and how to change an IRK each bonding cycle.</title><link>https://devzone.nordicsemi.com/thread/189497?ContentTypeID=1</link><pubDate>Tue, 28 May 2019 08:28:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91903f9b-fa14-4e5e-809d-2dba54751cc9</guid><dc:creator>Daisuke</dc:creator><description>&lt;p&gt;Hi, Einar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you so much!&lt;/p&gt;
&lt;p&gt;Let us try to implement these.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Daisuke&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the usage of an IRK for the default setting and how to change an IRK each bonding cycle.</title><link>https://devzone.nordicsemi.com/thread/189477?ContentTypeID=1</link><pubDate>Tue, 28 May 2019 07:43:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bfc0c98-8d31-4646-ac2f-767e7008d124</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Daisuke"]a. Our accessory uses a static random address before bonding. If my understanding is correct, the static random address is also fixed as a default. So, if we would like to change the address, we can use sd_ble_gap_addr_set() function for this purpose. Is this correct?[/quote]
&lt;p&gt;Yes. The SoftDevice always uses the device-specific random static address from FICR unless you explicitly configure something else. If you want to change it, you have to call sd_ble_gap_addr_set().&lt;/p&gt;
[quote user="Daisuke"]b. Do &amp;quot;GAP Address cycle modes&amp;quot; relate with our cases? (for IRK or Static Random Address?) How can we handle this? Is it OK to leave it as default?[/quote]
&lt;p&gt;Yes. If you use a recent SoftDevice, the address cycle mode is configured by setting private_addr_cycle_s field in the&amp;nbsp;ble_gap_opt_privacy_t instance passed to &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v2.0.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=4_7_2_3_2_1_2_1#ga78b1e409a55beedde9902e2c35a5b5c9"&gt;sd_ble_gap_privacy_set()&lt;/a&gt;. If you don&amp;#39;t set it (i.e., use 0), the default of 15 minutes is used (&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s112.api.v6.1.1/group___b_l_e___g_a_p___d_e_f_i_n_e_s.html?cp=3_4_0_1_2_1_0_33#ga09366f020307b3079d1038062b7e162d"&gt;BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S&lt;/a&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the usage of an IRK for the default setting and how to change an IRK each bonding cycle.</title><link>https://devzone.nordicsemi.com/thread/189434?ContentTypeID=1</link><pubDate>Tue, 28 May 2019 03:19:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8ff7e87-641a-4e2a-aec8-a710c291ed47</guid><dc:creator>Daisuke</dc:creator><description>&lt;p&gt;Hello Einar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you very much for your clear answer.&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/47722/the-usage-of-an-irk-for-the-default-setting-and-how-to-change-an-irk-each-bonding-cycle/189262"]It is not a common approach, probably because it renders all existing bonds invalid. Also, the only benefit is that it prevents previously bonded devices from being able to track the nRF (which is the purpose or using a resolvable address). In most cases this is probably not a practical problem, since you trusted the device you have bonded with. I would leave the IRK as is unless you have a good reason for not doing it.[/quote][quote userid="7377" url="~/f/nordic-q-a/47722/the-usage-of-an-irk-for-the-default-setting-and-how-to-change-an-irk-each-bonding-cycle/189262"]The typical way to handle such issues is just to delete bonding information on the phone before you pair again (if I understood the problem coreclty). Note that if you do re-bonding, any cached GATT (meta)data should anyway be discarded, as it is linked to the bond.[/quote]
&lt;p&gt;Yes, we know the backward by renewing the IRK each bonding cycle. However, our usage policy for pairing is quite simple, which is &amp;quot;Our accessory can pair with only one peer.&amp;quot; For this case, the previous peer might act the wrong way if the user does not delete bonding information on the last peer side. (Ordinary users can confuse easily when just one problem causes.)&lt;/p&gt;
&lt;p&gt;Here is a related question, could you comment on this too, please?:&lt;br /&gt;a. Our accessory uses a static random address before bonding. If my understanding is correct, the static random address is also fixed as a default. So, if we would like to change the address, we can use sd_ble_gap_addr_set() function for this purpose. Is this correct?&lt;br /&gt;b. Do &amp;quot;GAP Address cycle modes&amp;quot; relate with our cases? (for IRK or Static Random Address?) How can we handle this? Is it OK to leave it as default?&lt;/p&gt;
&lt;p&gt;Sorry for my many questions, but if I could get any comments on this, it would be much appreciated.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Daisuke&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the usage of an IRK for the default setting and how to change an IRK each bonding cycle.</title><link>https://devzone.nordicsemi.com/thread/189262?ContentTypeID=1</link><pubDate>Mon, 27 May 2019 10:02:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:291456d3-3dbf-4263-8592-a9be932500ab</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Daisuke,&lt;/p&gt;
[quote user=""]1. I think the soft device does not change the IRK for all time as a default. Is it correct?[/quote]
&lt;p&gt;Yes, that is correct. The SoftDevice will always use the IRK which was randomly generated in production and placed in the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52810/ficr.html?cp=3_3_0_3_3_0_4#register.IR-0-3"&gt;IR registers&lt;/a&gt; by default.&lt;/p&gt;
[quote user=""]2. Is it possible to renew an IRK bonding cycle?[/quote]
&lt;p&gt;There is no strict link between the local IRK and bonding, but changing the IRK will effectively render all existing bonds invalid since the peer device(s) will no longer identify the nRF as the same device.&amp;nbsp;&lt;span&gt;Assuming you use the peer manager with a recent SDK version you can call pm_privacy_set(), which essentially just calls sd_ble_gap_privacy_set(). The configuration parameter is pm_privacy_params_t, which is typedefed to&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s112.api.v6.1.1%2Fstructble__gap__privacy__params__t.html&amp;amp;cp=3_4_0_1_2_1_4_8"&gt;ble_gap_privacy_params_t&lt;/a&gt;&lt;span&gt;, and this has a p_device_irk field that should point to the IRK you want to use (which you may have generated using for instance nrf_crypto_rng()). Note that the nRF can only have a single device (own) IRK active at a single time, so this will cause problems with previous bonds.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]3. Can you see any problems if we implement to change IRK for this solution?&amp;nbsp; Perhaps, I&amp;#39;ve just misunderstood privacy features.[/quote]
&lt;p&gt;It is not a common approach, probably because it renders all existing bonds invalid. Also, the only benefit is that it prevents previously bonded devices from being able to track the nRF (which is the purpose or using a resolvable address). In most cases, this is probably not a practical problem since you trusted the device you have bonded with. I would leave the IRK as is unless you have a good reason for not doing it.&lt;/p&gt;
&lt;p&gt;[quote user=""]Connect the nRF device to peer A for re-bonding.[/quote]&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;At this timing, peer A acts as if it has already known the nRF device because nRF&amp;#39;s IRK does not change. (the nRF advertises with the resolvable address for peer B, but peer A can also resolve it because IRK is the same as the last session.) So, peer A uses cached handle IDs for GATT protocols, which causes problems on the connection.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The typical way to handle such issues is just to delete bonding information on the phone before you pair again (if I understood the problem correctly). Note that if you do re-bonding, any cached GATT (meta)data should anyway be discarded, as it is linked to the bond.&lt;/p&gt;
&lt;p&gt;Br,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>