<?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>【Mesh Security Materials Generation】Is it possible to generate mesh security materials by users?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75215/mesh-security-materials-generation-is-it-possible-to-generate-mesh-security-materials-by-users</link><description>Hello Nordic Experts, 
 
 I almost finished the development for my mesh project with nRF52840. But I faced some t ricky issues when in mass production. that is the time for provisioning is too long. my purpose is below: 
 
 the devices can be communicated</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 23 May 2021 15:49:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75215/mesh-security-materials-generation-is-it-possible-to-generate-mesh-security-materials-by-users" /><item><title>RE: 【Mesh Security Materials Generation】Is it possible to generate mesh security materials by users?</title><link>https://devzone.nordicsemi.com/thread/311186?ContentTypeID=1</link><pubDate>Sun, 23 May 2021 15:49:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8583e5fb-2642-484f-b876-eaae021d527f</guid><dc:creator>xiaolongba</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/mttrinh"&gt;Mttrinh&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;My comments as below:&lt;/p&gt;
[quote userid="15475" url="~/f/nordic-q-a/75215/mesh-security-materials-generation-is-it-possible-to-generate-mesh-security-materials-by-users/311126#311126"]e don&amp;#39;t have any PC tools for that. Our developer don&amp;#39;t think it is possible&amp;nbsp;to pre-flash security materials as there are flash headers that need to be stored as well. They also need to be dumped, otherwise stack won&amp;#39;t be able to restore configuration.[/quote]
&lt;p&gt;OK, Got it.&lt;/p&gt;
[quote userid="15475" url="~/f/nordic-q-a/75215/mesh-security-materials-generation-is-it-possible-to-generate-mesh-security-materials-by-users/311126#311126"]The mesh specification doesn&amp;#39;t allow pre-flashing configuration. This may lead to security vulnerabilities. E.g. DevKey generated during provisioning and can&amp;#39;t be changed until device is reset and re-provisioned.[/quote]
&lt;p&gt;Yes, I got it. But I don&amp;#39;t think this a security vulnerability as this approach is only used in mass production and it just speeded up the process of provisioning, In other words, these material security materials are stored into the flash in advance and bypass the process of provisioning. Such as these security materials can be obtained from a customer&amp;#39;s server, and others is impossible to get unless the information in the server is&amp;nbsp;disclosed&lt;/p&gt;
[quote userid="15475" url="~/f/nordic-q-a/75215/mesh-security-materials-generation-is-it-possible-to-generate-mesh-security-materials-by-users/311126#311126"]Thus, with pre-flashed configuration, the devices will anyway need to be reprovisioned for the security reasons.[/quote]
&lt;p&gt;why? I cannot get your point, as I said above, these mesh security materials are stored into the internal flash in mass production. they can communicate with each other after power on if the customer purchased these products from the store.&amp;nbsp;&lt;/p&gt;
[quote userid="15475" url="~/f/nordic-q-a/75215/mesh-security-materials-generation-is-it-possible-to-generate-mesh-security-materials-by-users/311126#311126"]If you still wants to do this, there is mesh_stack_provisioning_data_store() function that is called when device is provisioned. The customer may use it to pre-configure device. It can use provisioner example to see how provisioner preconfigures itself.[/quote]
&lt;p&gt;OK, let me check and feedback to you soon.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Anyway, many thanks for your detailed replies.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【Mesh Security Materials Generation】Is it possible to generate mesh security materials by users?</title><link>https://devzone.nordicsemi.com/thread/311126?ContentTypeID=1</link><pubDate>Fri, 21 May 2021 16:41:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f09fa0a0-08e7-48d8-a2ee-026ef982893a</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t have any PC tools for that. Our developer don&amp;#39;t think it is possible&amp;nbsp;to pre-flash security materials as there are flash headers that need to be stored as well. They also need to be dumped, otherwise stack won&amp;#39;t be able to restore configuration.&lt;/p&gt;
&lt;p&gt;The mesh specification doesn&amp;#39;t allow pre-flashing configuration. This may lead to security vulnerabilities. E.g. DevKey generated during provisioning and can&amp;#39;t be changed until device is reset and re-provisioned. Thus, with pre-flashed configuration, the devices will anyway need to be reprovisioned for the security reasons.&lt;/p&gt;
&lt;p&gt;If you still wants to do this, there is mesh_stack_provisioning_data_store() function that is called when device is provisioned. The customer may use it to pre-configure device. It can use provisioner example to see how provisioner preconfigures itself.&lt;br /&gt; &lt;br /&gt;Regarding flash entries allocations. Here is the order of files stored in flash: &lt;a href="https://github.com/NordicSemiconductor/nRF5-SDK-for-Mesh/blob/master/mesh/core/include/mesh_opt.h#L61-L68"&gt;https://github.com/NordicSemiconductor/nRF5-SDK-for-Mesh/blob/master/mesh/core/include/mesh_opt.h#L61-L68&lt;/a&gt;&amp;nbsp;and for example these are entries stored in DSM: &lt;a href="https://github.com/NordicSemiconductor/nRF5-SDK-for-Mesh/blob/master/mesh/access/include/mesh_opt_dsm.h#L57-L66"&gt;https://github.com/NordicSemiconductor/nRF5-SDK-for-Mesh/blob/master/mesh/access/include/mesh_opt_dsm.h#L57-L66&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So, in front of NetKey, customer might see addresses&amp;#39; allocation. MESH_OPT_NET_STATE_FILE_ID holds IV Index and SeqNum and they should be first entries stored in flash. Their order is shown here: &lt;a href="https://github.com/NordicSemiconductor/nRF5-SDK-for-Mesh/blob/master/mesh/core/include/mesh_opt_net_state.h#L56-L59"&gt;https://github.com/NordicSemiconductor/nRF5-SDK-for-Mesh/blob/master/mesh/core/include/mesh_opt_net_state.h#L56-L59&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【Mesh Security Materials Generation】Is it possible to generate mesh security materials by users?</title><link>https://devzone.nordicsemi.com/thread/310541?ContentTypeID=1</link><pubDate>Wed, 19 May 2021 16:09:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:940da210-a171-4943-b91b-5378f48e1495</guid><dc:creator>xiaolongba</dc:creator><description>&lt;p&gt;also, I found the corresponding mesh security materials after calling the function &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v5.0.0/group__MESH__STACK.html#gadcc65e154a945f96efabceefd6e4ba70" rel="noopener noreferrer" target="_blank"&gt;mesh_stack_persistence_flash_usage()&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;, the details as below:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1621440418529v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;the first red highlighted is Netkey, the second one is devkey, the third one is appkey, But I dont know what do the others mean? could you explain to me what are they? and where is the iv index &amp;amp; unicast address etc?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanks in advance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【Mesh Security Materials Generation】Is it possible to generate mesh security materials by users?</title><link>https://devzone.nordicsemi.com/thread/310539?ContentTypeID=1</link><pubDate>Wed, 19 May 2021 15:35:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16436b1f-b116-4079-86ed-dd8986087674</guid><dc:creator>xiaolongba</dc:creator><description>&lt;p&gt;Hi Bro,&lt;/p&gt;
&lt;p&gt;what do the mesh security materials mean is&amp;nbsp; netkey,appkey,unicast address, iv index, etc. and I would like to generate these parameters with the PC tool and store them into the internal flash through UART, so I don&amp;#39;t need to provision unprovisioned&amp;nbsp;devices one by one at this moment. so they can communicate with each other after power on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【Mesh Security Materials Generation】Is it possible to generate mesh security materials by users?</title><link>https://devzone.nordicsemi.com/thread/310534?ContentTypeID=1</link><pubDate>Wed, 19 May 2021 15:31:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae04a75f-860b-4a71-a171-2dcc00628ae3</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I might have mistunderstood your question, by &amp;quot;generating the mesh security materials&amp;quot; do you mean provisioning the device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【Mesh Security Materials Generation】Is it possible to generate mesh security materials by users?</title><link>https://devzone.nordicsemi.com/thread/310438?ContentTypeID=1</link><pubDate>Wed, 19 May 2021 12:32:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f22c98d5-53a8-4c1a-9c1d-63d291234aeb</guid><dc:creator>xiaolongba</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/mttrinh"&gt;Mttrinh&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Big thanks for your detailed replies, regarding the ways to generate mesh security materials you mentioned above is not what I expected. Actually, I would like to generate this info with one specified pc tool or lib that can be used for my own pc tool for mass production. Is it possible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【Mesh Security Materials Generation】Is it possible to generate mesh security materials by users?</title><link>https://devzone.nordicsemi.com/thread/310411?ContentTypeID=1</link><pubDate>Wed, 19 May 2021 11:36:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4db1ed1-8864-4323-82a5-2814b6418e40</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. We do have our &lt;a href="https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Mesh/GetStarted" rel="noopener noreferrer" target="_blank"&gt;nRF Mesh app for iOS and Android&lt;/a&gt;, assuming that you have support for PB-GATT and Proxy feature. The sample app is for development/protoyping purposes targeting developers to make debugging easier, so it is recommeded that you create your own app. The nRF Mesh app is open-source and can be used as a reference. It can be found on our Github, see &lt;a href="https://github.com/NordicSemiconductor/Android-nRF-Mesh-Library" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;&amp;nbsp;and &lt;a href="https://github.com/NordicSemiconductor/IOS-nRF-Mesh-Library" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;2. You can use this function &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v5.0.0/group__MESH__STACK.html#gadcc65e154a945f96efabceefd6e4ba70" rel="noopener noreferrer" target="_blank"&gt;mesh_stack_persistence_flash_usage()&lt;/a&gt;&amp;nbsp;to get which&amp;nbsp;&lt;span&gt;flash areas used by the mesh stack to store the provisioning data.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>