@@ -11,8 +11,7 @@
# certificate in a directory and to define the following variable:
#
# UBOOT_SIGN_KEYDIR = "/keys/directory"
-# UBOOT_SIGN_KEYNAME = "dev" # keys name in keydir (eg. "dev.crt", "dev.key")
-# UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000"
+# UBOOT_SIGN_KEYNAME = "dev" # key name in keydir (eg. "dev.crt")
# UBOOT_SIGN_ENABLE = "1"
#
# As verified boot depends on fitImage generation, following is also required:
@@ -200,58 +199,24 @@ concat_dtb() {
# support is kept to avoid breakage of existing layers, but
# it is highly recommended to avoid FIT_SIGN_INDIVIDUAL = "1",
# i.e. set FIT_SIGN_INDIVIDUAL = "0" .
+ # Add the public keys of the kernel FIT signing keys to the
+ # U-Boot DTB. Only the certificates (<keyname>.crt) are needed.
if [ "${FIT_SIGN_INDIVIDUAL}" = "1" ] ; then
- # Sign dummy image images in order to
- # add the image signing keys to our dtb
- ${UBOOT_MKIMAGE_SIGN} \
- ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
- -f auto \
+ ${UBOOT_FDT_ADD_PUBKEY} \
+ -a "${FIT_HASH_ALG},${FIT_SIGN_ALG}" \
-k "${UBOOT_SIGN_KEYDIR}" \
- -o "${FIT_HASH_ALG},${FIT_SIGN_ALG}" \
- -g "${UBOOT_SIGN_IMG_KEYNAME}" \
- -K "${UBOOT_DTB_BINARY}" \
- -d /dev/null \
- -r ${B}/unused.itb \
- ${UBOOT_MKIMAGE_SIGN_ARGS}
+ -n "${UBOOT_SIGN_IMG_KEYNAME}" \
+ -r image \
+ "${UBOOT_DTB_BINARY}"
fi
- # Sign dummy image configurations in order to
- # add the configuration signing keys to our dtb
- ${UBOOT_MKIMAGE_SIGN} \
- ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
- -f auto-conf \
+ ${UBOOT_FDT_ADD_PUBKEY} \
+ -a "${FIT_HASH_ALG},${FIT_SIGN_ALG}" \
-k "${UBOOT_SIGN_KEYDIR}" \
- -o "${FIT_HASH_ALG},${FIT_SIGN_ALG}" \
- -g "${UBOOT_SIGN_KEYNAME}" \
- -K "${UBOOT_DTB_BINARY}" \
- -d /dev/null \
- -r ${B}/unused.itb \
- ${UBOOT_MKIMAGE_SIGN_ARGS}
+ -n "${UBOOT_SIGN_KEYNAME}" \
+ -r conf \
+ "${UBOOT_DTB_BINARY}"
- # Verify the dummy fitImage signature against u-boot.dtb
- # augmented using public key material.
- #
- # This only works for FIT_SIGN_INDIVIDUAL = "0", because
- # mkimage -f auto-conf does not support -F to extend the
- # existing unused.itb , and instead rewrites unused.itb
- # from scratch.
- #
- # Using two separate unused.itb for mkimage -f auto and
- # mkimage -f auto-conf invocation above would not help, as
- # the signature verification process below checks whether
- # all keys inserted into u-boot.dtb /signature node pass
- # the verification. Separate unused.itb would each miss one
- # of the signatures.
- #
- # The FIT_SIGN_INDIVIDUAL = "1" support is kept to avoid
- # breakage of existing layers, but it is highly recommended
- # to not use FIT_SIGN_INDIVIDUAL = "1", i.e. set
- # FIT_SIGN_INDIVIDUAL = "0" .
- if [ "${FIT_SIGN_INDIVIDUAL}" != "1" ] ; then
- ${UBOOT_FIT_CHECK_SIGN} \
- -k "${UBOOT_DTB_BINARY}" \
- -f ${B}/unused.itb
- fi
cp ${UBOOT_DTB_BINARY} ${UBOOT_DTB_SIGNED}
fi
@@ -32,3 +32,6 @@ SPL_MKIMAGE_SIGN_ARGS ?= ""
# uboot-fit_check_sign command
UBOOT_FIT_CHECK_SIGN ?= "uboot-fit_check_sign"
+
+# uboot-fdt_add_pubkey command, adds the public keys (.crt) to the U-Boot DTB
+UBOOT_FDT_ADD_PUBKEY ?= "uboot-fdt_add_pubkey"