Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
imgtool: option to read key passphrase from environment
In a CI chain it is sometimes useful to automatically sign an image (e.g. once qualification tests have passed). Naturally, it is important to protect the private key in such cases. This patch provides that capability. The private key should be stored in a passphrase-protected PEM file in the usual way. The CI provider should be configured, through its secrets mechanism, to inject the passphrase as an environment variable of your choice. A new imgtool option is then used to specify that variable name, e.g.: imgtool --password-env=DEV_KEY_PASSPHRASE sign infile.hex outfile.hex This option also works for the other verbs that load keys (getpub, getpriv, imgfile). Note that argument ordering is critical. --password-env must appear before the verb!
- Loading branch information