<?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: ECDSA accepts wrong keys, while CRC/SHA256 fails to boot valid app (SDK 17.1.0)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127046/dfu-ecdsa-accepts-wrong-keys-while-crc-sha256-fails-to-boot-valid-app-sdk-17-1-0</link><description>Hello, 
 Setup 
 
 MCU : nRF52840 
 SDK : nRF5 17.1.0 
 Transport : Secure Bootloader (UART) 
 No SoftDevice 
 Custom HW 
 
 The Problem: I am experiencing two conflicting behaviors regarding App Boot Validation during the initial factory flash (using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Feb 2026 07:26:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127046/dfu-ecdsa-accepts-wrong-keys-while-crc-sha256-fails-to-boot-valid-app-sdk-17-1-0" /><item><title>RE: DFU: ECDSA accepts wrong keys, while CRC/SHA256 fails to boot valid app (SDK 17.1.0)</title><link>https://devzone.nordicsemi.com/thread/561417?ContentTypeID=1</link><pubDate>Wed, 18 Feb 2026 07:26:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e962bf7-a4ca-4a08-be9e-e2094ea06c51</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I am glad you found the issue, and that it was not actually a bug in the bootloader. Thank you for letting us know what you found!&lt;/p&gt;
&lt;p&gt;Have a nice day &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU: ECDSA accepts wrong keys, while CRC/SHA256 fails to boot valid app (SDK 17.1.0)</title><link>https://devzone.nordicsemi.com/thread/561376?ContentTypeID=1</link><pubDate>Tue, 17 Feb 2026 15:11:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a232d22e-ee0d-4a82-91f1-7946f1759526</guid><dc:creator>Anthony-P</dc:creator><description>[quote userid="26071" url="~/f/nordic-q-a/127046/dfu-ecdsa-accepts-wrong-keys-while-crc-sha256-fails-to-boot-valid-app-sdk-17-1-0/561370"]You use --app-boot-validation every time you generate your bootloader settings, right?[/quote]
&lt;p&gt;Yes.&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/127046/dfu-ecdsa-accepts-wrong-keys-while-crc-sha256-fails-to-boot-valid-app-sdk-17-1-0/561370"]But it looks like you don&amp;#39;t perform the DFU in this case, right? You just program the application using the debugger?&amp;nbsp;[/quote]
&lt;p&gt;Yes again.&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/127046/dfu-ecdsa-accepts-wrong-keys-while-crc-sha256-fails-to-boot-valid-app-sdk-17-1-0/561370"]Not sure what is the issue here. Is the issue that you are not able to correctly reject the image? Or that the image is incorrectly accepted?[/quote]
&lt;p&gt;The problem was that when I signed the bootloader with the correct private.key, it would then accept a wrong key when updating through DFU.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However I found the problem, I had a bad case of not enough coffee. To test I correctly generated a wrong.key file. However when I was performing DFU I&amp;nbsp;grabbed the wrong.key from a different folder&amp;hellip; and, of course, that one contained the correct key. (-: Sorry for the inconvenience and thanks for the quick support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU: ECDSA accepts wrong keys, while CRC/SHA256 fails to boot valid app (SDK 17.1.0)</title><link>https://devzone.nordicsemi.com/thread/561370?ContentTypeID=1</link><pubDate>Tue, 17 Feb 2026 14:33:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ef836fe-6bd7-4b0d-95db-dcad5c57ce67</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;It is still a bit unclear to me what you are actually doing.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You use --app-boot-validation every time you generate your bootloader settings, right?&lt;/p&gt;
&lt;p&gt;Remember that these bootloader settings are only used if you program the application using a debugger, and not if you actually preform the DFU:&lt;/p&gt;
[quote user="Anthony0"]The sdk_config.h was modified because we don&amp;#39;t have a button to enter dfu mode so our goal is to have the app trigger the DFU using GPREGRET.[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But it looks like you don&amp;#39;t perform the DFU in this case, right? You just program the application using the debugger?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Anthony0"]Since&amp;nbsp;NRF_BL_APP_SIGNATURE_CHECK_REQUIRED was set to 1 in my sdk_config.h it always rejected the app.&lt;br /&gt;&lt;br /&gt;EDIT: I also did some further testing and if I modify the key dfu_public_key.c the bootloader correctly complains and reject the update. However if I leave the public key untouched it stills accepts the wrong private key[/quote]
&lt;p&gt;Not sure what is the issue here. Is the issue that you are not able to correctly reject the image? Or that the image is incorrectly accepted?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU: ECDSA accepts wrong keys, while CRC/SHA256 fails to boot valid app (SDK 17.1.0)</title><link>https://devzone.nordicsemi.com/thread/561361?ContentTypeID=1</link><pubDate>Tue, 17 Feb 2026 13:38:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34fbf18e-0ed2-4685-aaff-54709054a682</guid><dc:creator>Anthony-P</dc:creator><description>&lt;p&gt;I managed to fix the CRC/SHA256 failure, it came from this part of the code.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;else if (NRF_BL_APP_SIGNATURE_CHECK_REQUIRED &amp;amp;&amp;amp;
    (s_dfu_settings.boot_validation_app.type != VALIDATE_ECDSA_P256_SHA256))
{
    NRF_LOG_WARNING(&amp;quot;Boot validation failed. The boot validation of the app must be a signature check.&amp;quot;);
    return false;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Since&amp;nbsp;NRF_BL_APP_SIGNATURE_CHECK_REQUIRED was set to 1 in my sdk_config.h it always rejected the app.&lt;br /&gt;&lt;br /&gt;EDIT: I also did some further testing and if I modify the key dfu_public_key.c the bootloader correctly complains and reject the update. However if I leave the public key untouched it stills accepts the wrong private key.&lt;br /&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; &amp;lt;info&amp;gt; nrf_dfu_validation: Verify signature
00&amp;gt; &amp;lt;error&amp;gt; nrf_dfu_validation: Signature failed (err_code: 0x8542) &lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU: ECDSA accepts wrong keys, while CRC/SHA256 fails to boot valid app (SDK 17.1.0)</title><link>https://devzone.nordicsemi.com/thread/561353?ContentTypeID=1</link><pubDate>Tue, 17 Feb 2026 12:57:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4dfc9fa4-6d21-4d07-bbe7-a998b9ab93b1</guid><dc:creator>Anthony-P</dc:creator><description>&lt;p&gt;Hi Edvin, thanks a lot for your fast answer !&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Unfortunately I don&amp;#39;t have a DK. I did some minor modifications&amp;nbsp; turning on some LEDs inside &lt;strong&gt;dfu_observer()&lt;/strong&gt; using the nrf_gpio_pin_set and clear to have a visual feedback. I also modified sdk_config.h and pca10056.h (to match our IO). I used the example &amp;quot;secure_bootloader_uart_mbr_pca10056&amp;quot;. The sdk_config.h was modified because we don&amp;#39;t have a button to enter dfu mode so our goal is to have the app trigger the DFU using GPREGRET.&lt;br /&gt;&lt;br /&gt;Here is the bash script I use to build the final.hex file.&lt;br /&gt;&lt;pre class="ui-code" data-mode="batchfile"&gt;mergehex -m nRF5_SDK_17.1.0_ddde560/components/softdevice/mbr/hex/mbr_nrf52_2.4.1_mbr.hex secure_bootloader_uart_mbr_pca10056.hex -o system.hex 

nrfutil settings generate --app-boot-validation VALIDATE_ECDSA_P256_SHA256 --key-file private.key  --family NRF52840 --application app.hex --application-version 1 --bootloader-version 1 --bl-settings-version 2 settings.hex

mergehex -m app.hex settings.hex -o package.hex
mergehex -m package.hex system.hex -o final.hex

nrfjprog --eraseall
nrfjprog --program final.hex --verify
nrfjprog --reset&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU: ECDSA accepts wrong keys, while CRC/SHA256 fails to boot valid app (SDK 17.1.0)</title><link>https://devzone.nordicsemi.com/thread/561350?ContentTypeID=1</link><pubDate>Tue, 17 Feb 2026 12:36:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4273320-659a-4a8c-b65e-dcb36fecdbac</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Did you do any modifications to the bootloader, other than the sdk_config.h file? Are you able to reproduce what you are seeing on an nRF52840 DK? If you are, can you please zip and upload the bootloader project that you are using, so that I can try to reproduce it using an nRF52840 DK on my end.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>