[Cryptography] Help with Raspberry Pi IoT initialization...

Ralf Senderek crypto at senderek.ie
Thu Mar 10 08:03:53 EST 2016


>  The boot media has the following additional information:
>
>  * My Mesh profile fingerprint and account identifier

identifying one well-known user (me)

>  * A temporary device profile that contains a signature key pair

which is the same on all incarnations of the boot media

>  * A run once configuration tool

which is on the boot media, but not in the boot partition

>  * A digital signature of the boot partition excluding itself

or else this would not work.

>
>  When run, the run once tool does the following:
>
>  ? Verifies the boot media signature
You seem to assume that the boot media can self-verify, which - as I see it -
is impossible. There has to be two separate parts (the verification tool and
the boot partition) and you can verify the partition with the verification
tool and the signature value. Put all three in one part and you'll end up
with an unsolvable problem.

The best you can do is to adapt the LIVE-image DVD approach. Treat everything
on your boot media as read-only. On first use of the boot media, run a Unix
in pure memory (like isolinux) that starts your verification code. Then verify
the boot partition, that has never been touched before, and then boot it 
(chroot).
After this point the boot partition will change and no further verification
will succeed with the old signature value.

But, this will only work if the part that contains your memory-Unix and 
verification
code is kosher, you don't have a guarantee for that, as this part is unsigned.
No real solution, unless you get your boot media from a trustworthy source,
or unless you already possess a verification tool that can check the boot 
media's
signature independently.

>  ? Erases temporary device profile key(s)
>  What is the best way to guarantee that the temporary key is erased from the
>  boot media?

If you really want to erase the keys, your verification tool must create these 
keys in
pure memory not on disk, but then you'll have to extract this information
from the running device to use the device's temp. public key outside for 
verification
of signatures the device creates.

If the signing keys need to be on the boot media in the first place, physical 
access
to the raspberry pi's boot media must be prevented. All you can do is make sure
that an attacker cannot inspect the raspi's file system using the network 
connection.
With physical access you cannot guarantee anything.


       -- ralf



More information about the cryptography mailing list