diff options
author | Robin Lee <rgl@google.com> | 2014-08-12 17:31:40 +0100 |
---|---|---|
committer | Robin Lee <rgl@google.com> | 2014-08-12 17:31:40 +0100 |
commit | 50122db50bcb6c1aab50ef235c8f9d264b50e97a (patch) | |
tree | bf74876166fd7d65d21bfb53fda8a7cf372b010d | |
parent | a62474699a202588609d7051e677f23734151900 (diff) | |
download | security-50122db50bcb6c1aab50ef235c8f9d264b50e97a.tar.gz |
Correct double-convert from uid to userid
This was making readMasterKey and writeMasterKey always operate on
user 0, because of a double-division - getUserState(*) already
takes into account that the argument is a uid.
Fixes a number of issues related to multi-user and keystore; works
toward fixing bug 16233206.
Change-Id: Ia1434fd0d076b0c36d383ff7390b17c78d7811b5
-rw-r--r-- | keystore/keystore.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/keystore/keystore.cpp b/keystore/keystore.cpp index 4335f8a0..bda69488 100644 --- a/keystore/keystore.cpp +++ b/keystore/keystore.cpp @@ -970,14 +970,12 @@ public: } ResponseCode writeMasterKey(const android::String8& pw, uid_t uid) { - uid_t user_id = get_user_id(uid); - UserState* userState = getUserState(user_id); + UserState* userState = getUserState(uid); return userState->writeMasterKey(pw, mEntropy); } ResponseCode readMasterKey(const android::String8& pw, uid_t uid) { - uid_t user_id = get_user_id(uid); - UserState* userState = getUserState(user_id); + UserState* userState = getUserState(uid); return userState->readMasterKey(pw, mEntropy); } |