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 note on writing OTP to enc bootloader #553

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

will-v-pi
Copy link
Contributor

Add a note on how to write the AES key to OTP to the encrypted bootloader readme - prompted by #552

@will-v-pi will-v-pi added this to the 2.0.1 milestone Sep 25, 2024
@lurch
Copy link
Contributor

lurch commented Sep 25, 2024

Would it be sensible for this README to refer people to chapter 10 of https://datasheets.raspberrypi.com/rp2350/rp2350-datasheet.pdf for more information about secure boot ?

@will-v-pi
Copy link
Contributor Author

Maybe chapter 5.10.1 instead, as that has more details on how to actually sign binaries? Or could point to both chapters

@lurch
Copy link
Contributor

lurch commented Sep 25, 2024

Maybe chapter 5.10.1 instead, as that has more details on how to actually sign binaries? Or could point to both chapters

I'll leave that decision entirely up to you, as you understand all of this much better than I do!

@will-v-pi will-v-pi requested a review from kilograham November 12, 2024 18:58
@@ -4,12 +4,19 @@ Replace private.pem and privateaes.bin with your own keys - your signing key mus
openssl ecparam -name secp256k1 -genkey -out private.pem
```

The AES key is just be a 32 byte binary file - you can create one with
The AES key is just a 32 byte binary file - you can create one with
Copy link
Contributor

Choose a reason for hiding this comment

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

: at the end


```bash
dd if=/dev/urandom of=privateaes.bin bs=1 count=32
```

You will need to program your OTP using the generated `otp.json` file in the build folder. Note that this will enable secure boot on your device, so only signed binaries can run, and will also lock down the OTP page the AES key is stored in. If you wish to test without enabling secure boot then you can load the `otp.json` file in the source folder, which will just program the AES key and lock down that OTP page.
Copy link
Contributor

Choose a reason for hiding this comment

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

is it clear what "the source folder" and "the build folder" are?

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it's worth adding a note telling the user that it's important that they don't lose the private.pem and privateaes.bin files?

@kilograham kilograham modified the milestones: 2.1.0, 2.1.1 Dec 5, 2024
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.

3 participants