diff --git a/gatekeeperd/gatekeeperd.cpp b/gatekeeperd/gatekeeperd.cpp index 61c880409..578176578 100644 --- a/gatekeeperd/gatekeeperd.cpp +++ b/gatekeeperd/gatekeeperd.cpp @@ -25,14 +25,15 @@ #include #include +#include #include #include #include #include // for password_handle_t #include #include -#include #include // For error code +#include #include #include #include @@ -315,11 +316,15 @@ public: // TODO: cache service? sp sm = defaultServiceManager(); sp binder = sm->getService(String16("android.security.keystore")); - sp service = interface_cast(binder); + sp service = + interface_cast(binder); if (service != NULL) { - auto ret = service->addAuthToken(*auth_token, *auth_token_length); - if (!ret.isOk()) { - ALOGE("Failure sending auth token to KeyStore: %" PRId32, int32_t(ret)); + std::vector auth_token_vector(*auth_token, + (*auth_token) + *auth_token_length); + int result = 0; + auto binder_result = service->addAuthToken(auth_token_vector, &result); + if (!binder_result.isOk() || !keystore::KeyStoreServiceReturnCode(result).isOk()) { + ALOGE("Failure sending auth token to KeyStore: %" PRId32, result); } } else { ALOGE("Unable to communicate with KeyStore");