diff options
author | Andres Morales <anmorales@google.com> | 2015-06-25 15:43:01 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-25 15:43:02 +0000 |
commit | 9a53bb0f809ae6d048646da2cf720d32d14f1a22 (patch) | |
tree | 074ac473fe6c058ba0d3666b5c98bcc5c398b84e /gatekeeperd | |
parent | e27ee08abb6b2b7a0d31dda4065c4c639b05ab16 (diff) | |
parent | 7f6dcf657680aaf51dcd5d41c32c89254779b2a8 (diff) | |
download | system_core-9a53bb0f809ae6d048646da2cf720d32d14f1a22.zip system_core-9a53bb0f809ae6d048646da2cf720d32d14f1a22.tar.gz system_core-9a53bb0f809ae6d048646da2cf720d32d14f1a22.tar.bz2 |
Merge "[gatekeeperd] fix issue with SW->HW upgrades" into mnc-dev
Diffstat (limited to 'gatekeeperd')
-rw-r--r-- | gatekeeperd/gatekeeperd.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gatekeeperd/gatekeeperd.cpp b/gatekeeperd/gatekeeperd.cpp index f4f2cbf..6622df9 100644 --- a/gatekeeperd/gatekeeperd.cpp +++ b/gatekeeperd/gatekeeperd.cpp @@ -144,7 +144,7 @@ public: const gatekeeper::password_handle_t *handle = reinterpret_cast<const gatekeeper::password_handle_t *>(current_password_handle); - if (handle != NULL && !handle->hardware_backed) { + if (handle != NULL && handle->version != 0 && !handle->hardware_backed) { // handle is being re-enrolled from a software version. HAL probably won't accept // the handle as valid, so we nullify it and enroll from scratch current_password_handle = NULL; @@ -209,7 +209,9 @@ public: if (device) { const gatekeeper::password_handle_t *handle = reinterpret_cast<const gatekeeper::password_handle_t *>(enrolled_password_handle); - if (handle->hardware_backed) { + // handle version 0 does not have hardware backed flag, and thus cannot be upgraded to + // a HAL if there was none before + if (handle->version == 0 || handle->hardware_backed) { ret = device->verify(device, uid, challenge, enrolled_password_handle, enrolled_password_handle_length, provided_password, provided_password_length, auth_token, auth_token_length, |