Ammako Ammako Hey, thanks for replying. I'm not concerned with how the recovery is implemented in other operating systems or AOSP, as I don't use them, I use GrapheneOS 😊 I just wanted to know whether the GrapheneOS recovery accepts any OTA package that's trusted by the hardware, or only GrapheneOS versions that identical to the installed version or newer.
It's an interesting question because on one hand I can imagine that it could be useful to downgrade GrapheneOS if the latest version has some severe issue, but on the other hand it could be nice to be assured that downgrades of any kind are prevented by the GrapheneOS recovery as an extra measure on top of verified boot, which gives some assurance against mistakes when sideloading OTA updates.
Ammako A key being trusted only means that it can be used for verified boot with a locked bootloader, but verified boot ensures that they key needs to match with what is currently installed before it will allow updates to install. It doesn't accept overwriting the OS with a different one just because both keys are used. It's a security feature, otherwise it would be trivial to exploit GrapheneOS by reflashing the stock OS before trying to extract user data. Verified boot protects against this by enforcing that user data must be erased when unlocking the bootloader, as well.
A few months ago I asked here on the forum if the verified boot feature accounts to the scenario of an attacker managing to rewrite the system partitions of an outdated GrapheneOS installation with the authentic system partitions of an up-to-date stock OS installation, since both of their verified boot keys are trusted at the same time. The official GrapheneOS project account gave me a definitive answer that one of the inputs for deriving the keys used for disk encryption (for both Credential Encrypted (CE) and Device Encrypted (DE)) is the single verified boot key of the actively booted OS and not the whole trusted set of verified boot keys, in addition to green/yellow verified boot state and other OS-specific details. You mentioned flashing (which requires an unlocked bootloader) which isn't exactly what I meant, but assuming for a second that the GrapheneOS recovery allows sideloading the stock OS to downgrade from GrapheneOS to the stock OS without your data being erased, fortunately verified boot would make sure that your data stays inaccessible to the unhardened stock OS. (The moderators hid this discussion so you can't see it anymore, I'm not entirely sure why they did but oh well.)
Anyway, the only reason I'm asking all of it is just being curious what kinds of OTA packages the GrapheneOS recovery accepts.