During intergration of server signing process I came to a concept of pipeline like “generate, decrypt, encrypt and sign” which allows signing server to abstract over internal binary generation process:
- Generate encrypted and signed binaries by
./flash.sh --no-flash -u ... -v ... ...
- Decrypt signed binaries back to get plaintext versions
- Sign and re-encrypt binaries on server with keys of actual target device (this process is repeated for every device and runs much faster than full
It turns out that MB1 BCT is different between insecure flashing (when no keys are specified in
flash.sh) and secure flashing (after decryption). The difference is really small (~300 bytes scattered across the file), but insecure device does not boot with MB1 BCT intended for secure device.
So, the question is: how information about whether device is in secured state affects the generation of MB1 BCT? What difference does it encode?