<?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>MCUBOOT Hardware Key</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74798/mcuboot-hardware-key</link><description>Hi, 
 I trying to enable Hardware Key for mcuboot. 
 I do the following at mcuboot.conf 
 
 CONFIG_BOOT_HW_KEY =y 
 
 But I got the following error: 
 
 
 
 Do I miss something? Thanks,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 06 Jan 2022 04:51:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74798/mcuboot-hardware-key" /><item><title>RE: MCUBOOT Hardware Key</title><link>https://devzone.nordicsemi.com/thread/346334?ContentTypeID=1</link><pubDate>Thu, 06 Jan 2022 04:51:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82e2f851-3977-4899-b3f5-a917194824e0</guid><dc:creator>hyper</dc:creator><description>&lt;p&gt;Yeah, sorry about wasting your time there - I was in a rush and I just looked at the code rather than trying to compile it, and I missed the additional mcuboot_config.h #include in bootutil_priv.h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Hardware Key</title><link>https://devzone.nordicsemi.com/thread/345859?ContentTypeID=1</link><pubDate>Tue, 04 Jan 2022 10:28:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97e83a9e-7892-45e6-9ab5-68a9321804c7</guid><dc:creator>Sigurd</dc:creator><description>[quote user="hyper"]AFAICT, there is still the same sort of bug in single_loader.c that hasn&amp;#39;t been fixed upstream yet.[/quote][quote user="hyper"]I think that a similar #include order issue may also be present in single_loader.c, because, for example, bootutil_priv.h depends on MCUBOOT_ENC_IMAGES. But that appears to be set in mcuboot_config.h, which is included later.[/quote]
&lt;p&gt;Are you able to trigger an issue here? I think this should be ok, since&amp;nbsp;bootutil_priv.h includes&amp;nbsp;mcuboot_config.h&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Hardware Key</title><link>https://devzone.nordicsemi.com/thread/344696?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 22:12:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:772c94e0-454f-48bf-b03b-978c38609d00</guid><dc:creator>hyper</dc:creator><description>&lt;p&gt;Thanks, that&amp;#39;s good to see.&lt;/p&gt;
&lt;p&gt;AFAICT, there is still the same sort of bug in single_loader.c that hasn&amp;#39;t been fixed upstream yet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Hardware Key</title><link>https://devzone.nordicsemi.com/thread/344634?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 14:31:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43fa7436-6a80-447f-8991-116fe8dffb41</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="hyper"]This looks to me to be a bug in keys.c, because sign_key.h is being #include&amp;#39;d&amp;nbsp;&lt;strong&gt;before&lt;/strong&gt; mcuboot_config.h rather than after it.[/quote]
&lt;p&gt;The issue is resolved upstream:&amp;nbsp;&lt;a href="https://github.com/mcu-tools/mcuboot/pull/1156"&gt;https://github.com/mcu-tools/mcuboot/pull/1156&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We have &lt;span&gt;opened&amp;nbsp;&lt;/span&gt;a PR to include the fix in our fork here:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-mcuboot/pull/190"&gt;https://github.com/nrfconnect/sdk-mcuboot/pull/190&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Hardware Key</title><link>https://devzone.nordicsemi.com/thread/344059?ContentTypeID=1</link><pubDate>Fri, 17 Dec 2021 07:04:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40883636-e032-4d3d-a6a3-f34373ebe074</guid><dc:creator>hyper</dc:creator><description>&lt;p&gt;BTW, I am referring to a recent version of sdk-nrf main branch in my posts here.&lt;/p&gt;
&lt;p&gt;I think that a similar #include order issue may also be present in single_loader.c, because, for example, bootutil_priv.h depends on MCUBOOT_ENC_IMAGES. But that appears to be set in mcuboot_config.h, which is included later.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m thinking I must be wrong about this though, as surely these options have been tested by someone upstream?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Hardware Key</title><link>https://devzone.nordicsemi.com/thread/344055?ContentTypeID=1</link><pubDate>Fri, 17 Dec 2021 06:51:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:360228c3-10da-4480-a333-0ca55783496f</guid><dc:creator>hyper</dc:creator><description>&lt;p&gt;This looks to me to be a bug in keys.c, because sign_key.h is being #include&amp;#39;d&amp;nbsp;&lt;strong&gt;before&lt;/strong&gt; mcuboot_config.h rather than after it.&lt;/p&gt;
&lt;p&gt;As a result,&amp;nbsp;&lt;span&gt;MCUBOOT_HW_KEY&lt;/span&gt;&amp;nbsp;is not defined when sign_key.h is processed at the start of compiling keys.c.&lt;/p&gt;
&lt;p&gt;If you swap those two #includes around, you should get further, and will then have to figure out the best way to incorporate an implementation of&amp;nbsp;&lt;span&gt;boot_retrieve_public_key_hash() into MCUBoot when it is built. I am not yet sure the best way to do that without having to maintain our own fork of the sdk-nrf repo (which we are trying hard to avoid).&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Hardware Key</title><link>https://devzone.nordicsemi.com/thread/344043?ContentTypeID=1</link><pubDate>Fri, 17 Dec 2021 04:55:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15a6ca1b-9727-40a2-8117-2b302ede27bd</guid><dc:creator>rtscts</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Is&amp;nbsp;&lt;span&gt;Mcuboot Hardware Key feature supported on NCS 1.8.0?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m getting exactly the same build error as was reported for 1.5.0.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Hardware Key</title><link>https://devzone.nordicsemi.com/thread/308900?ContentTypeID=1</link><pubDate>Mon, 10 May 2021 09:08:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83cbab82-24dc-4a61-8bb3-a5cacf3d043e</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Jasonho,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Mcuboot Hardware Key feature is not supported on NCS 1.5.&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Hardware Key</title><link>https://devzone.nordicsemi.com/thread/308816?ContentTypeID=1</link><pubDate>Fri, 07 May 2021 23:00:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dd1e572-b5c5-421f-b8b2-2f246fd4a3be</guid><dc:creator>Jasonho</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#ifndef MCUBOOT_HW_KEY
struct bootutil_key {
    const uint8_t *key;
    const unsigned int *len;
};

