<?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>How to reject bonding requests, and only allow pairing requests?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98463/how-to-reject-bonding-requests-and-only-allow-pairing-requests</link><description>I&amp;#39;ve noticed on the nRF Connect phone app that there is a bond button. If I&amp;#39;m in just works pairing no bonding mode (settings below), and click the bond button a bond still appears to be done. However, when sniffing the packets I know that the phone acknowledges</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 05 Apr 2023 13:36:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98463/how-to-reject-bonding-requests-and-only-allow-pairing-requests" /><item><title>RE: How to reject bonding requests, and only allow pairing requests?</title><link>https://devzone.nordicsemi.com/thread/419297?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2023 13:36:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43c8322a-1dea-4eb1-ac89-188b3eb97e7c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I assume you say to reject pairing request ? Normally the peripheral doesn&amp;#39;t send pairing request, it&amp;#39;s the phone does that.&amp;nbsp;&lt;br /&gt;The rejection when peer trying to access an attribute that requires higher security is handled by the softdevice.&amp;nbsp;&lt;br /&gt;But what you can do is to set up the characteristic with authorization permission so that when it&amp;#39;s read/write you will have a callback in the application.&amp;nbsp;&lt;br /&gt;See here:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.3.0/group___b_l_e___g_a_t_t_s___r_e_a_d___r_e_q___a_u_t_h___m_s_c.html?cp=5_7_3_1_2_4_3_13"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.3.0/group___b_l_e___g_a_t_t_s___r_e_a_d___r_e_q___a_u_t_h___m_s_c.html?cp=5_7_3_1_2_4_3_13&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reject bonding requests, and only allow pairing requests?</title><link>https://devzone.nordicsemi.com/thread/419283?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2023 13:06:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e0cc096-5d4f-4f4b-bff3-5affde5f1f74</guid><dc:creator>jerome.sc</dc:creator><description>&lt;p&gt;Do you know where in the code, if possible to not send the pairing request? So for example, if someone tries to write/read to the characteristic, in this case, disconnect/reject the request as they don&amp;#39;t have proper authentication.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reject bonding requests, and only allow pairing requests?</title><link>https://devzone.nordicsemi.com/thread/419278?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2023 12:52:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:becca2a2-7876-4d3a-a2f5-5d732e687a07</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Yes, correct. But of course if you try to read a characteristic that require authentication and get rejected it will&amp;nbsp;send a Pairing Request instead of Encryption Request, showing that it doesn&amp;#39;t have any key stored. Thiis is what I get when I connect again to a &amp;quot;bonded&amp;quot; device and try to read encrypt required characteristic:&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1680699125321v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reject bonding requests, and only allow pairing requests?</title><link>https://devzone.nordicsemi.com/thread/419275?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2023 12:39:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67a702a3-3011-4108-bd3e-3347c9225adb</guid><dc:creator>jerome.sc</dc:creator><description>&lt;p&gt;Yes, that trace looks similar to mine. Does your device (phone) still keep the bond information? As in going into your Bluetooth settings, does it say the device is bonded?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reject bonding requests, and only allow pairing requests?</title><link>https://devzone.nordicsemi.com/thread/419272?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2023 12:36:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86e57a83-d2f5-4e54-a855-698535323cb2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jerome,&amp;nbsp;&lt;br /&gt;No I have verified the behavior with a sniffer. You can see the trace here:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1680698141106v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The peripheral clearly say no bonding. And then after the connection is encrypted, no key distributing happen (no LTK). The phone should have forget the device after the connection is terminated as there is no LTK.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reject bonding requests, and only allow pairing requests?</title><link>https://devzone.nordicsemi.com/thread/419268?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2023 12:29:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72357b28-5ed7-4331-b753-e49c74157bbd</guid><dc:creator>jerome.sc</dc:creator><description>&lt;p&gt;Yes I thought it was weird as well that even though I&amp;#39;m doing just works pairing no bonding, the phone keeps the keys but the nRF doesn&amp;#39;t. I&amp;#39;ve only used the nRF Connect phone app, so I&amp;#39;m not sure if it can only bond and not pair only. In addition, I based my application on the Heart Rate Example (ble_app_hrs).&lt;/p&gt;
&lt;p&gt;Could it be that this example changed parameters in the application that&amp;#39;s ignoring my&amp;nbsp;peer manager sec_param settings, more specifically setting&amp;nbsp;sec_param.bond = false?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reject bonding requests, and only allow pairing requests?</title><link>https://devzone.nordicsemi.com/thread/419243?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2023 11:42:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26ca69c7-c1a1-4607-8b04-46dfeb66240a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jerome,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You can find the peer pairing parameters in&amp;nbsp;BLE_GAP_EVT_SEC_PARAMS_REQUEST event. See &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.3.0/group___b_l_e___g_a_p___p_e_r_i_p_h___l_e_s_c___p_a_i_r_i_n_g___j_w___m_s_c.html?cp=5_7_3_1_2_1_5_10_6_4"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You will either have to handle the pairing yourself and reject the pairing request in your code or you would need to modify the peer_manager to do that in&amp;nbsp;sec_params_request_process().&lt;/p&gt;
&lt;p&gt;But I&amp;#39;m not so sure that you have the ability to turn off bonding on the phone or not. As far as I know it&amp;#39;s not possible for the app to request only pairing. But you may need to check with Android regarding that.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I agree that the phone is doing a little bit wrong to still &amp;quot;remember&amp;quot; the peer when they only do pairing and no LTK exchanged.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>