<?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>Avoid &amp;quot;Bluetooth pairing request&amp;quot; alert on iOS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27017/avoid-bluetooth-pairing-request-alert-on-ios</link><description>Hi. 
 I have an application that needs a low security encryption. Therefore I want to use &amp;quot;Just works&amp;quot; encryption. The pairing process is assumed to be in a &amp;quot;safe&amp;quot; place. 
 But iOS are prompting with the &amp;quot;Bluetooth pairing request&amp;quot; alert before every</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 18 Nov 2017 12:44:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27017/avoid-bluetooth-pairing-request-alert-on-ios" /><item><title>RE: Avoid "Bluetooth pairing request" alert on iOS</title><link>https://devzone.nordicsemi.com/thread/106013?ContentTypeID=1</link><pubDate>Sat, 18 Nov 2017 12:44:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60a828df-074e-4bf4-8036-2e836e8e1a9d</guid><dc:creator>nosignal</dc:creator><description>&lt;p&gt;@shibshab: on my device when I sniffed the traffic with Wireshark, on SCAN_RSP I always get
Scan Response Data: 
Other devices I tested have some data in this field.
My device is working, but I think there is some wrong coding that causes this.
Maybe because an incorrect order of my advertising data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid "Bluetooth pairing request" alert on iOS</title><link>https://devzone.nordicsemi.com/thread/106012?ContentTypeID=1</link><pubDate>Wed, 09 Sep 2015 09:34:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61bf5c50-bd03-423a-b643-e73dd0b96d4d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Kasper: If you pass NULL as the p_sec_keyset, then it will be only pairing with no bonding. No longterm keys will be exchanged and you will see the pairing request popup everytime. The p_sec_keyset is where you will have the keys after the bonding process is done (BLE_GAP_EVT_AUTH_STATUS event).&lt;/p&gt;
&lt;p&gt;I would suggest you to have a look at the ble_app_template example we have in SDK v8.0. In this example we handle the bonding without device manager and could be a good example to refer. Note that in that example, we don&amp;#39;t store LTK in flash so if you reset the chip, the LTK will go missing.  You will have to erase bond on the phone to reconnect and rebond.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid "Bluetooth pairing request" alert on iOS</title><link>https://devzone.nordicsemi.com/thread/106011?ContentTypeID=1</link><pubDate>Wed, 09 Sep 2015 08:47:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22150543-aec3-42a6-ac37-2ae2c68874b3</guid><dc:creator>Kasper Leonhardt</dc:creator><description>&lt;p&gt;Thank you shibshab, you have been very helpfully, but I believe that your last sentence is the most important: &amp;quot;Also note that this requires support on the iOS side...&amp;quot; I still get the &amp;quot;Bluetooth pairing request&amp;quot; :-( I believe that I have to give up, it is not possible.&lt;/p&gt;
&lt;p&gt;Compared to the UART example in 8.0 I have done following changes&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/changes.txt"&gt;changes.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid "Bluetooth pairing request" alert on iOS</title><link>https://devzone.nordicsemi.com/thread/106010?ContentTypeID=1</link><pubDate>Wed, 09 Sep 2015 07:16:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03b60f5f-df5e-4444-8d6b-3a2b6d9ce6c6</guid><dc:creator>shibshab</dc:creator><description>&lt;p&gt;Taking the UART example in 8.0 as an example. The necessary steps to enable Just Works encryption is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set SEC_PARAM_BOND to 0&lt;/li&gt;
&lt;li&gt;For characteristics (read/write) set BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note that RX characteristic is WriteWithoutResponse, which will not allow you to verify using a sniffer that authentication is required. Set it to write by removing the line setting write_wo_resp to 1.&lt;/p&gt;
&lt;p&gt;Also note that this requires support on the iOS side (the nRF Toolbox app will not support this setup).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid "Bluetooth pairing request" alert on iOS</title><link>https://devzone.nordicsemi.com/thread/106009?ContentTypeID=1</link><pubDate>Tue, 08 Sep 2015 13:36:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7c16af1-7847-42b0-b06d-3782584d0006</guid><dc:creator>Kasper Leonhardt</dc:creator><description>&lt;p&gt;Thanks for you help shishab, so far. And you were right the call to sd_ble_gap_sec_params_reply did return with error (16=NRF_ERROR_INVALID_ADDR). I believe that the parameter p_sec_keyset cannot be NULL in this case, as suggested on the &amp;quot;Message Sequence Charts&amp;quot; as linked to before. The comment in the header file also describes the possibility to pass a NULL. I think I need more changes. So far I have changed following (probably not compleate list) from the uart example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;BLE_GAP_CONN_SEC_MODE_SET_OPEN changed to BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM&lt;/li&gt;
&lt;li&gt;Parameters to sd_ble_gap_sec_params_reply&lt;/li&gt;
&lt;li&gt;Upgraded from SD 7.2 to 8.0 (might need further changes) (main.c and ble_* files kept)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But then I tried to change BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM to BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM, and correct in main.c. I expect that it should be more correct. But then no smp pairing request was performed. (and no call of sd_ble_gap_sec_info_reply).&lt;/p&gt;
&lt;p&gt;Maybe I should try to start all over from a new copy of the new version of the BLE UART example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid "Bluetooth pairing request" alert on iOS</title><link>https://devzone.nordicsemi.com/thread/106008?ContentTypeID=1</link><pubDate>Tue, 08 Sep 2015 13:30:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f75e445a-f901-469a-a199-f35ad52a230a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Kaster: As Shibshab pointed, you need to handle the BLE_GAP_EVT_SEC_PARAMS_REQUEST event and reply with the sd_ble_gap_sec_params_reply() with correct parameters. It&amp;#39;s shown &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s110.api.v8.0.0/group___b_l_e___g_a_p___p_e_r_i_p_h___b_o_n_d_i_n_g___j_w___m_s_c.html?cp=2_7_0_0_0_2_1_0_6"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid "Bluetooth pairing request" alert on iOS</title><link>https://devzone.nordicsemi.com/thread/106002?ContentTypeID=1</link><pubDate>Tue, 08 Sep 2015 07:31:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96d52012-b1a0-470b-815f-744152ac000f</guid><dc:creator>shibshab</dc:creator><description>&lt;p&gt;I see you have one packet of type SMP (as seen in Protocol column), which is a Pairing Request (the one we are looking for). This is packet nr 213, and it comes after getting an &amp;quot;Insufficient Authentication&amp;quot; error message, indicating that the encryption requirements for the characteristic is in place.&lt;/p&gt;
&lt;p&gt;I do not see any response to this packet, have you verified that your code handles this correctly?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid "Bluetooth pairing request" alert on iOS</title><link>https://devzone.nordicsemi.com/thread/106007?ContentTypeID=1</link><pubDate>Tue, 08 Sep 2015 06:35:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bf330d6-2d04-4b61-840c-492add8939ad</guid><dc:creator>Kasper Leonhardt</dc:creator><description>&lt;p&gt;Log from Wireshark:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/JustWorksPairingAttempt.pcapng"&gt;JustWorksPairingAttempt.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid "Bluetooth pairing request" alert on iOS</title><link>https://devzone.nordicsemi.com/thread/106006?ContentTypeID=1</link><pubDate>Tue, 08 Sep 2015 06:31:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0f74d45-4b55-4df2-9322-39f1ea548989</guid><dc:creator>Kasper Leonhardt</dc:creator><description>&lt;p&gt;I know. But Wireshark shows it in plain text, and the encryption flag is false. Please see next answer&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid "Bluetooth pairing request" alert on iOS</title><link>https://devzone.nordicsemi.com/thread/106005?ContentTypeID=1</link><pubDate>Tue, 08 Sep 2015 06:12:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9abf4b41-b111-4ff1-bccf-2d9041d87f2b</guid><dc:creator>shibshab</dc:creator><description>&lt;p&gt;Remember that the sniffer will be able to decrypt just work encryptions automatically. Do you mean that there is no pairing request?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid "Bluetooth pairing request" alert on iOS</title><link>https://devzone.nordicsemi.com/thread/106004?ContentTypeID=1</link><pubDate>Tue, 08 Sep 2015 06:05:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40224856-329e-4495-947c-2219f14273c3</guid><dc:creator>Kasper Leonhardt</dc:creator><description>&lt;p&gt;Did not work. Verified the connection with the Nordic BLE sniffer and Wireshark. The data is not encrypted. Suggestions needed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid "Bluetooth pairing request" alert on iOS</title><link>https://devzone.nordicsemi.com/thread/106003?ContentTypeID=1</link><pubDate>Mon, 07 Sep 2015 12:21:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2b3289e-5c58-4927-83d9-1212fe5a8a94</guid><dc:creator>Kasper Leonhardt</dc:creator><description>&lt;p&gt;Solved.
I needed to upgrade to SD 8.0.0, and change the line (last parameter changed to NULL):
sd_ble_gap_sec_params_reply(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, BLE_GAP_SEC_STATUS_SUCCESS, &amp;amp;m_application_table[0].sec_param, NULL/&lt;em&gt;&amp;amp;keys_exchanged&lt;/em&gt;/);
in the file device_manager_peripheral.c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid "Bluetooth pairing request" alert on iOS</title><link>https://devzone.nordicsemi.com/thread/106001?ContentTypeID=1</link><pubDate>Mon, 07 Sep 2015 07:51:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47e8441b-9bf5-48c6-b37a-4bcd894fc858</guid><dc:creator>shibshab</dc:creator><description>&lt;p&gt;&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s110.api.v8.0.0%2Fgroup___b_l_e___g_a_p___p_e_r_i_p_h___p_a_i_r_i_n_g___j_w___m_s_c.html&amp;amp;cp=2_7_0_0_0_2_1_0_5"&gt;This page&lt;/a&gt; describes what parameters needs to be set in order for the peripheral to use Just Works.&lt;/p&gt;
&lt;p&gt;When this is used correctly you should not get a prompt from iOS regarding the pairing request.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>