Re: [ptxdist] [PATCH 04/13] ptxd_lib_code_signing: introduce CA helper

2020-05-15 Thread Bastian Krause
On 5/15/20 12:36 PM, Michael Olbrich wrote: > On Thu, May 14, 2020 at 03:42:51PM +0200, Bastian Krause wrote: >> These helpers allow key providers to append certificates to their CA. >> 'cs_get_ca ' then returns the path to the keyring allowing rules >> and other helpers to retrieve it easily.

[ptxdist] [PATCH v2 14/15] image-rauc: enable keyring verification

2020-05-15 Thread Bastian Krause
Note: requires genimage v13 or later Signed-off-by: Bastian Krause --- Changes since (implicit) v1: - clarify required version of genimage in commit message --- config/images/rauc.config | 1 + rules/image-rauc.make | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git

[ptxdist] [PATCH v2 08/15] ptxd_make_fit_image: call mkimage with ptxd_exec

2020-05-15 Thread Bastian Krause
It helps debugging failing mkimage calls. Signed-off-by: Bastian Krause --- scripts/lib/ptxd_make_fit_image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib/ptxd_make_fit_image.sh b/scripts/lib/ptxd_make_fit_image.sh index 761d6bf1e..041c5b803 100644 ---

[ptxdist] [PATCH v2 00/15] Fix/extend code signing infrastructure/consumers

2020-05-15 Thread Bastian Krause
This series includes various bug fixes and extensions of ptxdist's code signing infrastructure and its consumers. This includes HAB barebox images, signed FIT images and RAUC bundles. Real HSMs can now be used for signing. Newly introduced helpers simplify CA handling. Changes since implicit v1

[ptxdist] [PATCH v2 04/15] ptxd_lib_code_signing: introduce CA helper

2020-05-15 Thread Bastian Krause
These helpers allow key providers to append certificates to their CA. 'cs_get_ca ' then returns the path to the keyring allowing rules and other helpers to retrieve it easily. Signed-off-by: Bastian Krause --- Changes since (implicit) v1: - add new line when appending to a CA ---

[ptxdist] [PATCH v2 03/15] ptxd_lib_imx_hab: fix srk fuse file and table generation

2020-05-15 Thread Bastian Krause
srktool's help text states "certificate filenames must be separated by a ',' with no spaces". Line continuating using "\" with the next line being indented leads to a space being inserted between the SRK2 certificate and the SRK3 certificate. srktool does not fail, but ignores everything after the

[ptxdist] [PATCH v2 07/15] ptxd_lib_imx_hab/template-barebox-imx-habv4: make number of SRKs configurable

2020-05-15 Thread Bastian Krause
Signed-off-by: Bastian Krause --- rules/templates/template-barebox-imx-habv4-make | 2 +- scripts/lib/ptxd_lib_imx_hab.sh | 15 +-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/rules/templates/template-barebox-imx-habv4-make

[ptxdist] [PATCH v2 12/15] code-signing: introduce for ptxconfig, add sanity check

2020-05-15 Thread Bastian Krause
Create a new rules/code-signing.in to be able to select CODE_SIGNING not only in platformconfig but also in ptxconfig. Also make sure that PTXCONF_CODE_SIGNING_PROVIDER is set correctly if PTXCONF_CODE_SIGNING is set. Signed-off-by: Bastian Krause --- Changes since (implicit) v1: - re-add

[ptxdist] [PATCH v2 09/15] u-boot/ptxd_make_fit_image: avoid overriding object name

2020-05-15 Thread Bastian Krause
Having multiple "object=" occurrences in a single PKCS#11 URI does not work for all cases, at least not for opensc-pkcs11. Thus u-boot's PKCS#11 handling was patched to avoid overriding the object name when it is already specified. The patch was sent upstream. Signed-off-by: Bastian Krause ---

[ptxdist] [PATCH v2 15/15] rauc: version bump 1.2 -> 1.3

2020-05-15 Thread Bastian Krause
Signed-off-by: Bastian Krause --- Note: newly added in v2. --- rules/rauc.make | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules/rauc.make b/rules/rauc.make index f9a10fbbc..075a7d649 100644 --- a/rules/rauc.make +++ b/rules/rauc.make @@ -14,8 +14,8 @@

[ptxdist] [PATCH v2 11/15] code-signing: move code-signing.in to platforms/

2020-05-15 Thread Bastian Krause
rules/code-signing.in belongs in platforms/, so move it there. Signed-off-by: Bastian Krause --- {rules => platforms}/code-signing.in | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {rules => platforms}/code-signing.in (100%) diff --git a/rules/code-signing.in

[ptxdist] [PATCH v2 02/15] ptxd_lib_code_signing: return error string in cs_get_uri for make error case

2020-05-15 Thread Bastian Krause
Signed-off-by: Bastian Krause --- scripts/lib/ptxd_lib_code_signing.sh | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/lib/ptxd_lib_code_signing.sh b/scripts/lib/ptxd_lib_code_signing.sh index 588a4b1b4..f93f183df 100644 ---

