[PATCH v4 6/6] rockchip: make_fit_atf: add signature handling

Tom Rini trini at konsulko.com
Tue Jun 30 14:36:40 CEST 2020


On Fri, Jun 19, 2020 at 12:45:50PM +0200, Heiko Stuebner wrote:

> From: Heiko Stuebner <heiko.stuebner at theobroma-systems.com>
> 
> If the newly added fit-generator key-options are found, append needed
> signature nodes to all generated image blocks, so that they can get
> signed when mkimage later compiles the .itb from the generated .its.
> 
> Signed-off-by: Heiko Stuebner <heiko.stuebner at theobroma-systems.com>

First, I want to echo what Simon said.  We need to move towards having
less ad-hoc scripts for these kind of final modifiers.

> ---
>  arch/arm/mach-rockchip/make_fit_atf.py | 57 +++++++++++++++++++++++++-
>  1 file changed, 56 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py
> index d15c32b303..de7dc19d11 100755
> --- a/arch/arm/mach-rockchip/make_fit_atf.py
> +++ b/arch/arm/mach-rockchip/make_fit_atf.py
> @@ -14,6 +14,14 @@ import sys
>  import getopt
>  import logging
>  import struct
> +try:
> +	# in python3 Cryptodome succeeds Crypto
> +	import Cryptodome
> +	from Cryptodome.PublicKey import RSA
> +except:
> +	import Crypto
> +	from Crypto.PublicKey import RSA

Is it that older python3 would support "Cryto" not "Cryptodome"  or
python2?  If the latter, we should just drop it.  We do however need to
document, and should try and be user friendly about catching the
failure, that we now need the pycrypto module installed.  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200630/a6d2003a/attachment.sig>


More information about the U-Boot mailing list