summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2026-03-06 11:12:46 -0700
committerSimon Glass <[email protected]>2026-03-18 06:14:16 -0600
commit0a806c3eb6ab16daaba3caf967c0b67d608028c0 (patch)
tree287f5b09dc07fb0f7de7a1220581d297ff9993a2
parentc28fbed34939ba7d39a04eecd40838439708e902 (diff)
binman: test: Move FIT signing test data to test/fit/
Move the signing-related test data (keys, certificates, OpenSSL and SoftHSM2 configuration, dummy engine source) into the fit/ subdirectory alongside the FIT DTS test files. Drop the 340_ prefix from files that had it. Update the Makefile and all ftest.py references. Signed-off-by: Simon Glass <[email protected]>
-rw-r--r--tools/binman/ftest.py20
-rw-r--r--tools/binman/test/Makefile2
-rw-r--r--tools/binman/test/fit/aes256.bin (renamed from tools/binman/test/aes256.bin)0
-rw-r--r--tools/binman/test/fit/dummy-rsa-engine.c (renamed from tools/binman/test/dummy-rsa-engine.c)0
-rw-r--r--tools/binman/test/fit/dummy-rsa4096.crt (renamed from tools/binman/test/340_dummy-rsa4096.crt)0
-rw-r--r--tools/binman/test/fit/openssl.conf (renamed from tools/binman/test/340_openssl.conf)0
-rw-r--r--tools/binman/test/fit/rsa2048.key (renamed from tools/binman/test/340_rsa2048.key)0
-rw-r--r--tools/binman/test/fit/softhsm2.conf (renamed from tools/binman/test/340_softhsm2.conf)0
8 files changed, 11 insertions, 11 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 601d1f7eb8c..76d17e6d986 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -7927,7 +7927,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
'default-dt': 'test-fdt1',
'atf-bl31-path': 'bl31.elf',
}
- data = tools.read_file(self.TestFile("340_rsa2048.key"))
+ data = tools.read_file(self.TestFile("fit/rsa2048.key"))
self._MakeInputFile("keys/rsa2048.key", data)
test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR)
@@ -7964,7 +7964,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
'atf-bl31-path': 'bl31.elf',
}
- x509_pubkey = '340_dummy-rsa4096.crt'
+ x509_pubkey = 'fit/dummy-rsa4096.crt'
data = tools.read_file(self.TestFile(x509_pubkey))
self._MakeInputFile('dev.crt', data)
@@ -8039,7 +8039,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
prefix = "testFitSignPKCS11Simple."
# Configure SoftHSMv2
- data = tools.read_file(self.TestFile('340_softhsm2.conf'))
+ data = tools.read_file(self.TestFile('fit/softhsm2.conf'))
softhsm2_conf = self._MakeInputFile(f'{prefix}softhsm2.conf', data)
softhsm2_tokens_dir = self._MakeInputDir(f'{prefix}softhsm2.tokens')
@@ -8070,7 +8070,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR)
# Make OpenSSL use softhsm2 engine
- ossl_conf = self.TestFile('340_openssl.conf')
+ ossl_conf = self.TestFile('fit/openssl.conf')
with unittest.mock.patch.dict('os.environ',
{'OPENSSL_CONF': ossl_conf,
'SOFTHSM2_CONF': softhsm2_conf}):
@@ -8114,7 +8114,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
prefix = "testFitSignPKCS11Object."
# Configure SoftHSMv2
- data = tools.read_file(self.TestFile('340_softhsm2.conf'))
+ data = tools.read_file(self.TestFile('fit/softhsm2.conf'))
softhsm2_conf = self._MakeInputFile(f'{prefix}softhsm2.conf', data)
softhsm2_tokens_dir = self._MakeInputDir(f'{prefix}softhsm2.tokens')
@@ -8147,7 +8147,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
# Make OpenSSL use softhsm2 engine and configure PIN for token
# The PIN is incorrect on purpose, the correct one will be passed by
# MKIMAGE_SIGN_PIN
- ossl_conf = self.TestFile('340_openssl.conf')
+ ossl_conf = self.TestFile('fit/openssl.conf')
with unittest.mock.patch.dict('os.environ',
{'OPENSSL_CONF': ossl_conf,
'SOFTHSM2_CONF': softhsm2_conf,
@@ -8204,9 +8204,9 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
'default-dt': 'test-fdt1',
'atf-bl31-path': 'bl31.elf',
}
- data = tools.read_file(self.TestFile("340_rsa2048.key"))
+ data = tools.read_file(self.TestFile("fit/rsa2048.key"))
self._MakeInputFile("keys1/rsa2048.key", data)
- data = tools.read_file(self.TestFile("340_rsa2048.key"))
+ data = tools.read_file(self.TestFile("fit/rsa2048.key"))
self._MakeInputFile("keys2/conf-rsa2048.key", data)
test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR)
@@ -8257,7 +8257,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
def testSimpleFitEncryptedData(self):
"""Test an image with a FIT containing data to be encrypted"""
- data = tools.read_file(self.TestFile("aes256.bin"))
+ data = tools.read_file(self.TestFile("fit/aes256.bin"))
self._MakeInputFile("keys/aes256.bin", data)
keys_subdir = os.path.join(self._indir, "keys")
@@ -8277,7 +8277,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
# Retrieve the key name from the FIT removing any null byte
key_name = fit.GetProps(subnode)['key-name-hint'].bytes.replace(b'\x00', b'')
- with open(self.TestFile(key_name.decode('ascii') + '.bin'), 'rb') as file:
+ with open(self.TestFile('fit/' + key_name.decode('ascii') + '.bin'), 'rb') as file:
key = file.read()
iv = fit.GetProps(subnode)['iv'].bytes.hex()
enc_data = fit.GetProps(node)['data'].bytes
diff --git a/tools/binman/test/Makefile b/tools/binman/test/Makefile
index d5e4c0f556a..6b42db6559f 100644
--- a/tools/binman/test/Makefile
+++ b/tools/binman/test/Makefile
@@ -85,7 +85,7 @@ blob_syms: blob_syms.c
elf_sections: CFLAGS += $(LDS_EFL_SECTIONS)
elf_sections: elf_sections.c
-dummy-rsa-engine.so: dummy-rsa-engine.c
+dummy-rsa-engine.so: $(SRC)fit/dummy-rsa-engine.c
$(CC) -fPIC -shared -lcrypto -lssl -o $@ $<
clean:
diff --git a/tools/binman/test/aes256.bin b/tools/binman/test/fit/aes256.bin
index 09b8bf6254a..09b8bf6254a 100644
--- a/tools/binman/test/aes256.bin
+++ b/tools/binman/test/fit/aes256.bin
diff --git a/tools/binman/test/dummy-rsa-engine.c b/tools/binman/test/fit/dummy-rsa-engine.c
index d163e917a8b..d163e917a8b 100644
--- a/tools/binman/test/dummy-rsa-engine.c
+++ b/tools/binman/test/fit/dummy-rsa-engine.c
diff --git a/tools/binman/test/340_dummy-rsa4096.crt b/tools/binman/test/fit/dummy-rsa4096.crt
index c426874431b..c426874431b 100644
--- a/tools/binman/test/340_dummy-rsa4096.crt
+++ b/tools/binman/test/fit/dummy-rsa4096.crt
diff --git a/tools/binman/test/340_openssl.conf b/tools/binman/test/fit/openssl.conf
index 9ab9dc739fe..9ab9dc739fe 100644
--- a/tools/binman/test/340_openssl.conf
+++ b/tools/binman/test/fit/openssl.conf
diff --git a/tools/binman/test/340_rsa2048.key b/tools/binman/test/fit/rsa2048.key
index e74b20cf392..e74b20cf392 100644
--- a/tools/binman/test/340_rsa2048.key
+++ b/tools/binman/test/fit/rsa2048.key
diff --git a/tools/binman/test/340_softhsm2.conf b/tools/binman/test/fit/softhsm2.conf
index dabaacb15a1..dabaacb15a1 100644
--- a/tools/binman/test/340_softhsm2.conf
+++ b/tools/binman/test/fit/softhsm2.conf