Allow mkimage -k to use either .key or .pem for PEM-encoded private keys.
Preserve the existing filename preference for backward compatibility.
Try the alternate extension only when the preferred key file is missing.

File-open errors such as EACCES previously allowed mkimage to succeed
without signing. These errors now cause failure. If neither key file
exists then mkimage skips the signature without failing.

Binman's FIT signing-key lookup still requires <key-name-hint>.key.
Support for .pem files in that lookup needs a separate contribution.

Ayoub Zaki (6):
  lib: rsa/ecdsa: Preserve FIT signing key file-open errors
  lib: ecdsa: Remove outdated key lookup comments
  lib: ecdsa: Accept .key private key files as a fallback
  lib: rsa: Accept .pem private key files as a fallback
  doc: fit: Document private key filename fallbacks
  test: fit: Cover private key filename fallbacks

 doc/mkimage.1                          |   5 +
 doc/usage/fit/signature.rst            |   7 +-
 lib/ecdsa/ecdsa-libcrypto.c            |  35 ++++---
 lib/rsa/rsa-sign.c                     |  22 ++++-
 test/py/tests/test_fit_key_fallback.py | 121 +++++++++++++++++++++++++
 5 files changed, 172 insertions(+), 18 deletions(-)
 create mode 100644 test/py/tests/test_fit_key_fallback.py
-- 
2.53.0

Reply via email to