<?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>Having Problem with encryption on iOS nRF51822</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43101/having-problem-with-encryption-on-ios-nrf51822</link><description>I am creating an iOS which needs to talk with nRF51822 Soft devices 100. 
 Problem i am facing is, I am not able to Encrypt the connection properly. 
 I am using 
 - security mode = 1 and level = 1 (open) for all custom characteristics, except level </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Feb 2019 07:35:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43101/having-problem-with-encryption-on-ios-nrf51822" /><item><title>RE: Having Problem with encryption on iOS nRF51822</title><link>https://devzone.nordicsemi.com/thread/170764?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 07:35:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c232f0f-0e6f-49c7-8112-2a4d36f602bc</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="Soan"]Today we noticed that the issue does not occur most of the time (but not all of the time) if we clear the bond table in the nRF51822 - can you confirm whether an overflowing bond table could be the cause of such re-connection issues?[/quote]
&lt;p&gt;It depends on how it is implemented. Bonds are managed by the application code, not by the bluetooth stack. I think you need to debug the application FW to figure out why the disconnects occur.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Having Problem with encryption on iOS nRF51822</title><link>https://devzone.nordicsemi.com/thread/170731?ContentTypeID=1</link><pubDate>Tue, 12 Feb 2019 22:15:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:932c79bb-f077-4750-93aa-77648db2eb1a</guid><dc:creator>Soan</dc:creator><description>&lt;div style="color:#000000;font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;We see the issue across all 3 iOS devices we have used in our testing, but the behaviour is slightly different across devices - they fail at different points. The WireShark logs show the following failure points when our custom app tries to reconnect with the aid:&lt;/div&gt;
&lt;div style="color:#000000;font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="color:#000000;font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;- iPhone 7 (iOS 12.1.2) fails on CONNECT_REQ (frame 302)&lt;/div&gt;
&lt;div style="color:#000000;font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;- iPad 4 (iOS 10.3.3) fails on LL_VERSION_IND (frame 524)&lt;/div&gt;
&lt;div style="color:#000000;font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;- iPhone 5 (iOS 10.3.3) fails on LL_START_ENC_RSP (frame 559)&lt;/div&gt;
&lt;div style="color:#000000;font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="color:#000000;font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;The test procedure that was followed to produce these logs was as follows:&lt;/div&gt;
&lt;div style="color:#000000;font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="color:#000000;font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;a. Clear Devices from iOS Bluetooth Settings&lt;br /&gt;b. Run the App&lt;br /&gt;c. Search for Devices&lt;br /&gt;d. Connect to Device&lt;br /&gt;e. Subscribe to Notifications&lt;br /&gt;f. Accept Pairing Alert Raised by iOS Platformg&lt;/div&gt;
&lt;div style="color:#000000;font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;g. Everything works fine(Read/Write Data)&lt;br /&gt;h. Kill iOS Mobile APP&lt;br /&gt;i. Disconnections Happens&lt;br /&gt;j. Restart App&lt;br /&gt;k. App Tries to Connect again to old Remembered Device.&lt;br /&gt;l. App Never gets Connected&lt;/div&gt;
&lt;div style="color:#000000;font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="color:#000000;font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Today we noticed that the issue does not occur most of the time (but not all of the time) if we clear the bond table in the nRF51822 - can you confirm whether an overflowing bond table could be the cause of such re-connection issues?&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Having Problem with encryption on iOS nRF51822</title><link>https://devzone.nordicsemi.com/thread/168849?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 11:17:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b6ba3bb-7c2e-4d00-b280-2ede062a230a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Have you tested this with other phones, an Android phone for instance? If it works with other phones you could use the sniffer trace from those connections to compare against. To me it looks more like an issue with the 51 FW. I couldn&amp;#39;t spot any errors in the pairing procedure at least.&amp;nbsp;&lt;/p&gt;
[quote user="Soan"]And i am curious after analysing Sniffer Logs, i can see More Data bit is set to 1 in frame 371(Which is start Encryption request), But its 0 in frame 66, During first time Connection.[/quote]
&lt;p&gt;I&amp;#39;m afraid I don&amp;#39;t have a good explanation for this. I don&amp;#39;t think it&amp;#39;s a spec. violation, but seems strange that the MD bit is always set on this control packet.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Having Problem with encryption on iOS nRF51822</title><link>https://devzone.nordicsemi.com/thread/168783?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 06:22:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2523c7db-289e-401d-a349-6762067acef5</guid><dc:creator>Soan</dc:creator><description>&lt;p&gt;Thanks Vidar, For your response and Letting us know about the impact on s110 because of Deprecation.&lt;/p&gt;
&lt;p&gt;I am sorry we dont have the Complete code, its the compiled system that has been passed on to me.&lt;/p&gt;
&lt;p&gt;But if you can point me to some place which can detail out how should the encryption proceed if everything is right. And how to understand Packets being transmitted, while looking at sniffer logs.&lt;/p&gt;
&lt;p&gt;And i am curious after analysing Sniffer Logs, i can see More Data bit is set to 1 in frame 371(Which is start Encryption request), But its 0 in frame 66, During first time Connection.&lt;/p&gt;
&lt;p&gt;Much appreciate your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Having Problem with encryption on iOS nRF51822</title><link>https://devzone.nordicsemi.com/thread/168685?ContentTypeID=1</link><pubDate>Wed, 30 Jan 2019 12:04:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62df3e40-86fd-4943-80f3-8bf9584c8526</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for providing the sniffer trace. Have you tried to debug the code to see if the program gets stuck or reset once you re-connect after the bond is established? I see that there are lot of re-transmits after the slave sends the encryption request which indicate that the link becomes lost as soon as the request is sent.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Edit. not related to the issue here, but wanted to add that you may impacted by this if you use s110:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/b/blog/posts/what-impact-does-the-deprecation-and-withdrawal-of-bluetooth-core-specification-v4-0-and-v4-1-have-on-your-current-and-future-products?CommentId=84db79f6-ea63-4381-81f5-ca0520ab0cf4"&gt;https://devzone.nordicsemi.com/b/blog/posts/what-impact-does-the-deprecation-and-withdrawal-of-bluetooth-core-specification-v4-0-and-v4-1-have-on-your-current-and-future-products?CommentId=84db79f6-ea63-4381-81f5-ca0520ab0cf4&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Having Problem with encryption on iOS nRF51822</title><link>https://devzone.nordicsemi.com/thread/168580?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 23:14:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d67f0577-f3a2-4773-994a-0e90f46c2456</guid><dc:creator>Soan</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/FacettWireSharkLogs.pcapng"&gt;devzone.nordicsemi.com/.../FacettWireSharkLogs.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Yes the above BAD MIC was because sniffer could not capture the long term key, My bad starting the Sniffer at the end of process.&lt;/p&gt;
&lt;p&gt;The Logs i attached currently shows most of the interaction happening between iOS and BLE Device.&lt;/p&gt;
&lt;p&gt;App Finds the Device.&lt;/p&gt;
&lt;p&gt;Connects to it&lt;/p&gt;
&lt;p&gt;Try to Retreive the Services and Characteristics&lt;/p&gt;
&lt;p&gt;Tries to subscribe to notifications.(After which Pairing Alert is visible to user on UI)&lt;/p&gt;
&lt;p&gt;Then you can see in Logs It proceeds with encryption.&lt;/p&gt;
&lt;p&gt;Then on packet number 153. I terminate the App, which kills the connection between the device and iOS.&lt;/p&gt;
&lt;p&gt;Then at around packet number 359, i again start the mobile app to connect to the BLE Device. but it never gets connected. It keeps on transferring data.&lt;/p&gt;
&lt;p&gt;And yes i can see the Paired/Bonded device in iOS settings even after disconnection from App, So looks like Mobile is not throwing any kind of information. but BLE device is not responding to Mobiles encryption request.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Having Problem with encryption on iOS nRF51822</title><link>https://devzone.nordicsemi.com/thread/168535?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 16:22:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09b74b18-eb74-4fcf-89f4-93ca03c48e87</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Will this code run on the nRF51 DK? In that case, can you upload the application FW along with the softdevice so I&amp;nbsp; can test it here? I&amp;#39;m pretty sure that the &amp;quot;RemoveFromWhiteList&amp;quot; line isn&amp;#39;t related to pairing. You can check if the peripheral is bonded with the phone by looking at the &amp;quot;My device&amp;quot; list in Settings-&amp;gt;Bluetooth. All bonded devices will be listed there.&lt;/p&gt;
[quote user=""]Encrypted packet decrypted incorrectly (bad MIC)[/quote]
&lt;p&gt;Note that you will get the same error if the sniffer has not captured the long term key during the initial key exchange. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>