<?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>DFU OTA of encrypted peripherals from MITM to LESC causes subsequent LTK encryption to fail</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92144/dfu-ota-of-encrypted-peripherals-from-mitm-to-lesc-causes-subsequent-ltk-encryption-to-fail</link><description>Hi, Following my previous ticket on the matter, , I have attempted to DFU an MITM bonded device to LESC code, such that the peripheral device will disconnect connections that are not lesc and mitm_protected (the disconnect on mitm_protection had already</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Sep 2022 08:07:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92144/dfu-ota-of-encrypted-peripherals-from-mitm-to-lesc-causes-subsequent-ltk-encryption-to-fail" /><item><title>RE: DFU OTA of encrypted peripherals from MITM to LESC causes subsequent LTK encryption to fail</title><link>https://devzone.nordicsemi.com/thread/387413?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 08:07:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0abed5c9-508b-4ceb-9ad6-aaa2d1aae2f5</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Roi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The easiest way is to clear the application database after you do DFU update. You can write a signature in flash to mark that it&amp;#39;s the first time the new firmware running or not.&amp;nbsp;&lt;br /&gt;So if the application start fresh then you will not have any problem with &amp;quot;allow re-pairing&amp;quot;. You can keep it as NO and the device will bond to the central as a new device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The only draw back I can see is that the user will have to bond the central with the peripheral again , this time with LESC + passkey.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see any other solution that can increase the security without re-bonding.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU OTA of encrypted peripherals from MITM to LESC causes subsequent LTK encryption to fail</title><link>https://devzone.nordicsemi.com/thread/387340?ContentTypeID=1</link><pubDate>Wed, 21 Sep 2022 14:48:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d4d73bd-49eb-4fdf-90a2-080ad6571247</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Gotcha.&lt;br /&gt;So lets step back a second:&lt;br /&gt;What would be the safest way to go about this from scratch?&lt;br /&gt;We have MITM peripherals, bonded and encrypted with an mitm only (not OOB) LTK, which as you say is &amp;quot;sniffable&amp;quot;.&lt;br /&gt;After DFU to lesc - how would we go about re-pairing the centrals in the most correct way?&lt;br /&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Roi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU OTA of encrypted peripherals from MITM to LESC causes subsequent LTK encryption to fail</title><link>https://devzone.nordicsemi.com/thread/387322?ContentTypeID=1</link><pubDate>Wed, 21 Sep 2022 13:47:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac20be4d-ebfa-4b01-bd8e-4d6c1e04b5e4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi again Roi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With regard to #1. If the &amp;quot;not LESC MITM&amp;quot; was performed with OOB (NFC for example) then the LTK generated from such bond can be considered safe. But if the LTK was generated by passkey then it shouldn&amp;#39;t be considered safe. Anyone within the radio range with a sniffer that listen to the bonding process (when the LTK generated) can get the LTK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On #2 , it&amp;#39;s up to you, but as mentioned, with legacy bonding only MITM with OOB can be considered secure. Legacy MITM with passkey is not safe. LESC MITM with passkey is considered secure.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU OTA of encrypted peripherals from MITM to LESC causes subsequent LTK encryption to fail</title><link>https://devzone.nordicsemi.com/thread/387305?ContentTypeID=1</link><pubDate>Wed, 21 Sep 2022 13:03:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25ea23c4-5cbd-41fd-9de6-92e89960158e</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Hi Hung!&lt;br /&gt;Thanks very much for your swift and informative reply!&lt;br /&gt;I think it would be best if I try and focus our more general question into a specific case, and maybe we can discuss it from there:&lt;/p&gt;
&lt;p&gt;1) Our current logic dictates that non-MITM_protected and/or non-LESC connections are immediately disconnected. My suggestion is to broaden this to include our non-LESC but yet MITM LTKs, in that if a device is none of the following, it will be disconnected:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;mitm_protected&amp;nbsp;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;and&lt;/strong&gt;&lt;/span&gt; lesc - this is a new device that is pairing with lesc, and this is fine by us.&lt;/li&gt;
&lt;li&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;not&lt;/strong&gt;&lt;/span&gt; lesc,&amp;nbsp;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;but&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;mitm_protected&amp;nbsp;&lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;and&lt;/strong&gt;&lt;/span&gt; bonded&amp;nbsp;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;and&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;encrypted - this should cover our MITM-only LTKs case&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;2) Characteristics will revert to being mitm protected, and not lesc protected&lt;/p&gt;
&lt;p&gt;Can this described case be taken advantage of in any way you can think of? Is this safe and best-practice?&lt;/p&gt;
&lt;p&gt;Many Thanks ahead of time!&lt;/p&gt;
&lt;p&gt;Roi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU OTA of encrypted peripherals from MITM to LESC causes subsequent LTK encryption to fail</title><link>https://devzone.nordicsemi.com/thread/387224?ContentTypeID=1</link><pubDate>Wed, 21 Sep 2022 08:41:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcafa10d-3814-4bd1-a9c1-aa7c4fb64324</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Roi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I assume the other question&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/92143/moving-from-mitm-to-lesc"&gt;Moving from MITM to LESC&lt;/a&gt;&lt;span&gt;&amp;nbsp; can be handled here and we can close it.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Could you let me know the main goal of moving from legacy MITM to LESC MITM and keeping LTK ? It&amp;#39;s to support the future bond that it should use LESC+MITM or to improve the current bond (current LTK) that the security level of the same LTK change from legacy MITM to LESC MITM ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;By using the previously shared LTK, the level of security when you connect and encrypt will remains the same as it was before, I believe in this case level 3, not level 4 as MITM+LESC is.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So if you configure your characteristic with level 4 encryption requirement, then it will not allow the peer device to access if the security level doesn&amp;#39;t meet the requirement.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As far as I know the LTK of legacy MITM bond and LTK of LESC bond are exchangeable. I don&amp;#39;t see any different with the LTK between LESC and legacy bonding, except on how it&amp;#39;s generated. But not on how it&amp;#39;s used after the bond has already be established.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;So what we need to look at is why the bonding is failed. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have you checked and made sure the same LTK has been used after you do DFU update , to see if the peer manager is able to read the key after the DFU update ?&lt;br /&gt;I would suggest to capture a sniffer trace to see what happens when the link is established after DFU update. And also check the log on both device to see which error you have.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regarding &amp;quot;m_flag_allow_repairing&amp;nbsp;&amp;quot;, you should use it with care. As you already notice, by enabling this, there is a security risk that attacker can pretend to be your central and force a new bond with your device.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; So you may think of&amp;nbsp;a secure way of doing this , for example using an &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/simple-application-level-authentication"&gt;extra challenge response scheme&lt;/a&gt;&amp;nbsp; , that only when the peer passes a challenge from the application, you allow the re-pairing to be enable and they can bond after that.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>