Skip to content

scripts: imgtool: added fixed signature script option #2252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DaBs
Copy link

@DaBs DaBs commented Apr 4, 2025

This PR adds the option of passing fix-sig-script as an external script to be called for signature generation, to then let the process continue as if it had generated the signature itself.

The current flow

To use a public key and an external signature provider, you'd have to:

  1. Run imgtool with --vector-to-sign to save the vector
  2. Fetch public key for signing
  3. Call external script with the vector to sign, save or otherwise pass signature
  4. Run imgtool again, this time providing it with --fix-sig and --fix-sig-pubkey
  5. Have signed image

New possible flow with proposed changes

  1. Fetch public key for signing
  2. Run imgtool with --fix-sig-script and --fix-sig-pubkey matching
  3. Have signed image

Codebases or other downstream dependencies that rely on baking in calls to imgtool and mainly having a singular call in the normal path, but otherwise taking in all imgtool options now gets to keep that, and simply provide the script as an extra option, but not needing a different flow from e.g. a debug build.

This lets the difference between e.g. a debug and a release build be entirely managed in the signature script, and so lets the same pipeline be used opaquely while still generating different builds signed with different keys depending on environment.

@DaBs DaBs requested a review from d3zd3z as a code owner April 4, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants