| 9bac0bb3 | 19-Aug-2013 |
Stefano Babic <sbabic@denx.de> |
tools: add variable padding of data image in mkimage
Use previously unused return value of function vrec_header to return a padding size to generic mkimage. This padding size is used in copy_files t
tools: add variable padding of data image in mkimage
Use previously unused return value of function vrec_header to return a padding size to generic mkimage. This padding size is used in copy_files to pad with zeros after copying the data image.
Signed-off-by: Stefano Babic <sbabic@denx.de>
show more ...
|
| 377e367a | 26-Jun-2013 |
Stefano Babic <sbabic@denx.de> |
tools: dynamically allocate imx_header in imximage
Change to dynamically allocate the imx_header to correctly allocate the IVT, Boot Data and DCD at correct locations depending on the boot media.
A
tools: dynamically allocate imx_header in imximage
Change to dynamically allocate the imx_header to correctly allocate the IVT, Boot Data and DCD at correct locations depending on the boot media.
Also check that the Image Vector Table Offset + IVT + Boot Data + DCD <= Initial Load Region Size.
Previously struct imx_header was always 4096 bytes and was not dealing correctly with the Image Vector Table Offset.
Now, the memory allocation looks for e.g. SD boot like this
Storage u-boot.imx RAM Device
00000000 177ff000 <-------------- | 00000400 00000000 d1 00 20 40 IVT.header 177ff400 <------- | 00000404 00000004 00 00 80 17 IVT.entry 177ff404 ----------- | 00000408 00000008 00 00 00 00 IVT.reserved1 177ff408 | | | 0000040C 0000000C 2c f4 7f 17 IVT.dcd 177ff40C ------ | | | 00000410 00000010 20 f4 7f 17 IVT.boot 177ff410 ---- | | | | 00000414 00000014 00 f4 7f 17 IVT.self 177ff414 -------- | | 00000418 00000018 00 00 00 00 IVT.csf 177ff418 | | | | 0000041C 0000001C 00 00 00 00 IVT.reserved2 177ff41C | | | | 00000420 00000020 00 f0 7f 17 BootData.start 177ff420 <--- | | --- 00000424 00000024 00 60 03 00 BootData.length 177ff424 | | 00000428 00000028 00 00 00 00 BootData.plugin 177ff428 | | 0000042C 0000002C d2 03 30 40 DCD.header 177ff42C <----- | ... | 00001000 00000c00 13 00 00 ea U-Boot Start 17800000 <----------
While at it also remove the unused #define HEADER_OFFSET.
Signed-off-by: Stefano Babic <sbabic@denx.de>
show more ...
|
| 3150f92c | 26-Jun-2013 |
Stefano Babic <sbabic@denx.de> |
tools: rename mximage_flash_offset to imximage_ivt_offset
This better reflects the naming from the Reference Manual as well as fits better since "flash" is not really applicabe for SATA.
Signed-off
tools: rename mximage_flash_offset to imximage_ivt_offset
This better reflects the naming from the Reference Manual as well as fits better since "flash" is not really applicabe for SATA.
Signed-off-by: Stefano Babic <sbabic@denx.de>
show more ...
|
| 4d098529 | 13-Jun-2013 |
Simon Glass <sjg@chromium.org> |
image: Add support for signing of FIT configurations
While signing images is useful, it does not provide complete protection against several types of attack. For example, it it possible to create a
image: Add support for signing of FIT configurations
While signing images is useful, it does not provide complete protection against several types of attack. For example, it it possible to create a FIT with the same signed images, but with the configuration changed such that a different one is selected (mix and match attack). It is also possible to substitute a signed image from an older FIT version into a newer FIT (roll-back attack).
Add support for signing of FIT configurations using the libfdt's region support.
Please see doc/uImage.FIT/signature.txt for more information.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 399c744b | 13-Jun-2013 |
Simon Glass <sjg@chromium.org> |
mkimage: Add -r option to specify keys that must be verified
Normally, multiple public keys can be provided and U-Boot is not required to use all of them for verification. This is because some image
mkimage: Add -r option to specify keys that must be verified
Normally, multiple public keys can be provided and U-Boot is not required to use all of them for verification. This is because some images may not be signed, or may be optionally signed.
But we still need a mechanism to determine when a key must be used. This feature cannot be implemented in the FIT itself, since anyone could change it to mark a key as optional. The requirement for key verification must go in with the public keys, in a place that is protected from modification.
Add a -r option which tells mkimage to mark all keys that it uses for signing as 'required'.
If some keys are optional and some are required, run mkimage several times (perhaps with different key directories if some keys are very secret) using the -F flag to update an existing FIT.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| 4f610427 | 13-Jun-2013 |
Simon Glass <sjg@chromium.org> |
mkimage: Add -c option to specify a comment for key signing
When signing an image, it is useful to add some details about which tool or person is authorising the signing. Add a comment field which c
mkimage: Add -c option to specify a comment for key signing
When signing an image, it is useful to add some details about which tool or person is authorising the signing. Add a comment field which can take care of miscellaneous requirements.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| 95d77b44 | 13-Jun-2013 |
Simon Glass <sjg@chromium.org> |
mkimage: Add -F option to modify an existing .fit file
When signing images it is sometimes necessary to sign with different keys at different times, or make the signer entirely separate from the FIT
mkimage: Add -F option to modify an existing .fit file
When signing images it is sometimes necessary to sign with different keys at different times, or make the signer entirely separate from the FIT creation to avoid needing the private keys to be publicly available in the system.
Add a -F option so that key signing can be a separate step, and possibly done multiple times as different keys are avaiable.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| e29495d3 | 13-Jun-2013 |
Simon Glass <sjg@chromium.org> |
mkimage: Add -K to write public keys to an FDT blob
FIT image verification requires public keys. Add a convenient option to mkimage to write the public keys to an FDT blob when it uses then for sign
mkimage: Add -K to write public keys to an FDT blob
FIT image verification requires public keys. Add a convenient option to mkimage to write the public keys to an FDT blob when it uses then for signing an image. This allows us to use:
mkimage -f test.its -K dest.dtb -k keys test.fit
and have the signatures written to test.fit and the corresponding public keys written to dest.dtb. Then dest.dtb can be used as the control FDT for U-Boot (CONFIG_OF_CONTROL), thus providing U-Boot with access to the public keys it needs.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| 80e4df8a | 13-Jun-2013 |
Simon Glass <sjg@chromium.org> |
mkimage: Add -k option to specify key directory
Keys required for signing images will be in a specific directory. Add a -k option to specify that directory.
Also update the mkimage man page with th
mkimage: Add -k option to specify key directory
Keys required for signing images will be in a specific directory. Add a -k option to specify that directory.
Also update the mkimage man page with this information and a clearer list of available commands.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de> (v1)
show more ...
|
| 19c402af | 13-Jun-2013 |
Simon Glass <sjg@chromium.org> |
image: Add RSA support for image signing
RSA provides a public key encryption facility which is ideal for image signing and verification.
Images are signed using a private key by mkimage. Then at r
image: Add RSA support for image signing
RSA provides a public key encryption facility which is ideal for image signing and verification.
Images are signed using a private key by mkimage. Then at run-time, the images are verified using a private key.
This implementation uses openssl for the host part (mkimage). To avoid bringing large libraries into the U-Boot binary, the RSA public key is encoded using a simple numeric representation in the device tree.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|