<?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>Signing and verifying with OpenSSL vs. nrfutil</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/120900/signing-and-verifying-with-openssl-vs-nrfutil</link><description>The issue I&amp;#39;m having is signature verification failing when I sign my firmware package and perform a DFU. I&amp;#39;ve generated signing key pairs with the nrfutil CLI tool, signed a package, and performed a DFU successfully (following the bootloader example</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 25 Apr 2025 15:46:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/120900/signing-and-verifying-with-openssl-vs-nrfutil" /><item><title>RE: Signing and verifying with OpenSSL vs. nrfutil</title><link>https://devzone.nordicsemi.com/thread/533053?ContentTypeID=1</link><pubDate>Fri, 25 Apr 2025 15:46:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41953d2f-9c58-43f5-91d1-57b3d9fab565</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi, please let me know if you have made any progress on this. I have not had enough time to investigate this further. Regarding endianess, at least the public key is split into R and S in the code. This is relevant if you need to swap the byte order of that key:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/75260/ecdsa-with-nrfutil-generated-key/311211"&gt;RE: ECDSA with nrfutil generated key&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Signing and verifying with OpenSSL vs. nrfutil</title><link>https://devzone.nordicsemi.com/thread/532835?ContentTypeID=1</link><pubDate>Thu, 24 Apr 2025 13:11:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b63a6645-4029-46ef-a841-346a7ac85d0d</guid><dc:creator>fwd159</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;Thanks for your reply!&lt;/p&gt;
&lt;p&gt;I have a feeling the issue is a matter of byte order.&lt;/p&gt;
&lt;p&gt;I did use the nrfutil repo (signing.py) as a reference while looking into nrfutil and OpenSSL. I ended up writing a short script to test&amp;nbsp;the Python library that nrfutil uses (ecdsa) and the Python library our server uses (cryptography). I wanted to make sure without a doubt that it&amp;#39;s possible to sign an Init packet with one library and verify the signature with the other. After a first attempt to sign something with nrfutil, I noticed it was failing its own verification! This is when I realized that the ecdsa Python library likely&amp;nbsp;expects&amp;nbsp;big-endian data, but for Nordic, the signature needs to be stored in the Init packet as little-endian.&amp;nbsp;As long as the signature is in the right format, both libraries are able to verify the signatures.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure if it matters, but I know when we make the API call to the server, the server response is base 64 encoded.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried&amp;nbsp;the byte order both ways for the signature and both ways still fail signature verification. Do you have any recommendations? Also,&amp;nbsp;is the nrfutil verify function an accurate representation of the verification process that happens in the Bootloader during a DFU?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Signing and verifying with OpenSSL vs. nrfutil</title><link>https://devzone.nordicsemi.com/thread/532746?ContentTypeID=1</link><pubDate>Thu, 24 Apr 2025 08:07:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b5377c1-b7fc-4f5f-b64b-d3341842d009</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Unfortunately, we do not have any samples demonstrating how you can sign the DFU init packet with openssl. The SDK documentation only explains how you can create the keypair with openssl. Did you&amp;nbsp;use the&amp;nbsp;&lt;a href="https://github.com/NordicSemiconductor/pc-nrfutil/blob/master/nordicsemi/dfu/signing.py"&gt;https://github.com/NordicSemiconductor/pc-nrfutil/blob/master/nordicsemi/dfu/signing.py&lt;/a&gt;&amp;nbsp;implementation from nrfutil as a reference?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This thread may also be relevant:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/113154/aws-key-management-system---dfu-package-signing"&gt;AWS Key Management System - DFU Package Signing&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>