<?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>Generating and using secure DFU keys under Linux</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17292/generating-and-using-secure-dfu-keys-under-linux</link><description>Hi 
 I&amp;#39;m wondering if anyone have had any success or problems with generating and using secure DFU keys under Linux? 
 I&amp;#39;m using the latest nrfutil from: github.com/.../pc-nrfutil 
 SHA1: e5303b994611b1122116ebd07c2185d5a0645d1d 
 And I&amp;#39;m running</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Oct 2016 11:37:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17292/generating-and-using-secure-dfu-keys-under-linux" /><item><title>RE: Generating and using secure DFU keys under Linux</title><link>https://devzone.nordicsemi.com/thread/66453?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2016 11:37:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7bbab04-c78c-4bd3-826e-4c27b9af2a5f</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Great! Glad to hear that everything is working as it should! Could you mark the answer as correct/accepted (click the checkmark to the left of the answer) so that its easer for other users to find the answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generating and using secure DFU keys under Linux</title><link>https://devzone.nordicsemi.com/thread/66452?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2016 11:04:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd400fb4-0f0f-45ed-a661-122cf459d8ac</guid><dc:creator>Visti Andresen</dc:creator><description>&lt;p&gt;I can confirm that my issue was also the missing C flags:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;-DuECC_ENABLE_VLI_API -DuECC_VLI_NATIVE_LITTLE_ENDIAN=1 -DuECC_SQUARE_FUNC=1 -DuECC_SUPPORTS_secp256r1=1 -DuECC_SUPPORT_COMPRESSED_POINT=0 -DuECC_OPTIMIZATION_LEVEL=3
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After adding the flags to my cflags I can now upload valid packages created with both the git version of nrfutil as well as the pip installed one. Invalid packages (created with the wrong secret key) are rejected as expected.&lt;/p&gt;
&lt;p&gt;Thanks a lot for your answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generating and using secure DFU keys under Linux</title><link>https://devzone.nordicsemi.com/thread/66451?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2016 09:07:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e78c246-ce8f-42fc-846b-a743ecad4b73</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;How are you compiling the micro-ecc library? Could you check that you&amp;#39;re not running into &lt;a href="https://devzone.nordicsemi.com/question/97610/secure-bootloader-upload-failed-unknown-8202/"&gt;this&lt;/a&gt; issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generating and using secure DFU keys under Linux</title><link>https://devzone.nordicsemi.com/thread/66450?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2016 09:05:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d8d32da-7f0b-4547-97a3-81582339c123</guid><dc:creator>Visti Andresen</dc:creator><description>&lt;p&gt;Minor update:&lt;/p&gt;
&lt;p&gt;I originally used a nrfutil version that was compiled from the git sources.&lt;/p&gt;
&lt;p&gt;I have now also tried to &amp;#39;pip install nrfutil&amp;#39; and use this version to generate a new set of public and private keys as well as a new application package.&lt;/p&gt;
&lt;p&gt;The DFU still fails during &amp;#39;nrf_crypto_verify&amp;#39; using the pip installed nfrutil&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generating and using secure DFU keys under Linux</title><link>https://devzone.nordicsemi.com/thread/66449?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2016 07:44:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:baad24fc-f1ee-42dd-b53d-aa0aa5afc475</guid><dc:creator>Visti Andresen</dc:creator><description>&lt;p&gt;With regard to the app version I have yet to initialize the bootloader settings by flashing its hex.&lt;/p&gt;
&lt;p&gt;The check for this is done earlier in dfu_req_handling.c and --applocation-version 0 did not cause any problems if I commented out the failure on the crypto verification.&lt;/p&gt;
&lt;p&gt;I have however tried setting the version to 0xFF for completeness.&lt;/p&gt;
&lt;p&gt;The DFU update still fails for the crypto verification.&lt;/p&gt;
&lt;p&gt;Btw. the NRF_LOG_INFO data also seems to indicated that at least in my case app version 0 would also have been accepted:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; :INFO:Req version: 255, Present: 0
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generating and using secure DFU keys under Linux</title><link>https://devzone.nordicsemi.com/thread/66448?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2016 07:40:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fffa923f-6c6f-401b-b6c2-ed0cded7c1c5</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Have you tried setting the &lt;code&gt;--application-version&lt;/code&gt; to 0xFF?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generating and using secure DFU keys under Linux</title><link>https://devzone.nordicsemi.com/thread/66447?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2016 07:37:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3612011f-68d1-4204-b381-4d46d2952218</guid><dc:creator>Visti Andresen</dc:creator><description>&lt;p&gt;Yes and no to replacing the data in the pk array.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not linking with dfu_public_key.c instead I&amp;#39;m linking with the generated public key code file generated by nrfutil.&lt;/p&gt;
&lt;p&gt;I have verified that the data in the the &amp;quot;pk&amp;quot; array is the same bytes as in the generated .c file by calling:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_LOG_HEXDUMP_INFO(crypto_key_pk.p_le_data, crypto_key_pk.len);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Earlier in dfu_req_handling.c crypto_key_pk is defined as&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static const nrf_crypto_key_t crypto_key_pk =
{
    .p_le_data = (uint8_t *) pk,
    .len = sizeof(pk)
};
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generating and using secure DFU keys under Linux</title><link>https://devzone.nordicsemi.com/thread/66446?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2016 06:54:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32348a5b-6266-41fa-a082-a355e00a0c2d</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;You have removed the debug public key and replaced it with a public key that corresponds to your private key  in &lt;code&gt;dfu_public_key.c&lt;/code&gt; right?&lt;/p&gt;
&lt;p&gt;Have you generated a bootloader settings hex file? If not then I think you have to set the application-version to 0xFF, i.e.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrfutil pkg generate &amp;lt;name of zip pkg &amp;gt;.zip --application &amp;lt;name of application hex&amp;gt;.hex --application-version 0xFF  --hw-version 52 --sd-req 0x8C --key-file &amp;lt;name of key file&amp;gt;.pem
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>