summaryrefslogtreecommitdiffstats
path: root/gatekeeperd
diff options
context:
space:
mode:
authorAndres Morales <anmorales@google.com>2015-06-25 16:10:35 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-06-25 16:10:35 +0000
commitb15e63602d60c00ba4df801ef3634c86c08f2ac3 (patch)
tree889e86fc1dfa5d14a0b75045a0df4f13264d8dd0 /gatekeeperd
parenteb3aff3db8af817143d8029ccd98536720fe69fe (diff)
parentd3b8b72ec9cbaf202053f0281c33a8da432222ca (diff)
downloadsystem_core-b15e63602d60c00ba4df801ef3634c86c08f2ac3.tar.gz
system_core-b15e63602d60c00ba4df801ef3634c86c08f2ac3.tar.bz2
system_core-b15e63602d60c00ba4df801ef3634c86c08f2ac3.zip
am d3b8b72e: am 9a53bb0f: Merge "[gatekeeperd] fix issue with SW->HW upgrades" into mnc-dev
* commit 'd3b8b72ec9cbaf202053f0281c33a8da432222ca': [gatekeeperd] fix issue with SW->HW upgrades
Diffstat (limited to 'gatekeeperd')
-rw-r--r--gatekeeperd/gatekeeperd.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/gatekeeperd/gatekeeperd.cpp b/gatekeeperd/gatekeeperd.cpp
index f4f2cbfc3..6622df979 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,