mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Bastian Krause <bst@pengutronix.de>
To: ptxdist@pengutronix.de, Ladislav Michl <ladis@linux-mips.org>
Subject: Re: [ptxdist] [PATCH v3 2/6] package templates: add code-signing-provider template
Date: Thu, 24 Sep 2020 13:05:31 +0200	[thread overview]
Message-ID: <ebbda4c0-4003-e57d-08c0-ea8946358975@pengutronix.de> (raw)
In-Reply-To: <20200924100427.GA225235@lenoch>


Hi ladis,

On 9/24/20 12:04 PM, Ladislav Michl wrote:
> Hi and sorry to revive this old patch. I just hadn't time to finish 
> conversion to code-signing-provider sooner...

I'm always happy if we can improvde documentation patches, even after
some time has passed :)

> For those previously using scripts/rauc-gen-test-certs.sh above shoud
> read: import_rauc_keys() { local
> rauc_cert_dir=${PTXDIST_WORKSPACE}/configs/rauc

This is not intended. Let me quote the relevant documentation snippets:

"Finally, one or several code signing providers supply the mapping from
roles to the respective key material or even provide it themselves for
development." [1]

"A code signing provider is a package responsible for providing the role
↔ PKCS#11 URI relationships in case an HSM is used, or for providing the
key material in case SoftHSM is used." [2]

"In case of SoftHSM use cases the keys should also be placed inside
local_src/<name>-code-signing/" [3]

The key material should reside *in* the code signing provider, just as
in the devel provider [4].

[1] https://www.ptxdist.org/doc/dev_code_signing.html#code-signing
[2] https://www.ptxdist.org/doc/dev_code_signing.html#code-signing-providers
[3]
https://www.ptxdist.org/doc/dev_code_signing.html#creating-custom-code-signing-providers
[4] https://git.pengutronix.de/cgit/ptx-code-signing-dev/

> local r="update" cs_define_role "${r}"
> 
> # SoftHSM use case cs_import_cert_from_pem "${r}"
> "${rauc_cert_dir}/rauc.cert.pem" cs_import_key_from_pem "${r}"
> "${rauc_cert_dir}/rauc.key.pem" cs_append_ca_from_pem "${r}"
> "${rauc_cert_dir}/ca.cert.pem" }
> 
> scripts/rauc-gen-test-certs.sh generated those files and back then
> there was following note: 
> ===============================================================================
>
>  Note that the default application should be to set up a public key 
> infrastructure at your site and use keys and certificates genereated
> by these.
> 
> In oder to use the just generated files in your BSP for testing
> purpose or if you do not intend to use real authentification, follow
> the instructions below.
> 
> Place the key and certificate file in your platform-dir's config/
> folder:
> 
> cp rauc-openssl-ca/private/rauc.key.pem
> <platform-dir>/config/rauc/rauc.key.pem

ptxdist should have bailed out if it found a file at that location.
Unfortunately we checked for "<platform-dir>/config/rauc/rauc.key"
(missing the .pem suffix). That's a bug, fixed with
20200924104811.30246-1-bst@pengutronix.de on the ptxdist mailing list.

> cp rauc-openssl-ca/rauc.cert.pem 
> <platform-dir>/config/rauc/rauc.cert.pem
> 
> Place the keyring file in your platform-dir's projectroot/ folder:
> 
> cp rauc-openssl-ca/ca.cert.pem
> <plaform-dir>/projectroot/etc/rauc/ca.cert.pem
> 
> ===============================================================================
>
>  Perhaps it would be nice to mention than in documentation as it
> could save time to others.

After reading the quoted documentation snippets above (and assuming the
error message triggers correctly now), do you still think this needs
documentation improvement? If yes, you're very welcome to add an
explanation to the signing doc section (maybe an info box?) to help
others migrate their development key material into a code signing
provider for the sake of backwards compatibility.

Regards,
Bastian

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

  reply	other threads:[~2020-09-24 11:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 14:31 [ptxdist] [PATCH v3 0/6] Add code-signing-provider template, add code signing docs Bastian Krause
2020-06-17 14:31 ` [ptxdist] [PATCH v3 1/6] ptxd_lib_template: add ptxd_template_read_options Bastian Krause
2020-06-19  6:24   ` Michael Olbrich
2020-06-19  8:13     ` Bastian Krause
2020-06-19 22:04   ` [ptxdist] [APPLIED] " Michael Olbrich
2020-06-17 14:31 ` [ptxdist] [PATCH v3 2/6] package templates: add code-signing-provider template Bastian Krause
2020-06-18 11:40   ` Roland Hieber
2020-06-18 11:50     ` Bastian Krause
2020-06-19  6:12       ` Michael Olbrich
2020-06-19  6:28   ` Michael Olbrich
2020-06-19  7:52     ` Bastian Krause
2020-06-19 22:04   ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-24 10:04   ` [ptxdist] [PATCH v3 2/6] " Ladislav Michl
2020-09-24 11:05     ` Bastian Krause [this message]
2020-09-24 11:15       ` Ladislav Michl
2020-09-24 12:23         ` Bastian Krause
2020-06-17 14:31 ` [ptxdist] [PATCH v3 3/6] doc: dev_manual: split up into multiple files Bastian Krause
2020-06-19 22:04   ` [ptxdist] [APPLIED] " Michael Olbrich
2020-06-17 14:31 ` [ptxdist] [PATCH v3 4/6] doc: move code signing docs from scripts/ into doc/ Bastian Krause
2020-06-19 22:04   ` [ptxdist] [APPLIED] " Michael Olbrich
2020-06-17 14:31 ` [ptxdist] [PATCH v3 5/6] doc: dev_code_signing: rework and extend code signing section Bastian Krause
2020-06-19 22:04   ` [ptxdist] [APPLIED] " Michael Olbrich
2020-06-17 14:31 ` [ptxdist] [PATCH v3 6/6] doc: introduce ref_code_signing_helpers Bastian Krause
2020-06-19 22:04   ` [ptxdist] [APPLIED] " Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ebbda4c0-4003-e57d-08c0-ea8946358975@pengutronix.de \
    --to=bst@pengutronix.de \
    --cc=ladis@linux-mips.org \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox