<?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>Custom keys with updatable bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96586/custom-keys-with-updatable-bootloader</link><description>Hey, 
 I&amp;#39;m trying to assign custom keys to the immutable nrf secure bootloader and to the updatable mcuboot, but without luck. I still get warning messages from both bootloaders regarding development keys still being used 
 
 
 snapshots of the prj.conf</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Feb 2023 12:38:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96586/custom-keys-with-updatable-bootloader" /><item><title>RE: Custom keys with updatable bootloader</title><link>https://devzone.nordicsemi.com/thread/411357?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2023 12:38:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b823fd20-1e75-429a-997d-d2bf68b750e5</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Mustafa,&amp;nbsp;&lt;br /&gt;I don&amp;#39;t see that problem when I built my example or build the nrfdesktop example with nRF5340dk_nrf5340_cpuapp.&amp;nbsp;&lt;br /&gt;Maybe you can try compile&amp;nbsp;&lt;span&gt;nrfdesktop&amp;nbsp;&lt;/span&gt;on a fresh clone of the SDK?&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom keys with updatable bootloader</title><link>https://devzone.nordicsemi.com/thread/411309?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2023 10:17:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c48a63c3-c70b-4745-96ae-d68e5d9f1697</guid><dc:creator>Mustafa</dc:creator><description>&lt;p&gt;Hi Hung,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I found something weird, in my project when I choose the board ( nrf52840dk) then it works fine and the assigned key in prj.conf is detected well. but when I choose (nrf5340dk cpuapp board) then I get the warning message.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom keys with updatable bootloader</title><link>https://devzone.nordicsemi.com/thread/411271?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2023 08:39:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0403f479-80c5-486b-bd1e-d4eb2fa1ee73</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Mustafa,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;It must be something wrong with cmake that it couldn&amp;#39;t pass the&amp;nbsp;&lt;span&gt;CONFIG_SB_SIGNING_KEY_FILE to the bootloader. You can try to add&amp;nbsp;&lt;/span&gt;-DSB_SIGNING_KEY_FILE=/path/to/my/pem&amp;#39; as the extra CMake Arguments to see if it help.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Also please try to compile the nrf_desktop sample and select board nrf52840dk_nrf52840 . In that sample we do the same as in my example. It uses&amp;nbsp;&lt;span&gt;CONFIG_SB_SIGNING_KEY_FILE&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;configuration/nrf52840dk_nrf52840/b0_private.pem&amp;quot;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Please check if you also see that the default key (meaning&amp;nbsp;&lt;span&gt;CONFIG_SB_SIGNING_KEY_FILE&amp;nbsp;is blank)&lt;/span&gt; is used or not.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom keys with updatable bootloader</title><link>https://devzone.nordicsemi.com/thread/411211?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2023 21:55:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbb40ed1-963d-47fa-9ba2-7f0715bf3383</guid><dc:creator>Mustafa</dc:creator><description>&lt;p&gt;When I assign invlaid file location then I&amp;nbsp;get&amp;nbsp;an error as yours, but when I assign a valid key location then I get this message (is very strange)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1677016486653v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom keys with updatable bootloader</title><link>https://devzone.nordicsemi.com/thread/410631?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2023 12:22:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7934260c-299d-483d-a116-05fc5d416d97</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I would say that modifying the default might not be the best solution.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you compile the code I sent with a wrong .pem file (file not exist) do you see any error ?&amp;nbsp;&lt;br /&gt;For example if I set the path to the file to a wrong path&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SB_SIGNING_KEY_FILE&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;C:/wrongpath/mykey2.pem&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;, I would receive this error:&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1676636491470v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom keys with updatable bootloader</title><link>https://devzone.nordicsemi.com/thread/410559?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2023 09:21:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2da54998-155c-4479-9028-f2be14fa3ee2</guid><dc:creator>Mustafa</dc:creator><description>&lt;p&gt;Hey Hung, I have debugged it here and it seems that&amp;nbsp;CONFIG_SB_SIGNING_KEY_FILE is always empty.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;\nrf\subsys\bootloader\cmake\debug_keys.cmake&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;# Check if debug sign key should be generated.
if( &amp;quot;${CONFIG_SB_SIGNING_KEY_FILE}&amp;quot; STREQUAL &amp;quot;&amp;quot;)
  message(WARNING &amp;quot;
    --------------------------------------------------------------
    --- WARNING: Using generated NSIB public/private key-pair. ---
    --- It should not be used for production.                  ---
    --- See CONFIG_SB_SIGNING_KEY_FILE                         ---
    --------------------------------------------------------------
    \n&amp;quot;
  )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;for a kind of workaround, I modified the default value to the absolute path of my key then it works fine.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1676625674147v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom keys with updatable bootloader</title><link>https://devzone.nordicsemi.com/thread/410534?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2023 08:28:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93b846a8-d8f6-4fe0-a822-993231122ad7</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Mustafa,&amp;nbsp;&lt;br /&gt;Which exact key was empty and which exact file you looked at ? Could you take a screenshot&amp;nbsp; ?&amp;nbsp;&lt;br /&gt;Have you tried to change the key and test if you can update MCBoot when you change the key but test with the MCUBoot image signed by the previous key&amp;nbsp; ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The&amp;nbsp;&lt;span&gt;CONFIG_SB_SIGNING_KEY_FILE&amp;nbsp;is fed to B0 from inside&amp;nbsp;\nrf\subsys\bootloader\cmake\debug_keys.cmake&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Check if debug sign key should be generated.
