]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
kernel-signing-keys-native: refactor key generation into a new recipe
authorAdrian Freihofer <adrian.freihofer@siemens.com>
Tue, 3 Jun 2025 08:23:17 +0000 (10:23 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 5 Jun 2025 10:01:23 +0000 (11:01 +0100)
commit88736bb53fd2f0ffa1d249fc1a37897d10c8be18
tree08902b5e917126e18363f338d63c8423642f88a7
parentd9ae846307b640f6c85a67dee405cbaa6258efd4
kernel-signing-keys-native: refactor key generation into a new recipe

The do_kernel_generate_rsa_keys function from kernel-fitimage.bbclass
is moved to a new recipe, kernel-signing-keys-native.bb. This
refactoring introduces no functional changes.

Intention this change:
- Remove the dependency of uboot-sign.bbclass on kernel-fitimage.bbclass.
- Simplify the use of custom key generation implementations by
  isolating the functionality into a separate recipe.

Known limitations of this (and also the previous) implementation:
- When generating from an existing TMPDIR, the existing key is reused.
  However, when generating from an empty TMPDIR or an SDK using the
  sstate-cache, a new key is generated, which may lead to
  inconsistencies.
- The use of random keys (via FIT_GENERATE_KEYS) is convenient for
  experiments but unsuitable for production environments requiring
  deterministic and secure key management.

Future improvements to consider:
- Ensure reproducibility, even when using the sstate-cache. However,
  simply storing the private key in a potentially shared sstate artifact
  may not always be ideal from a security perspective.
- Support encrypted keys via `SRC_URI` for reliable key updates.
- Enable signing with an HSM (Hardware Security Module) through
  mechanisms like PKCS#11 or post-processing scripts.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/kernel-fitimage.bbclass
meta/classes-recipe/uboot-sign.bbclass
meta/recipes-kernel/kernel-signing-keys/kernel-signing-keys-native.bb [new file with mode: 0644]