[ptxdist] [PATCH v2 05/15] host-ptx-code-signing-dev: version bump 0.2 -> 0.4

2020-05-15 Thread Bastian Krause
This includes a fix of a copy/paste error in import_rauc_keys's role. Additionally the new helper cs_append_ca_from_uri is now used for RAUC and HAB SRK roles. The helper function requires HOST_EXTRACT_CERT, HOST_OPENSSL and HOST_LIBP11. Signed-off-by: Bastian Krause --- Changes since (implicit)

[ptxdist] [PATCH v2 13/15] rauc/image-rauc: use code signing infrastructure for key retrieval

2020-05-15 Thread Bastian Krause
Use the keys provided by the currently active key provider via PKCS#11 instead of key files placed in the platform config directory. In order to make sure the new mechanics are used after a BSP update the rauc.key file is no longer allowed to exist in the platformconfig directory. Note: requires

[ptxdist] [PATCH v2 10/15] ptxd_make_fit_image: sign ramdisk if enabled

2020-05-15 Thread Bastian Krause
Until now only kernel and fdt are signed by mkimage. If a ramdisk is used sign it also. Unfortunately quotes are not usable in the alternative value of variable paramater substitution ${parameter:+alt_value}:

[ptxdist] [PATCH v2 06/15] ptxd_lib_imx_hab/template-barebox-imx-habv4: use cs_get_ca helper

2020-05-15 Thread Bastian Krause
Key providers now take care of calling the CA helpers. This makes sure the CA is already present in pem format. Use that instead of extracting and converting the certs here again. Thus HOST_EXTRACT_CERT is no longer a dependency of template-barebox-imx-habv4. Note: requires ptx-code-signing-dev

Re: [ptxdist] [PATCH 13/13] code-signing: introduce for ptxconfig, add sanity check

2020-05-15 Thread Bastian Krause
On 5/15/20 9:55 AM, Michael Olbrich wrote: > On Thu, May 14, 2020 at 05:36:54PM +0200, Bastian Krause wrote: >> On 5/14/20 3:43 PM, Bastian Krause wrote: >>> Create a new rules/code-signing.in to be able to select CODE_SIGNING >>> not only in platformconfig but also in ptxconfig. >>> >>> Also make

Re: [ptxdist] [PATCH 11/13] image-rauc: enable keyring verification

2020-05-15 Thread Bastian Krause
On 5/15/20 9:58 AM, Michael Olbrich wrote: > On Thu, May 14, 2020 at 03:42:58PM +0200, Bastian Krause wrote: >> Note: requires genimage > 12 > > I think "genimage 13 or later" would be clearer here. On first glance I > thought that 12 is ok too and that's not correct. Right, will do. Regards,

Re: [ptxdist] Segmentation fault with ptxdist-2020.05.0

2020-05-15 Thread Mircea Ciocan
On 15.05.20 15:02, Mircea Ciocan wrote: On 15.05.20 09:46, Michael Olbrich wrote: On Thu, May 14, 2020 at 03:36:44PM +0200, Mircea Ciocan wrote: Hello list, I have the most strange error with the ptxdist-2020.05.0 while trying to compile a simple image for the iMX6ULL EVK, the shell

[ptxdist] [PATCH v2 01/15] host-genimage: version bump 11 -> 13

2020-05-15 Thread Bastian Krause
Signed-off-by: Bastian Krause --- rules/host-genimage.make | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules/host-genimage.make b/rules/host-genimage.make index 28d0d613a..baa69e3fb 100644 --- a/rules/host-genimage.make +++ b/rules/host-genimage.make @@ -14,8 +14,8 @@

Re: [ptxdist] [PATCH 04/13] ptxd_lib_code_signing: introduce CA helper

2020-05-15 Thread Jan Lübbe
On Fri, 2020-05-15 at 13:21 +0200, Bastian Krause wrote: > I guess if we first append a file with no EOL at the end and then > append something else this can lead to.. > > "-END CERTIFICATE--BEGIN CERTIFICATE-" > > .. on a single line. Yes, this is the case is was thinking of.

Re: [ptxdist] [PATCH 10/13] rauc/image-rauc: use code signing infrastructure for key retrieval

2020-05-15 Thread Bastian Krause
On 5/15/20 12:40 PM, Michael Olbrich wrote: > On Thu, May 14, 2020 at 03:42:57PM +0200, Bastian Krause wrote: >> Use the keys provided by the currently active key provider via PKCS#11 >> instead of key files placed in the platform config directory. In order >> to make sure the new mechanics are

Re: [ptxdist] [PATCH 06/13] ptxd_lib_imx_hab/template-barebox-imx-habv4: use cs_get_ca helper

2020-05-15 Thread Bastian Krause
On 5/15/20 12:37 PM, Michael Olbrich wrote: > On Thu, May 14, 2020 at 03:42:53PM +0200, Bastian Krause wrote: >> Key providers now take care of calling the CA helpers. This makes sure >> the CA is already present in pem format. Use that instead of extracting >> and converting the certs here again.

