summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorThomas Perrot <thomas.perrot@bootlin.com>2021-08-10 14:30:13 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-13 14:44:06 +0100
commitda6ba4d0b88cbdb758d1b1b0794997814453410d (patch)
tree8fed916a548d62473cd8db585fa04d312da7c5ba /meta/lib
parent50d8801d72feb4e8a7e78cbbbc0dff889f9b03b0 (diff)
downloadpoky-da6ba4d0b88cbdb758d1b1b0794997814453410d.tar.gz
oeqa/selftest/fitimage: update tests to use two keys
Other keys (UBOOT_SIGN_IMG_KEYNAME) are required to sign individually the images nodes, and these keys must be different from the ones used to sign the configurations nodes (UBOOT_SIGN_KEYNAME), then fitimage tests need to be updated. (From OE-Core rev: dbaca2c2522ed0dc3d0a2f80dc4510aaec177afc) Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/cases/fitimage.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py
index 815ee48c05..184c8778d2 100644
--- a/meta/lib/oeqa/selftest/cases/fitimage.py
+++ b/meta/lib/oeqa/selftest/cases/fitimage.py
@@ -114,7 +114,8 @@ KERNEL_CLASSES = " kernel-fitimage test-mkimage-wrapper "
114UBOOT_SIGN_ENABLE = "1" 114UBOOT_SIGN_ENABLE = "1"
115FIT_GENERATE_KEYS = "1" 115FIT_GENERATE_KEYS = "1"
116UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" 116UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys"
117UBOOT_SIGN_KEYNAME = "oe-selftest" 117UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest"
118UBOOT_SIGN_KEYNAME = "cfg-oe-selftest"
118FIT_SIGN_INDIVIDUAL = "1" 119FIT_SIGN_INDIVIDUAL = "1"
119UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" 120UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'"
120""" 121"""
@@ -173,11 +174,11 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'"
173 174
174 reqsigvalues_image = { 175 reqsigvalues_image = {
175 'algo': '"sha256,rsa2048"', 176 'algo': '"sha256,rsa2048"',
176 'key-name-hint': '"oe-selftest"', 177 'key-name-hint': '"img-oe-selftest"',
177 } 178 }
178 reqsigvalues_config = { 179 reqsigvalues_config = {
179 'algo': '"sha256,rsa2048"', 180 'algo': '"sha256,rsa2048"',
180 'key-name-hint': '"oe-selftest"', 181 'key-name-hint': '"cfg-oe-selftest"',
181 'sign-images': '"kernel", "fdt"', 182 'sign-images': '"kernel", "fdt"',
182 } 183 }
183 184
@@ -215,7 +216,10 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'"
215 self.assertIn('conf-am335x-boneblack.dtb', signed_sections) 216 self.assertIn('conf-am335x-boneblack.dtb', signed_sections)
216 for signed_section, values in signed_sections.items(): 217 for signed_section, values in signed_sections.items():
217 value = values.get('Sign algo', None) 218 value = values.get('Sign algo', None)
218 self.assertEqual(value, 'sha256,rsa2048:oe-selftest', 'Signature algorithm for %s not expected value' % signed_section) 219 if signed_section.startswith("conf"):
220 self.assertEqual(value, 'sha256,rsa2048:cfg-oe-selftest', 'Signature algorithm for %s not expected value' % signed_section)
221 else:
222 self.assertEqual(value, 'sha256,rsa2048:img-oe-selftest', 'Signature algorithm for %s not expected value' % signed_section)
219 value = values.get('Sign value', None) 223 value = values.get('Sign value', None)
220 self.assertEqual(len(value), 512, 'Signature value for section %s not expected length' % signed_section) 224 self.assertEqual(len(value), 512, 'Signature value for section %s not expected length' % signed_section)
221 225
@@ -266,7 +270,8 @@ KERNEL_CLASSES = " kernel-fitimage"
266UBOOT_SIGN_ENABLE = "1" 270UBOOT_SIGN_ENABLE = "1"
267FIT_GENERATE_KEYS = "1" 271FIT_GENERATE_KEYS = "1"
268UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" 272UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys"
269UBOOT_SIGN_KEYNAME = "oe-selftest" 273UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest"
274UBOOT_SIGN_KEYNAME = "cfg-oe-selftest"
270FIT_SIGN_INDIVIDUAL = "1" 275FIT_SIGN_INDIVIDUAL = "1"
271""" 276"""
272 self.write_config(config) 277 self.write_config(config)
@@ -348,7 +353,8 @@ KERNEL_CLASSES = " kernel-fitimage test-mkimage-wrapper "
348UBOOT_SIGN_ENABLE = "1" 353UBOOT_SIGN_ENABLE = "1"
349FIT_GENERATE_KEYS = "1" 354FIT_GENERATE_KEYS = "1"
350UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" 355UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys"
351UBOOT_SIGN_KEYNAME = "oe-selftest" 356UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest"
357UBOOT_SIGN_KEYNAME = "cfg-oe-selftest"
352FIT_SIGN_INDIVIDUAL = "1" 358FIT_SIGN_INDIVIDUAL = "1"
353UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart U-Boot comment'" 359UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart U-Boot comment'"
354""" 360"""
@@ -592,7 +598,8 @@ KERNEL_CLASSES = " kernel-fitimage test-mkimage-wrapper "
592UBOOT_SIGN_ENABLE = "1" 598UBOOT_SIGN_ENABLE = "1"
593FIT_GENERATE_KEYS = "1" 599FIT_GENERATE_KEYS = "1"
594UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" 600UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys"
595UBOOT_SIGN_KEYNAME = "kernel-oe-selftest" 601UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest"
602UBOOT_SIGN_KEYNAME = "cfg-oe-selftest"
596FIT_SIGN_INDIVIDUAL = "1" 603FIT_SIGN_INDIVIDUAL = "1"
597""" 604"""
598 self.write_config(config) 605 self.write_config(config)