<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: code signing tool with hardware security module in T-Series</title>
    <link>https://community.nxp.com/t5/T-Series/code-signing-tool-with-hardware-security-module/m-p/707854#M2210</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it's not asked to much, would it be possible to get a diff-patch of your modifications, as a starting point?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Nov 2017 17:08:10 GMT</pubDate>
    <dc:creator>lwn</dc:creator>
    <dc:date>2017-11-08T17:08:10Z</dc:date>
    <item>
      <title>code signing tool with hardware security module</title>
      <link>https://community.nxp.com/t5/T-Series/code-signing-tool-with-hardware-security-module/m-p/707852#M2208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code-signing-tool requires access to private/public keys for generating the secure boot headers.&lt;/P&gt;&lt;P&gt;However, the need for having private key files in plain text on the file system for using CST is rather bad.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Private/privileged cryptographic material should be generated and accessible only within a secured environment like a hardware-security-module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there (eventually going to be) any support in the CST to hand off RSA operations with private keys to a HSM?&lt;/P&gt;&lt;P&gt;Right now, there is always this loose end at the very beginning of the trusted-boot-chain, which contradicts best practices from a security standpoint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u-boot/mkimage already has such&amp;nbsp;capabilities: Add support for signing with pkcs11 -&amp;gt;&amp;nbsp;&lt;A class="" href="http://git.denx.de/?p=u-boot.git;a=commit;h=f1ca1fdebf1cde1c37c91b3d85f8b7af111112ea" title="http://git.denx.de/?p=u-boot.git;a=commit;h=f1ca1fdebf1cde1c37c91b3d85f8b7af111112ea"&gt;http://git.denx.de/?p=u-boot.git;a=commit;h=f1ca1fdebf1cde1c37c91b3d85f8b7af111112ea&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Aug 2017 09:26:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/T-Series/code-signing-tool-with-hardware-security-module/m-p/707852#M2208</guid>
      <dc:creator>lwn</dc:creator>
      <dc:date>2017-08-25T09:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: code signing tool with hardware security module</title>
      <link>https://community.nxp.com/t5/T-Series/code-signing-tool-with-hardware-security-module/m-p/707853#M2209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The CST v2.3.2 back end code, included with the tool, can be rewritten to support an HSM.&amp;nbsp; I ported it for my company to support the Amazon CloudHSM service.&amp;nbsp; Most of it is trivial, except for when you want to generate the signing information.&amp;nbsp; The HSM does not support CSM syntax signatures, but you can dig into the OpenSSL code and call the appropriate bits to construct the expected signature.&amp;nbsp; You will need to link directly to the libcrypto.a file, instead of dynamically loading your system's file.&amp;nbsp; Working through the OpenSSL code is tedious, but it's necessary.&amp;nbsp; You'll have to pick a specific OpenSSL version, and then stick with it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 21:34:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/T-Series/code-signing-tool-with-hardware-security-module/m-p/707853#M2209</guid>
      <dc:creator>brianmiller</dc:creator>
      <dc:date>2017-11-06T21:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: code signing tool with hardware security module</title>
      <link>https://community.nxp.com/t5/T-Series/code-signing-tool-with-hardware-security-module/m-p/707854#M2210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it's not asked to much, would it be possible to get a diff-patch of your modifications, as a starting point?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 17:08:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/T-Series/code-signing-tool-with-hardware-security-module/m-p/707854#M2210</guid>
      <dc:creator>lwn</dc:creator>
      <dc:date>2017-11-08T17:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: code signing tool with hardware security module</title>
      <link>https://community.nxp.com/t5/T-Series/code-signing-tool-with-hardware-security-module/m-p/707855#M2211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, the patch would be massive.&amp;nbsp; I've removed all unused functions, and rewritten a good chunk of what remained.&amp;nbsp; And then it would take weeks for the code to be cleared to be let out of the company.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the hard part is creating the final CMS signature, here's the sequence of OpenSSL functions you'll need to call:&lt;BR /&gt;EVP_get_digestbyname()&lt;BR /&gt;d2i_X509()&lt;BR /&gt;CMS_ContentInfo_new()&lt;BR /&gt;ASN1_OBJECT_free()&lt;BR /&gt;CMS_SignedData_init()&lt;BR /&gt;M_ASN1_new_of()&lt;BR /&gt;cms_set1_SignerIdentifier()&lt;BR /&gt;cms_DigestAlgorithm_set() /* for mechanism */&lt;BR /&gt;cms_DigestAlgorithm_set() /* for message digest algorithm */&lt;BR /&gt;sk_X509_ALGOR_push()&lt;BR /&gt;CMS_SignerInfo_get0_algs()&lt;BR /&gt;X509_ALGOR_set0()&lt;BR /&gt;sk_CMS_SignerInfo_push()&lt;BR /&gt;CMS_signed_add1_attr_by_NID() /* for message digest */&lt;BR /&gt;CMS_signed_add1_attr_by_NID() /* for X509_gmtime_adj() */&lt;BR /&gt;CMS_signed_add1_attr_by_NID() /* for content type */&lt;BR /&gt;ASN1_item_i2d() /* for signed attributes */&lt;BR /&gt;/* finalize HSM digest */&lt;BR /&gt;ASN1_STRING_set0() /* add signature data */&lt;BR /&gt;ASN1_item_i2d() /* for CMS content info */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of this is based on the OpenSSL code.&amp;nbsp; Look in cms_smime.c CMS_sign(), cms_sd.c CMS_add1_signer() and CMS_SignerInfo_sign().&amp;nbsp; First get familiar with the HSM sample code and functions, and then write a signature function.&amp;nbsp; Then you'll be able to plug it into the CST code without much difficulty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 21:13:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/T-Series/code-signing-tool-with-hardware-security-module/m-p/707855#M2211</guid>
      <dc:creator>brianmiller</dc:creator>
      <dc:date>2017-11-08T21:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: code signing tool with hardware security module</title>
      <link>https://community.nxp.com/t5/T-Series/code-signing-tool-with-hardware-security-module/m-p/707856#M2212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;we succesfully extended the CST backend code to allow signing code using HSM Module using PKCS11.&lt;/P&gt;&lt;P&gt;we&amp;nbsp;also&amp;nbsp;developed a solution that enable CST to remotely sign the code using Keys/HSM stored on other server over a secure channel.&lt;/P&gt;&lt;P&gt;For more information or inquiries you can contact us at :&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:info@embexus.com"&gt;info@embexus.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://embexus.com"&gt;https://embexus.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 12:09:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/T-Series/code-signing-tool-with-hardware-security-module/m-p/707856#M2212</guid>
      <dc:creator>ayoubzaki</dc:creator>
      <dc:date>2018-05-03T12:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: code signing tool with hardware security module</title>
      <link>https://community.nxp.com/t5/T-Series/code-signing-tool-with-hardware-security-module/m-p/707857#M2213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The best approach would be creating an OpenSSL engine which talks to your HSM.&lt;/P&gt;&lt;P&gt;You create the CMS signature using OpenSSL's public accessors. OpenSSL in his turn will offload any cryprohraphic operation involved during signing to the HSM.&lt;/P&gt;&lt;P&gt;You can find a detailed answer here&amp;nbsp;&lt;A href="https://community.nxp.com/message/1021666"&gt;https://community.nxp.com/message/1021666&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2018 14:07:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/T-Series/code-signing-tool-with-hardware-security-module/m-p/707857#M2213</guid>
      <dc:creator>marouene_boubakri</dc:creator>
      <dc:date>2018-05-23T14:07:41Z</dc:date>
    </item>
  </channel>
</rss>

