Add support for ECDSA image signing
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest11 patches 0 repliesNew
- v4 posting 2/20 of 6 patches 0 repliesSuperseded
- v56 patches 0 repliesSuperseded
Earlier versions · 4
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v4 posting 1/2 | 6 patches | 0 replies | Superseded | |
| v3 | 6 patches | 0 replies | Superseded | |
| v2 RFC | 5 patches | 0 replies | Superseded | |
| v1 RFC | 4 patches | 0 replies | Superseded |
Changes in v6 from the cover letter
- Include "mkimage: Add a 'keyfile' argument for image signing" series
- Update python test to use 'keyfile' (-G) mkinage argument
- document which strings can be null in image.h
- Fix typo in python test (invokations -> invocations)
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | lib: Rename rsa-checksum.c to hash-checksum.ccommon/ common/ include/ +7 more | +11 | 1 reply | |
| 2/11 | lib/rsa: Make fdt_add_bignum() available outside of RSA codeinclude/ lib/ lib/ +1 more | +105 | 1 reply | |
| 3/11 | lib: Add support for ECDSA image signingcommon/ include/ include/ +2 more | +415 | 1 reply | |
| 4/11 | doc: signature.txt: Document devicetree format for ECDSA keysdoc/ | +6 | 1 reply | |
| 5/11 | test/py: Add pycryptodomex to list of required pakagestest/ | +1 | 1 reply | |
| 6/11 | test/py: ecdsa: Add test for mkimage ECDSA signingtest/ | +111 | 1 reply | |
| 7/11 | doc: signature.txt: Document the keydir and keyfile argumentsdoc/ | +13 | 1 reply | |
| 8/11 | mkimage: Add a 'keyfile' argument for image signinginclude/ tools/ tools/ +2 more | +52 | 1 reply | |
| 9/11 | lib/rsa: Use the 'keyfile' argument from mkimagelib/ | +26 | 1 reply | |
| 10/11 | lib/ecdsa: Use the 'keydir' argument from mkimage if appropriatelib/ | +13 | 1 reply | |
| 11/11 | test/py: ecdsa: Use mkimage keyfile instead of keydir argumenttest/ | +1 | 2 replies |
Reviews trailers per patch
All 11 patches have a Reviewed-by or Acked-by.
| Patch | Simon Glass |
|---|---|
| 1/11 | R-b |
| 2/11 | R-b |
| 3/11 | R-b |
| 4/11 | R-b |
| 5/11 | R-b |
| 6/11 | R-b |
| 7/11 | R-b |
| 8/11 | R-b |
| 9/11 | R-b |
| 10/11 | R-b |
| 11/11 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v6 00/11] Add support for ECDSA image signing
## Purpose and intent
The purpose of this series is to enable ECDSA as an alternative to RSA for FIT signing. As new chips have built-in support for ECDSA verified boot, it makes sense to stick to one signing algorithm, instead of resorting to RSA for u-boot images.
The focus of this series is signing an existing FIT image:
mkimage -F some-existing.fit -G some/key.pem
Signing while assembling a FIT is not a tested use case. This concatenates two series:
* Add support for ECDSA image signing (with test)
* mkimage: Add a 'keyfile' argument for image signing
# Testing
test/py/tests/test_fit_ecdsa.py is implemented withe the goal to check that the signing is done correctly, and that the signature is encoded in the proper raw format. Verification is done with pyCryptodomex, so this test will catch both coding errors and openssl bugs. This is the only scope of testing proposed here.
Changes since v5:
- Include "mkimage: Add a 'keyfile' argument for image signing" series
- Update python test to use 'keyfile' (-G) mkinage argument
- document which strings can be null in image.h
- Fix typo in python test (invokations -> invocations)
Changes since v4:
- Fixed tools/ build issue with # FIT_SIGNATURE is not selected
Changes since v3:
- Don't use 'log_msg_ret()', as it's not available host-side
Changes since v1 and v2:
- Added lots of function comments
- Replaced hardcoded error numbers with more meaningful errno numbers
- Changed some error paths to use 'return log_msg_ret'
Alexandru Gagniuc (11):
lib: Rename rsa-checksum.c to hash-checksum.c lib/rsa: Make fdt_add_bignum() available outside of RSA code
lib: Add support for ECDSA image signing
doc: signature.txt: Document devicetree format for ECDSA keys test/py: Add pycryptodomex to list of required pakages test/py: ecdsa: Add test for mkimage ECDSA signing
doc: signature.txt: Document the keydir and keyfile arguments
mkimage: Add a 'keyfile' argument for image signing lib/rsa: Use the 'keyfile' argument from mkimage lib/ecdsa: Use the 'keydir' argument from mkimage if appropriate test/py: ecdsa: Use mkimage keyfile instead of keydir argument
common/image-fit-sig.c | 2 +-
common/image-sig.c | 13 +-
doc/uImage.FIT/signature.txt | 20 +-
include/image.h | 21 +-
include/u-boot/ecdsa.h | 94 ++++++
include/u-boot/fdt-libcrypto.h | 27 ++
.../{rsa-checksum.h => hash-checksum.h} | 0
lib/Makefile | 1 +
lib/crypto/pkcs7_verify.c | 2 +-
lib/crypto/x509_public_key.c | 2 +-
lib/ecdsa/ecdsa-libcrypto.c | 318 ++++++++++++++++++
lib/fdt-libcrypto.c | 72 ++++
lib/{rsa/rsa-checksum.c => hash-checksum.c} | 3 +-
lib/rsa/Makefile | 2 +-
lib/rsa/rsa-sign.c | 99 ++----
test/py/requirements.txt | 1 +
test/py/tests/test_fit_ecdsa.py | 111 ++++++
tools/Makefile | 11 +-
tools/fit_image.c | 3 +-
tools/image-host.c | 58 ++--
tools/imagetool.h | 1 +
tools/mkimage.c | 6 +-
22 files changed, 752 insertions(+), 115 deletions(-)
create mode 100644 include/u-boot/ecdsa.h
create mode 100644 include/u-boot/fdt-libcrypto.h
rename include/u-boot/{rsa-checksum.h => hash-checksum.h} (100%)
create mode 100644 lib/ecdsa/ecdsa-libcrypto.c
create mode 100644 lib/fdt-libcrypto.c
rename lib/{rsa/rsa-checksum.c => hash-checksum.c} (96%)
create mode 100644 test/py/tests/test_fit_ecdsa.pySignature · 1 line
2.26.2