extern const struct bootutil_key bootutil_keys[];
#else
struct bootutil_key {
    uint8_t *key;
    unsigned int *len;
};

extern struct bootutil_key bootutil_keys[];

/**
 * Retrieve the hash of the corresponding public key for image authentication.
 *
 * @param[in]      image_index      Index of the image to be authenticated.
 * @param[out]     public_key_hash  Buffer to store the key-hash in.
 * @param[in,out]  key_hash_size    As input the size of the buffer. As output
 *                                  the actual key-hash length.
 *
 * @return                          0 on success; nonzero on failure.
 */
int boot_retrieve_public_key_hash(uint8_t image_index,
                                  uint8_t *public_key_hash,
                                  size_t *key_hash_size);
#endif /* !MCUBOOT_HW_KEY */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The above is from sign_key.h&lt;/p&gt;
&lt;p&gt;You can see that if MCUBOOT_HW_KEY is defined&lt;/p&gt;
&lt;p&gt;It will use&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;extern struct bootutil_key bootutil_keys[];&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So the issue is why MCUBOOT_HW_KEY is not define if I enable BOOT_HW_KEY&lt;/p&gt;
&lt;p&gt;But in keys.c, MCUBOOT_HW_KEY is defined.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I think this is the main issue.&lt;/p&gt;
&lt;p&gt;modify the code in your way is not appropriated&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Hardware Key</title><link>https://devzone.nordicsemi.com/thread/308639?ContentTypeID=1</link><pubDate>Fri, 07 May 2021 06:20:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c565cb9-7d4c-45be-a649-c106df12af72</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is a type conflict. One is const struct while the other is struct. Try defining the array as const&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;const struct bootutil_key bootutil_keys[1] = {...};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;
&lt;div&gt;
&lt;dl&gt;
&lt;dd&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dd&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>