-
Notifications
You must be signed in to change notification settings - Fork 745
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
Unable to decrypt metadata encryption #1638
Comments
Decryption should be device specific issues. What device is this so I can move it to the appropriate project? We upgrade the key all the time because we do not want to mess with the key on /data/ We upgrade it in /tmp and use it there, and the key will exist simultaneously while TWRP decrypts with the upgraded key. |
In my case its a pixel 4a, I use tnakamur/android_device_google_sunfish
Ah, that explains the high value for AFAIU, the encrypted key is stored in a blob on the /metadata partition, and TEE generates a one-time key with which we can decrypt the blob. Is this correct? And why would the original key/blob (on /metadata) be changed when we don't upgrade the key? Would that mean that we can't access /data from the normal ROM anymore?
Do you by any chance have an idea/guess, why this upgrade is failing here? |
Sorry, we do not support the pixel 4a officially. |
I understand - If anyone finds the time to answer some of my questions, I'd be really greatful! I am trying to get this working for some time now. It feels to me as if this is a "bug"/situation which comes up on multiple different devices: Sony Xperia XZ3, Xiaomi Mi 10T Lite, Xperia XZ Premium, Pixel 4a |
I now think this is just the software KeyManager, the actual (propitiatory) QCom KeyManager gives its Tee Application some parameters, with which the TEE App then decides if an update is needed. So AFAIU, one would have to figure out what parameters the QCom KeyManager passes to the QCom TEE app, and why they are different from normal ROM. But since the QCom KeyManager propitiatory, I see no straightway to do this? However the Pixel 4 (and 3+5) are officially supported, and they probably also use a QCom KeyManager - So maybe one could look there for inspiration |
@bigbiff I assume it does, but have you checked weather metadata decryption works on Pixel 4? I saw your commit TeamWin/android_device_google_coral@4f6afd2 - Was that needed to get metadata decryption working on Pixel 4 A13? I tried the same value for pixel4a, but sadly still the same problem |
I haven't had time to look at the pixels in a while due to personal time constraints especially in A13. |
Maybe it would be worth / make sense to open an Issue for Pixel 4 to check if A13 metadata decryption is working? So that once once you or someone else finds the time this is not forgotten. Maybe it also just works on the Pixel 4, and that issue can then be simply closed |
This happens on multiple devices:
Places where I saw this:
The -62 means
KM_ERROR_KEY_REQUIRES_UPGRADE
, and -38 meansErrorCode.INVALID_ARGUMENT
.My first thought was that this happens when
PLATFORM_SECURITY_PATCH
is set too high, and thus this code reports to the caller that the key should be "upgraded" (which in succession fails):https://android.googlesource.com/platform/system/keymaster/+/tags/android-12.1.0_r27/android_keymaster/android_keymaster.cpp#66
However even adjusting
PLATFORM_SECURITY_PATCH
to what my normal ROM is using, this kept happening.I checked that my adjustment was working via these commands:
Unfortunately my Device (pixel 4a) uses an propitiatory keymaster implementation - Otherwise I would have tried to patch the previously mentioned function.
IMO the question is: Why does TWRP make the keymaster want to upgrade the key, and normal ROM does not?
The text was updated successfully, but these errors were encountered: