diff options
author | Ivan Mikhaylov | 2023-03-08 01:13:39 +0000 |
---|---|---|
committer | Simon Glass | 2023-03-14 16:08:51 -0600 |
commit | 4023dc9c95ccb5bcb3719c1c10e3d4dce967e0a2 (patch) | |
tree | fb4e2966687221cd1cba730be6446eb0e32bf6ed /tools/binman/cmdline.py | |
parent | 0f40e23fd2282809f62d2be6ea4eb8c1d995a09b (diff) |
binman: add sign option for binman
Introduce proof of concept for binman's new option which provides sign
and replace FIT containers in binary images.
Usage as example:
from:
mkimage -G privateky -r -o sha256,rsa4096 -F fit
binman replace -i flash.bin -f fit.fit fit
to:
binman sign -i flash.bin -k privatekey -a sha256,rsa4096 -f fit.fit fit
and to this one if it's need to be extracted, signed with key and put it
back in image:
binman sign -i flash.bin -k privatekey -a sha256,rsa4096 fit
Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
Diffstat (limited to 'tools/binman/cmdline.py')
-rw-r--r-- | tools/binman/cmdline.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/binman/cmdline.py b/tools/binman/cmdline.py index 1b7bbe80cda..4b875a9dcda 100644 --- a/tools/binman/cmdline.py +++ b/tools/binman/cmdline.py @@ -176,6 +176,19 @@ controlled by a description in the board device tree.''' replace_parser.add_argument('paths', type=str, nargs='*', help='Paths within file to replace (wildcard)') + sign_parser = subparsers.add_parser('sign', + help='Sign entries in image') + sign_parser.add_argument('-a', '--algo', type=str, required=True, + help='Hash algorithm e.g. sha256,rsa4096') + sign_parser.add_argument('-f', '--file', type=str, required=False, + help='Input filename to sign') + sign_parser.add_argument('-i', '--image', type=str, required=True, + help='Image filename to update') + sign_parser.add_argument('-k', '--key', type=str, required=True, + help='Private key file for signing') + sign_parser.add_argument('paths', type=str, nargs='*', + help='Paths within file to sign (wildcard)') + if HAS_TESTS: test_parser = subparsers.add_parser('test', help='Run tests') test_parser.add_argument('-P', '--processes', type=int, |