diff options
author | Thomas Perrot <thomas.perrot@bootlin.com> | 2021-08-10 14:30:13 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-08-13 14:44:06 +0100 |
commit | da6ba4d0b88cbdb758d1b1b0794997814453410d (patch) | |
tree | 8fed916a548d62473cd8db585fa04d312da7c5ba /meta/lib | |
parent | 50d8801d72feb4e8a7e78cbbbc0dff889f9b03b0 (diff) | |
download | poky-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.py | 21 |
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 " | |||
114 | UBOOT_SIGN_ENABLE = "1" | 114 | UBOOT_SIGN_ENABLE = "1" |
115 | FIT_GENERATE_KEYS = "1" | 115 | FIT_GENERATE_KEYS = "1" |
116 | UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" | 116 | UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" |
117 | UBOOT_SIGN_KEYNAME = "oe-selftest" | 117 | UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest" |
118 | UBOOT_SIGN_KEYNAME = "cfg-oe-selftest" | ||
118 | FIT_SIGN_INDIVIDUAL = "1" | 119 | FIT_SIGN_INDIVIDUAL = "1" |
119 | UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" | 120 | UBOOT_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" | |||
266 | UBOOT_SIGN_ENABLE = "1" | 270 | UBOOT_SIGN_ENABLE = "1" |
267 | FIT_GENERATE_KEYS = "1" | 271 | FIT_GENERATE_KEYS = "1" |
268 | UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" | 272 | UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" |
269 | UBOOT_SIGN_KEYNAME = "oe-selftest" | 273 | UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest" |
274 | UBOOT_SIGN_KEYNAME = "cfg-oe-selftest" | ||
270 | FIT_SIGN_INDIVIDUAL = "1" | 275 | FIT_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 " | |||
348 | UBOOT_SIGN_ENABLE = "1" | 353 | UBOOT_SIGN_ENABLE = "1" |
349 | FIT_GENERATE_KEYS = "1" | 354 | FIT_GENERATE_KEYS = "1" |
350 | UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" | 355 | UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" |
351 | UBOOT_SIGN_KEYNAME = "oe-selftest" | 356 | UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest" |
357 | UBOOT_SIGN_KEYNAME = "cfg-oe-selftest" | ||
352 | FIT_SIGN_INDIVIDUAL = "1" | 358 | FIT_SIGN_INDIVIDUAL = "1" |
353 | UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart U-Boot comment'" | 359 | UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart U-Boot comment'" |
354 | """ | 360 | """ |
@@ -592,7 +598,8 @@ KERNEL_CLASSES = " kernel-fitimage test-mkimage-wrapper " | |||
592 | UBOOT_SIGN_ENABLE = "1" | 598 | UBOOT_SIGN_ENABLE = "1" |
593 | FIT_GENERATE_KEYS = "1" | 599 | FIT_GENERATE_KEYS = "1" |
594 | UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" | 600 | UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" |
595 | UBOOT_SIGN_KEYNAME = "kernel-oe-selftest" | 601 | UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest" |
602 | UBOOT_SIGN_KEYNAME = "cfg-oe-selftest" | ||
596 | FIT_SIGN_INDIVIDUAL = "1" | 603 | FIT_SIGN_INDIVIDUAL = "1" |
597 | """ | 604 | """ |
598 | self.write_config(config) | 605 | self.write_config(config) |