binman: add tests for sign option
Add the test which provides sequence of actions:
1. create the image from binman dts
2. create public and private keys
3. add public key into dtb with fdt_add_pubkey
4. 1. sign FIT container with new sign option with extracting from
image
2. sign exact FIT container with replacing of it in image
5. check with fit_check_sign
Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
Renumber test file from 277 to 280;
Move UpdateSignatures() to Entry base class;
Don't allow missing mkimage as it doesn't make sense;
Propagate --toolpath for CI;
Call mark_build_done() to avoid regenerating FIT:
Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Simon Glass
parent
4023dc9c95
commit
5b34efe865
63
tools/binman/test/280_fit_sign.dts
Normal file
63
tools/binman/test/280_fit_sign.dts
Normal file
@@ -0,0 +1,63 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
binman {
|
||||
size = <0x100000>;
|
||||
allow-repack;
|
||||
|
||||
fit {
|
||||
description = "U-Boot";
|
||||
offset = <0x10000>;
|
||||
images {
|
||||
u-boot-1 {
|
||||
description = "U-Boot";
|
||||
type = "standalone";
|
||||
arch = "arm64";
|
||||
os = "u-boot";
|
||||
compression = "none";
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
u-boot {
|
||||
};
|
||||
};
|
||||
|
||||
fdt-1 {
|
||||
description = "test.dtb";
|
||||
type = "flat_dt";
|
||||
arch = "arm64";
|
||||
compression = "none";
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
u-boot-spl-dtb {
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
configurations {
|
||||
default = "conf-1";
|
||||
conf-1 {
|
||||
description = "u-boot with fdt";
|
||||
firmware = "u-boot-1";
|
||||
fdt = "fdt-1";
|
||||
signature-1 {
|
||||
algo = "sha256,rsa4096";
|
||||
key-name-hint = "test_key";
|
||||
sign-images = "firmware", "fdt";
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fdtmap {
|
||||
};
|
||||
};
|
||||
};
|
||||
65
tools/binman/test/281_sign_non_fit.dts
Normal file
65
tools/binman/test/281_sign_non_fit.dts
Normal file
@@ -0,0 +1,65 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
binman {
|
||||
size = <0x100000>;
|
||||
allow-repack;
|
||||
|
||||
u-boot {
|
||||
};
|
||||
fit {
|
||||
description = "U-Boot";
|
||||
offset = <0x10000>;
|
||||
images {
|
||||
u-boot-1 {
|
||||
description = "U-Boot";
|
||||
type = "standalone";
|
||||
arch = "arm64";
|
||||
os = "u-boot";
|
||||
compression = "none";
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
u-boot {
|
||||
};
|
||||
};
|
||||
|
||||
fdt-1 {
|
||||
description = "test.dtb";
|
||||
type = "flat_dt";
|
||||
arch = "arm64";
|
||||
compression = "none";
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
u-boot-spl-dtb {
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
configurations {
|
||||
default = "conf-1";
|
||||
conf-1 {
|
||||
description = "u-boot with fdt";
|
||||
firmware = "u-boot-1";
|
||||
fdt = "fdt-1";
|
||||
signature-1 {
|
||||
algo = "sha256,rsa4096";
|
||||
key-name-hint = "test_key";
|
||||
sign-images = "firmware", "fdt";
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fdtmap {
|
||||
};
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user