bfb01d904d
We observed on some Pixel C that they sometimes generate auth token with a stuck timestamp value. Since the timestamp value does not increase, newer auth token is not considered "superceding" old auth tokens and keystore end up retrieving older auth tokens which are then treated as expired due to its time_received value being too old. We workaround this issue by comparing both the timestamp (which is part of auth token) and the time_received (which is a monotonic clock value at the time auth token is sent to keystore). So a new auth token with stuck timestamp value but newer time_received still supercedes older auth tokens. This is actually sufficient to workaround the issue on Pixel C, since the stuck timestamp value is returned by the secure RTC, whose value is also used by keymaster TA to check key authorization. In other words, the auth token is still good to authorize auth-bound keys, even with a stuck timestamp value. This does mean that on the affected Pixel C, auth-bound keys are not enforced at TrustZone leve, but merely a logical check in keystore daemon. Bug: 65283496 Test: boot device, unlock successfully Change-Id: I0b9d5463e94241bfaf552dcb31fea04ee966596c |
||
---|---|---|
.. | ||
include/keystore | ||
tests | ||
.clang-format | ||
Android.mk | ||
auth_token_table.cpp | ||
auth_token_table.h | ||
authorization_set.cpp | ||
blob.cpp | ||
blob.h | ||
defaults.h | ||
entropy.cpp | ||
entropy.h | ||
grant_store.cpp | ||
grant_store.h | ||
IKeystoreService.cpp | ||
key_store_service.cpp | ||
key_store_service.h | ||
KeyAttestationApplicationId.cpp | ||
KeyAttestationPackageInfo.cpp | ||
keyblob_utils.cpp | ||
keymaster_enforcement.cpp | ||
keymaster_enforcement.h | ||
keystore.cpp | ||
keystore.h | ||
keystore.rc | ||
keystore_aidl_hidl_marshalling_utils.cpp | ||
keystore_aidl_hidl_marshalling_utils.h | ||
keystore_attestation_id.cpp | ||
keystore_attestation_id.h | ||
keystore_cli.cpp | ||
keystore_cli_v2.cpp | ||
keystore_client.proto | ||
keystore_client_impl.cpp | ||
keystore_get.cpp | ||
keystore_get_wifi_hidl.cpp | ||
keystore_keymaster_enforcement.h | ||
keystore_main.cpp | ||
keystore_tags_utils.cpp | ||
keystore_utils.cpp | ||
keystore_utils.h | ||
legacy_keymaster_device_wrapper.cpp | ||
legacy_keymaster_device_wrapper.h | ||
operation.cpp | ||
operation.h | ||
permissions.cpp | ||
permissions.h | ||
Signature.cpp | ||
test-keystore | ||
user_state.cpp | ||
user_state.h |