Re: [ptxdist] Segmentation fault with ptxdist-2020.05.0

2020-05-15 Thread Mircea Ciocan
On 15.05.20 09:46, Michael Olbrich wrote: On Thu, May 14, 2020 at 03:36:44PM +0200, Mircea Ciocan wrote: Hello list, I have the most strange error with the ptxdist-2020.05.0 while trying to compile a simple image for the iMX6ULL EVK, the shell segfaults !!! Here are some information, that

Re: [ptxdist] [PATCH 13/13] code-signing: introduce for ptxconfig, add sanity check

2020-05-15 Thread Michael Olbrich
On Thu, May 14, 2020 at 05:36:54PM +0200, Bastian Krause wrote: > On 5/14/20 3:43 PM, Bastian Krause wrote: > > Create a new rules/code-signing.in to be able to select CODE_SIGNING > > not only in platformconfig but also in ptxconfig. > > > > Also make sure that PTXCONF_CODE_SIGNING_PROVIDER is

Re: [ptxdist] Segmentation fault with ptxdist-2020.05.0

2020-05-15 Thread Mircea Ciocan
On 15.05.20 09:59, Alexander Dahl wrote: Hello Mircea, On Fri, May 15, 2020 at 09:40:45AM +0200, Mircea Ciocan wrote: The main problem is that the older releases as 2020.05.0 doesn't compile the toolchain correctly. Which toolchain? If you compile the OSELAS Toolchain by yourself (instead of

Re: [ptxdist] Segmentation fault with ptxdist-2020.05.0

2020-05-15 Thread Mircea Ciocan
More information about the subject: I've repeated the compilation with all releases since 2020.02.0, the same config and machine as described under (sorry for top posting): - 2020.02.0 - works OK -2020.03.0 - works OK -2020.04.0 - crashes, bash segfault. -2020.05.0 - crashes, same bash

Re: [ptxdist] Segmentation fault with ptxdist-2020.05.0

2020-05-15 Thread Michael Olbrich
On Thu, May 14, 2020 at 03:36:44PM +0200, Mircea Ciocan wrote: > Hello list, > > I have the most strange error with the ptxdist-2020.05.0 while trying to > compile a simple image for the iMX6ULL EVK, the shell segfaults !!! > > Here are some information, that you could find useful: > >

Re: [ptxdist] Segmentation fault with ptxdist-2020.05.0

2020-05-15 Thread Michael Olbrich
On Fri, May 15, 2020 at 09:40:45AM +0200, Mircea Ciocan wrote: > More information about the subject: > > I've repeated the compilation with all releases since 2020.02.0, the same > config and machine as described under (sorry for top posting): > > - 2020.02.0 - works OK > > -2020.03.0 - works

Re: [ptxdist] Segmentation fault with ptxdist-2020.05.0

2020-05-15 Thread Alexander Dahl
Hello Mircea, On Fri, May 15, 2020 at 09:40:45AM +0200, Mircea Ciocan wrote: > The main problem is that the older releases as 2020.05.0 doesn't compile the > toolchain correctly. Which toolchain? If you compile the OSELAS Toolchain by yourself (instead of e.g. using the prepackaged binary

Re: [ptxdist] [PATCH 11/13] image-rauc: enable keyring verification

2020-05-15 Thread Michael Olbrich
On Thu, May 14, 2020 at 03:42:58PM +0200, Bastian Krause wrote: > Note: requires genimage > 12 I think "genimage 13 or later" would be clearer here. On first glance I thought that 12 is ok too and that's not correct. Michael > Signed-off-by: Bastian Krause > --- > config/images/rauc.config |

Re: [ptxdist] [PATCH 04/13] ptxd_lib_code_signing: introduce CA helper

2020-05-15 Thread Michael Olbrich
On Thu, May 14, 2020 at 03:42:51PM +0200, Bastian Krause wrote: > These helpers allow key providers to append certificates to their CA. > 'cs_get_ca ' then returns the path to the keyring allowing rules > and other helpers to retrieve it easily. > > Signed-off-by: Bastian Krause > --- >

Re: [ptxdist] [PATCH 06/13] ptxd_lib_imx_hab/template-barebox-imx-habv4: use cs_get_ca helper

2020-05-15 Thread Michael Olbrich
On Thu, May 14, 2020 at 03:42:53PM +0200, Bastian Krause wrote: > Key providers now take care of calling the CA helpers. This makes sure > the CA is already present in pem format. Use that instead of extracting > and converting the certs here again. Thus HOST_EXTRACT_CERT is no longer > a

Re: [ptxdist] [PATCH 10/13] rauc/image-rauc: use code signing infrastructure for key retrieval

2020-05-15 Thread Michael Olbrich
On Thu, May 14, 2020 at 03:42:57PM +0200, Bastian Krause wrote: > Use the keys provided by the currently active key provider via PKCS#11 > instead of key files placed in the platform config directory. In order > to make sure the new mechanics are used after a BSP update the rauc.key > file is no