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

Add support for creating self-decrypting binaries #2315

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

will-v-pi
Copy link
Contributor

This adds extra functionality to the pico_encrypt_binary function to allow creating self-decrypting binaries, including specifying the OTP page to use for the AES key.

pico_encrypt_binary(hello_encrypted
    ${CMAKE_CURRENT_LIST_DIR}/privateaes.bin
    EMBED
    OTP_KEY_PAGE 29)

The only non-backwards-compatible change it that if you previously called:

pico_encrypt_binary(my_target my_aesfile.bin my_sigfile.pem)

you now need to call

pico_encrypt_binary(my_target my_aesfile.bin SIGFILE my_sigfile.pem)

due to the new argument parsing. I think that this is fine, because the only time you'd pass a separated SIGFILE to pico_encrypt_binary is when you're using a different signing key for the binary vs the encrypted blob, which is not a common use case.

This PR requires use of the picotool encrypted-shares branch (raspberrypi/picotool#207), so should be merged at the same time as that.

For now, this function embeds the decrypting bootloader, but probably better to integrate (or replace) existing pico_encrypt_binary function
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.

1 participant