<?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>CONFIG_NRF_SECURITY mbedtls generated config doesn&amp;#39;t build</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89056/config_nrf_security-mbedtls-generated-config-doesn-t-build</link><description>In order to use &amp;quot;psa_&amp;quot; crypto functions I use &amp;quot;CONFIG_NRF_SECUIRTY=y&amp;quot;. I am also using mbedtls for TLS1.2 networking via external WiFi module 
 By using NRF Security, the project will no longer build 
 
 1 - The &amp;quot;mbedtls_ctr_drbg_*&amp;quot; functions are no longer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Jun 2022 13:55:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89056/config_nrf_security-mbedtls-generated-config-doesn-t-build" /><item><title>RE: CONFIG_NRF_SECURITY mbedtls generated config doesn't build</title><link>https://devzone.nordicsemi.com/thread/374185?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2022 13:55:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:228aa7a6-4c68-45d8-bbf5-664891c1ed24</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Brian,&lt;/p&gt;
&lt;p&gt;This Legacy Crypto Support mentioned in&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrfxlib/nrf_security/doc/configuration.html?highlight=psa#legacy-crypto-support"&gt;Configuration — nrfxlib 2.0.0 documentation (nordicsemi.com)&lt;/a&gt;&amp;nbsp;should allow you&amp;nbsp;to use the&amp;nbsp;&lt;span&gt;Mbed TLS crypto toolbox as previously way&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Charlie&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NRF_SECURITY mbedtls generated config doesn't build</title><link>https://devzone.nordicsemi.com/thread/373970?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2022 13:53:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f9e0491-f6ce-4a70-bcb8-59cff738a321</guid><dc:creator>bdodge09</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;I have had to stop using psa.&amp;nbsp; It is too overlapped with mbedtls in the SDK config, and mbedtls TLS connections don&amp;#39;t work when using psa (handshake fails due to hw accel failure error).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is there any way to just enable psa API&amp;nbsp; (or sven cc3x api) without any changes to mbedtls build/API/config?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NRF_SECURITY mbedtls generated config doesn't build</title><link>https://devzone.nordicsemi.com/thread/373964?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2022 13:35:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1351a899-4615-4087-a640-0dc2a8112855</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Brian,&lt;/p&gt;
&lt;p&gt;I have two suggestions for further debugging.&lt;/p&gt;
&lt;p&gt;1) Change to NCS 2.0.0 if you are still in the early aga of your development. From NCS2.0.0,&amp;nbsp;&lt;span&gt;Trusted Firmware M (TF-M) replaces the Secure Partition Manager (SPM) for secure image firmware. TF-M is now enabled by default for most nRF9160 and nRF5340 applications and samples.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Applications and Libraries in the Non-secure Processing Environment can utilize these secure services with standardized PSA Functional APIs from TF-M. You will high chance struggle with other issues when you want to upgrade to NCS2.0.0 from NCS1.9.1.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2) psa_export_key is used by v1.9.1\nrf\samples\crypto\hkdf sample without any issue, please compare its usages with your codes. I really hope to get minimal samples of your codes so&amp;nbsp;&lt;/span&gt;I can review and debug your codes on my side.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NRF_SECURITY mbedtls generated config doesn't build</title><link>https://devzone.nordicsemi.com/thread/373775?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 17:44:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7daef23-9b08-4c44-a9d5-a7503af2642a</guid><dc:creator>bdodge09</dc:creator><description>&lt;p&gt;Actually, this is even worse it turns out.&amp;nbsp; The symbol CONFIG_PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT is never defined so you aren&amp;#39;t really using crypto h/w in this sample.&amp;nbsp; Just psa functions which happen to just call back to mbedtls s/w functions to do the work.&lt;/p&gt;
&lt;p&gt;This is really wrong as far as I can tell&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NRF_SECURITY mbedtls generated config doesn't build</title><link>https://devzone.nordicsemi.com/thread/373768?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 16:57:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbf1f0bc-b4c3-4e1b-a1f6-14a1e5ebb252</guid><dc:creator>bdodge09</dc:creator><description>&lt;p&gt;Also, CONFIG_MBEDTLS_DEBUG_C=y is ignored and not defined in the generated header.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NRF_SECURITY mbedtls generated config doesn't build</title><link>https://devzone.nordicsemi.com/thread/373767?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 16:55:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4464c72d-b48f-4782-a697-9fc35ecffab0</guid><dc:creator>bdodge09</dc:creator><description>&lt;p&gt;Thank you.&amp;nbsp; That is closer.&amp;nbsp; I am still having issues with that&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1) There are functions like &amp;quot;psa_export_key&amp;quot; which we need that aren&amp;#39;t built with this configurati0on.&amp;nbsp; To enable that, you have to add CONFIG_MBEDTLS_PSA_CRYPTO_C=y&amp;nbsp; but that is ignored by the build. Also CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN in the prj file is ignroed (and flagged as a warning) but at least it isn&amp;#39;t set to 1 with this configuraton&lt;/p&gt;
&lt;p&gt;2) The psa build doesn&amp;#39;t properly do TLS handshake. I get an &amp;quot;prf&amp;quot; error (HW Accel Failed)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NRF_SECURITY mbedtls generated config doesn't build</title><link>https://devzone.nordicsemi.com/thread/373738?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 14:14:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28314af8-cfb5-448e-afa8-d796825f5c6f</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Brian,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply.&lt;/p&gt;
&lt;p&gt;I found we actually have sample&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/samples/crypto/psa_tls/README.html"&gt;Crypto: PSA TLS — nRF Connect SDK 1.9.1 documentation (nordicsemi.com)&lt;/a&gt;&amp;nbsp;demonstrating&amp;nbsp;how to use Nordic Security Backend.&lt;/p&gt;
&lt;p&gt;It is enabled with the following configuration:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;# mbed TLS and security&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MBEDTLS_PK_C&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MBEDTLS_RSA_C&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MBEDTLS_PKCS1_V15&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MBEDTLS_ENABLE_HEAP&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MBEDTLS_HEAP_SIZE&lt;/span&gt;&lt;span&gt;=55936&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MBEDTLS_TLS_LIBRARY&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MBEDTLS_X509_LIBRARY&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_NRF_SECURITY_ADVANCED&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_NORDIC_SECURITY_BACKEND&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;You can enable mbed TLS debug with&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MBEDTLS_DEBUG_C&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I have tested the&amp;nbsp;original&amp;nbsp;&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/samples/crypto/psa_tls/README.html"&gt;Crypto: PSA TLS&lt;/a&gt;&amp;nbsp;sample and hellow_world, and both of them have no errors for the build.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;For the Zigbee AES methods selection, I try to inquire our development team and still waiting for a reply.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NRF_SECURITY mbedtls generated config doesn't build</title><link>https://devzone.nordicsemi.com/thread/373070?ContentTypeID=1</link><pubDate>Fri, 17 Jun 2022 14:10:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d05a0b76-10b1-4e5e-9347-6cc3ce092c20</guid><dc:creator>bdodge09</dc:creator><description>&lt;p&gt;also, there are all kinds of other mbedtls config options disabled for what seems like no real reason.&amp;nbsp; for example, I can&amp;#39;t turn on PEM format support because of Kconfig rules which seem not-needed.&amp;nbsp; I cant even over-ride and use a custom mbedtls config file since the generated header files are included on the command line to compile psa sources, even of you turn off generated headers.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NRF_SECURITY mbedtls generated config doesn't build</title><link>https://devzone.nordicsemi.com/thread/372995?ContentTypeID=1</link><pubDate>Fri, 17 Jun 2022 11:21:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:692fb99e-ad8a-4bc0-ac39-db249ec4e013</guid><dc:creator>bdodge09</dc:creator><description>&lt;p&gt;I am based on 1.9.1&lt;/p&gt;
&lt;p&gt;For 1, I found the cause, and it was my fault. The Zigbee config was calling for CTR_DRBG.&lt;/p&gt;
&lt;p&gt;But Shouldn&amp;#39;t there be a way to use h/w AES for Zigbee?&amp;nbsp; the &amp;quot;CONFIG CRYPO_NRF_ECB&amp;quot; is de-selected for 5340 and the code in zigbee/osif/zb_nrf_crypto.c uses only that or CONFIG_ZIGBEE_USE_SOFTWARE_AES.&amp;nbsp; Why not NRF_SECURITY?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For 2, Any project if you add CONFIG_NRF_SECUIRTY=y will generate headers with &amp;quot;MBEDTLS_PK_WRITE_C&amp;quot; commented out and &amp;quot;MBEDTLS_PK_C&amp;quot; defined (because of TLS/DTLS additions).&amp;nbsp; Since CONFIG_NRF_SECUIRTY=y defines MBEDTLS_USE_PSA_CRYPTO, it compiles different code in mbedtls/library/pk_wrap.c which calls mbedtls_pk_write_pubkey (around line 586).&amp;nbsp; This is plainly a bug in the configuration since MBEDTLS_PK_WRITE_C would have to be defined in this case, but there is no way to define it since the generated headers turn it off, and even adding it to the project (CONFIG_MBEDTLS_PK_WRITE_C) doesn&amp;#39;t work since the generated headers don&amp;#39;t include autoconf.h and the generator ignores that as well.&lt;/p&gt;
&lt;p&gt;For 3, Again, try any project to turn on MBEDTLS_DEBUG&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NRF_SECURITY mbedtls generated config doesn't build</title><link>https://devzone.nordicsemi.com/thread/372982?ContentTypeID=1</link><pubDate>Fri, 17 Jun 2022 10:27:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:902e80ef-3890-4eec-9c01-e9bccb5a4e6f</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Brian,&lt;/p&gt;
&lt;p&gt;Which NCS version are you using? Can you provide a minimal sample that can reproduce this issue?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>