Skip to content
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

boot: zephyr: Add warning on default key file usage #2087

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

Conversation

nordicjm
Copy link
Collaborator

@nordicjm nordicjm commented Oct 8, 2024

Adds a warning if one of the default signing/encryption key files is used

Adds a warning if one of the default signing/encryption key
files is used

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Comment on lines +296 to +304
set(mcuboot_default_signature_files
${MCUBOOT_DIR}/root-ec-p256-pkcs8.pem
${MCUBOOT_DIR}/root-ec-p384.pem
${MCUBOOT_DIR}/root-ec-p384-pkcs8.pem
${MCUBOOT_DIR}/root-ed25519.pem
${MCUBOOT_DIR}/root-rsa-2048.pem
${MCUBOOT_DIR}/root-rsa-3072.pem
${MCUBOOT_DIR}/root-ec-p256.pem
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we will get that one lazy person that just overwrites the key, instead of changing path, and keeps on getting the warning.
Shouldn't we rather hardcode hash of all keys, that we provide with mcuboot, here and compare it to whatever gets assigned as key file and then issue the warning?

Also, in the future, we should rename the keys to something like "NON-PORDUCTION-root-blah.pem" keys...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately not, the actual MD5 of files depends on your git settings, on linux systems they will probably all match, those might differ on mac whereby the line ending was \r instead of \n, and on windows where the line ending is \r\n it will fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants