<?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>Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9368/best-practices-to-secure-a-ble-nrf51-to-nrf51-link</link><description>Hello, 
 I want to secure a link between 2 NRF51 (man in the middle and privacy with AES). 
 How to do that ? (I can use a static key in this application) 
 Most of the codes i found are partials and not up to date (timeout does not exist in structure</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Oct 2015 14:28:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9368/best-practices-to-secure-a-ble-nrf51-to-nrf51-link" /><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34606?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2015 14:28:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dd8ead1-ede4-41f5-9627-2723721cb48c</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;It is on the roadmap, but I can&amp;#39;t give you a timeline. One of our Sales Manager may be able to give you more information though. If you send me a PM with your location I can give you the details of the Sales Manager in your area. What do you mean by &amp;quot;Can I active at least AES encryption without key pairing ?&amp;quot; Do you mean bonding with Just Works? I don&amp;#39;t think the authentication method matters, it is handling the bonds that is challenging. If you mean pairing (not bonding) you should be able to do it with both central and peripherals no matter what authentication method(Just Works, Passkey Entry, OOB) you use.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34605?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 11:45:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bd1d155-e909-45fe-908a-6c7ea26ef4e8</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;You was right sd_ble_gap_sec_params_reply() was called on both sides. I fixed it but it still not work. Is there any roadmap about that ?
Can I active at least AES encryption without key pairing ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34604?ContentTypeID=1</link><pubDate>Mon, 05 Oct 2015 07:31:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14bedea6-8ea2-4c6c-8429-f586abb6ca52</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I took a look at your trace. It seems you bond and then call sd_ble_gap_sec_params_reply()? Also, sd_ble_gap_sec_params_reply() should only be called by the peripheral when it receives BLE_GAP_EVT_SEC_PARAMS_REQUEST. The central should not handle this event.&lt;/p&gt;
&lt;p&gt;It can however handle BLE_GAP_EVT_SEC_REQUEST.&lt;/p&gt;
&lt;p&gt;However, 0x00000007 means NRF_ERROR_INVALID_PARAM.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34603?ContentTypeID=1</link><pubDate>Sat, 03 Oct 2015 07:52:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d4a7605-6ea3-4b1e-ba52-6749f1bf6087</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;Please can you look at my edit traces.txt&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34602?ContentTypeID=1</link><pubDate>Sat, 03 Oct 2015 07:48:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1607e125-bd54-4006-8ebe-80765d8eb4cf</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;I have &amp;quot;Security parameter reply request failed, reason 0x00000007&amp;quot; on central side&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34601?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2015 11:13:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:209cc2d2-9392-458c-9af6-4aa5ac316194</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;Of course 5 minutes is an expression but files are very similar so an expert look can probably merge it quickly.
And yes i need both because i do scatternets.
Ps : thank you for your help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34600?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2015 09:02:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:220903a4-1fe1-4f00-ba89-3671cd6987b0</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I think it will require more than 5 minutes, or else we would have done it already. We are working on S130 Device Manager, but I can&amp;#39;t give you a timeline. Do you need bonding in both the peripheral and central role on both devices?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34599?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 13:15:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:101525ee-c6b8-4d9b-be2c-42071a84e0cd</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;Yes please. It should be useful for S130 users. It&amp;#39;s probably easy for you but my knowledge is too limited to do that myself.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34598?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 13:13:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5c4afc8-9be2-4393-8d47-9f751c207f98</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;How to merge device_manager_peripheral and device_manager_central?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34597?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 13:10:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40448459-c34c-49a8-a5aa-891dba0f23b7</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;Hello,
I used winmerge to visualise the differences between the 2 files. There is just some significant changes in functions dm_security_setup_req, dm_distributed_keys_get and dm_ble_evt_handler but I&amp;#39;m not sur how to merge it. Could you take 5 minutes to do a quick look on it please ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34596?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 11:06:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c2a678f-5ce0-42fc-846c-7648856abcd8</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Now I understand. Maybe I should have done that earlier. Anyways, I recommend getting the examples I provided to work with S110 and S120 first, then port them to S130. Let me know how it goes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34595?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2015 15:36:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80a4377c-ee27-4d3c-8d64-173560c425b0</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;Changing device_manager_central.c to device_manager_peripheral.c make me receive BLE_GAP_EVT_AUTH_KEY_REQUEST on one side.
I will look for your last infos asap, thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34594?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2015 15:18:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fcddfe25-8ce0-4a4d-8de2-156e4404a46e</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Have you found BLE_GAP_EVT_SEC_PARAMS_REQUEST in the code now? If the peripheral application doesn&amp;#39;t receive BLE_GAP_EVT_SEC_PARAMS_REQUEST most likely the central hasn&amp;#39;t sent a pairing request. The central application triggers a pairing request by calling sd_ble_gap_authenticate(), in the attached ble_app_hrs_c this is done when the BLE_HRS_C_EVT_DISCOVERY_COMPLETE event is received, through dm_security_setup_req()-&amp;gt;initiate_security_request()-&amp;gt;sd_ble_gap_authenticate().&lt;/p&gt;
&lt;p&gt;If the BLE_GAP_EVT_AUTH_KEY_REQUEST event is not received it is most likely because there is something wrong with the IO capabilites.&lt;/p&gt;
&lt;p&gt;You can test with the nRF Sniffer.Or you can use the debugger.To test you can put a breakpoint on the BLE_GAP_EVT_SEC_PARAMS_REQUEST in device_manager_peripehral.c If BLE_GAP_EVT_SEC_PARAMS_REQUEST is not received I would check if sd_ble_gap_authenticate() is called on the central side.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34593?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2015 15:08:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4d835a6-0d62-44ac-a89f-0db5839ea9e4</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;Maybe i have a clue, mu project is build with device_manager_central.c but you talk about device_manager_peripheral.c
How to merge both because i am peripheral and central (S130) ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34592?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2015 14:37:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9eb6a895-81b5-45b3-b338-732d8c27c01c</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;Any idea of test to do ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34591?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2015 14:26:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c644b5f-9329-49f7-a04f-dcb90c8daccf</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;Done and done as in your code but you dont show how to manage BLE_GAP_EVT_SEC_PARAMS_REQUEST and BLE_GAP_EVT_AUTH_KEY_REQUEST is never fired ???&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34590?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2015 14:22:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2b85c9e-57a0-408a-8c39-b632605ed3cf</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;//pemy start
//#define SEC_PARAM_MITM                   0                                          /&lt;strong&gt;&amp;lt; Man In The Middle protection not required. */
#define SEC_PARAM_MITM                   1                                          /&lt;/strong&gt;&amp;lt; Man In The Middle protection not required. */
//#define SEC_PARAM_IO_CAPABILITIES        BLE_GAP_IO_CAPS_NONE                       /&lt;strong&gt;&amp;lt; No I/O capabilities. */
#define SEC_PARAM_IO_CAPABILITIES        BLE_GAP_IO_CAPS_KEYBOARD_ONLY                       /&lt;/strong&gt;&amp;lt; No I/O capabilities. */
//end&lt;/p&gt;
&lt;p&gt;This tells the central that the peripheral requires man in the middle protection and that it only has keyboard as IO capability (even though it doesn&amp;#39;t really have a keyboard)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34588?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2015 14:22:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a33268d3-3c33-453c-957c-c5ae0d6faaf1</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I took at look at your traces. BLE_GAP_EVT_SEC_PARAMS_REQUEST is handled by the device manager, device_manager_peripheral.c. If you search for BLE_GAP_EVT_SEC_PARAMS_REQUEST in all files in the project you will get three hits. Two in ble_gap.h and one in device_manager_peripheral. When this event is received the device manager will respond with sd_ble_gap_sec_params_reply() with the security parameters that is set in the start of main.c Where I have written pemy:&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34589?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2015 14:04:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:315f67a1-eaee-4274-ab9b-4158d4c1d603</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;Can you take a look on my edit attached traces please ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34587?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2015 13:21:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0fa780c-219f-4b9e-83ba-54f72f387be6</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;but in the documents that you proposed there is something to do with BLE_GAP_EVT_SEC_PARAMS_REQUEST and in your codes there is not BLE_GAP_EVT_SEC_PARAMS_REQUEST&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34586?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2015 14:54:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e39e19d-249f-4671-bf15-b7ba0a5888c1</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;BLE_GAP_EVT_SEC_PARAMS_REQUEST is not handled by the SoftDevice, it is handled by the device manager. BLE_GAP_EVT_AUTH_KEY_REQUEST is handled in on_ble_evt() in main.c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34585?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2015 12:18:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63822a71-98e8-49c1-9149-5369c9e3b10b</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;You don t have to manage event in your code because that is implicitly done by softdevice ?
2 times (1 for answer and 1 for response)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34584?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2015 11:25:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afa6db0d-e462-40e2-831f-7cead6fe2db2</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;They work. Device manager manages the BLE_GAP_EVT_SEC_PARAMS_REQUEST event. What do mean by the passkey should appear twice in each example?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34583?ContentTypeID=1</link><pubDate>Sat, 26 Sep 2015 14:45:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1519e866-4f0b-41a6-9c8b-e2fcfe31fce8</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;And passkey should appear twice in each exemple but it&amp;#39;s not the case. Are you sure that this exemples were tested ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best practices to secure a BLE NRF51 to NRF51 link ?</title><link>https://devzone.nordicsemi.com/thread/34582?ContentTypeID=1</link><pubDate>Sat, 26 Sep 2015 14:28:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bf007e8-6424-4c09-a416-8718882947ba</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;I don&amp;#39;t understand, do your exemples work ? You are not managing BLE_GAP_EVT_SEC_PARAMS_REQUEST event ???&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>