if( &amp;quot;${CONFIG_SB_SIGNING_KEY_FILE}&amp;quot; STREQUAL &amp;quot;&amp;quot;)
  message(WARNING &amp;quot;
    --------------------------------------------------------------
    --- WARNING: Using generated NSIB public/private key-pair. ---
    --- It should not be used for production.                  ---
    --- See CONFIG_SB_SIGNING_KEY_FILE                         ---
    --------------------------------------------------------------
    \n&amp;quot;
  )

  set(DEBUG_SIGN_KEY ${PROJECT_BINARY_DIR}/GENERATED_NON_SECURE_SIGN_KEY_PRIVATE.pem)
  set(SIGNATURE_PRIVATE_KEY_FILE ${DEBUG_SIGN_KEY})
  add_custom_command(
    OUTPUT
    ${DEBUG_SIGN_KEY}
    COMMAND
    ${PRIV_CMD}
    --out ${DEBUG_SIGN_KEY}
    WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
    COMMENT
    &amp;quot;Generating signing key&amp;quot;
    USES_TERMINAL
    )
  add_custom_target(
    debug_sign_key_target
    DEPENDS
    ${DEBUG_SIGN_KEY}
    )
  set(SIGN_KEY_FILE_DEPENDS debug_sign_key_target)
else()
  # Resolve path.
  if(IS_ABSOLUTE ${CONFIG_SB_SIGNING_KEY_FILE})
    set(SIGNATURE_PRIVATE_KEY_FILE ${CONFIG_SB_SIGNING_KEY_FILE})
  else()
    set(SIGNATURE_PRIVATE_KEY_FILE
      ${CMAKE_SOURCE_DIR}/${CONFIG_SB_SIGNING_KEY_FILE})
  endif()

  if (NOT EXISTS ${SIGNATURE_PRIVATE_KEY_FILE})
    message(FATAL_ERROR &amp;quot;Config points to non-existing PEM file &amp;#39;${SIGNATURE_PRIVATE_KEY_FILE}&amp;#39;&amp;quot;)
  endif()
endif()&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CONFIG_SB_SIGNING_KEY_FILE&amp;nbsp; value is assigned to&amp;nbsp;&lt;/span&gt;SIGNATURE_PRIVATE_KEY_FILE.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When&amp;nbsp;I tested by removing the key in the prj.conf of the application I saw this when building:&amp;nbsp;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1676622410077v1.png" alt=" " /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If I have the key set in prj.conf of the application, I don&amp;#39;t see that warning when built:&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1676622472908v2.png" alt=" " /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom keys with updatable bootloader</title><link>https://devzone.nordicsemi.com/thread/410511?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2023 06:46:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd7d0efd-62bc-4c70-b7a3-8729b5032b17</guid><dc:creator>Mustafa</dc:creator><description>&lt;p&gt;Thanks Hung,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Actually, I&amp;#39;ve tried to debug the value&amp;nbsp;&lt;span&gt;CONFIG_SB_SIGNING_KEY_FILE in CMake of the bootloader in nrf but it seems that it always contains an empty string despite the assigned value in the prj.conf of the project.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom keys with updatable bootloader</title><link>https://devzone.nordicsemi.com/thread/409775?ContentTypeID=1</link><pubDate>Tue, 14 Feb 2023 09:22:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55a1f31f-d465-429a-82cf-0806cc4d1cea</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Mustafa,&amp;nbsp;&lt;br /&gt;I did a test and it worked for me. I used&amp;nbsp;CONFIG_SB_SIGNING_KEY_FILE=&amp;quot;C:/Pathtoyourkey/mykey2.pem&amp;quot; and can see that the key file is used.&lt;br /&gt;&lt;br /&gt;Attached is my project. Both MCUBoot and B0 use customized key files.&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/blinky_5F00_smp_5F00_uart_5F00_mykey_5F00_b0.zip"&gt;devzone.nordicsemi.com/.../blinky_5F00_smp_5F00_uart_5F00_mykey_5F00_b0.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom keys with updatable bootloader</title><link>https://devzone.nordicsemi.com/thread/409486?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 07:00:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:476785c8-68cc-4ccb-a223-03d98a9fedf3</guid><dc:creator>Mustafa</dc:creator><description>&lt;p&gt;[UPDATE]&lt;/p&gt;
&lt;p&gt;for MCUboot it works when I use an absolute path with&amp;nbsp;CONFIG_BOOT_SIGNATURE_KEY_FILE but still not working with secure bootloader (CONFIG_SB_SIGNING_KEY_FILE)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>