summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanis Danisevskis <jdanis@google.com>2017-09-20 16:30:19 -0700
committerJanis Danisevskis <jdanis@google.com>2017-10-02 09:57:48 -0700
commit3f30364811676678084e7a459fa0f684f95d1221 (patch)
treeb633d239006c1a5f26a0ade16f367adac2452d69
parent00f94598c73b9b30a6855862b514dc53789b564c (diff)
downloadsecurity-3f30364811676678084e7a459fa0f684f95d1221.tar.gz
Fixed two bugs that broke the keystore granting mechanism
Bug: 65851049 Merged-In: Ibea71d42934d283c95729eca6772a9aadb949a6a Change-Id: Ibea71d42934d283c95729eca6772a9aadb949a6a
-rw-r--r--keystore/key_store_service.cpp2
-rw-r--r--keystore/keystore.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/keystore/key_store_service.cpp b/keystore/key_store_service.cpp
index 310d8e2d..c8842c5e 100644
--- a/keystore/key_store_service.cpp
+++ b/keystore/key_store_service.cpp
@@ -526,7 +526,7 @@ String16 KeyStoreService::grant(const String16& name, int32_t granteeUid) {
return String16();
}
- return String16(mKeyStore->addGrant(String8(name).string(), granteeUid, callingUid).c_str());
+ return String16(mKeyStore->addGrant(String8(name).string(), callingUid, granteeUid).c_str());
}
KeyStoreServiceReturnCode KeyStoreService::ungrant(const String16& name, int32_t granteeUid) {
diff --git a/keystore/keystore.cpp b/keystore/keystore.cpp
index 5451ace3..18ecb4a4 100644
--- a/keystore/keystore.cpp
+++ b/keystore/keystore.cpp
@@ -522,7 +522,7 @@ ResponseCode KeyStore::getKeyForName(Blob* keyBlob, const android::String8& keyN
// They might be using a granted key.
auto grant = mGrants.get(uid, keyName.string());
if (!grant) return ResponseCode::KEY_NOT_FOUND;
- filepath8.format("%s/%s", grant->owner_dir_name_.c_str(),
+ filepath8 = String8::format("%s/%s", grant->owner_dir_name_.c_str(),
getKeyNameForUid(String8(grant->alias_.c_str()), grant->owner_uid_, type).c_str());
// It is a granted key. Try to load it.