From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Tue, 30 Jun 2020 08:36:40 -0400 Subject: [PATCH v4 6/6] rockchip: make_fit_atf: add signature handling In-Reply-To: <20200619104550.1972307-7-heiko@sntech.de> References: <20200619104550.1972307-1-heiko@sntech.de> <20200619104550.1972307-7-heiko@sntech.de> Message-ID: <20200630123640.GD1306@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, Jun 19, 2020 at 12:45:50PM +0200, Heiko Stuebner wrote: > From: Heiko Stuebner > > 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 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: