Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17aa7571 authored by Andres Morales's avatar Andres Morales
Browse files

[gatekeeperd] fix other unaligned mem access

Initially tested with the wrong (mnc) toolchain
which just hid the error entirely. Now tested with
master toolchain so this should be the last instance.

Bug: 22367550
Change-Id: I0e785918b1a9f4a8af80dc96b794737fcfd12367
parent 6cd33beb
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -152,15 +152,15 @@ public:
    }

    bool DoVerify(const password_handle_t *expected_handle, const SizedBuffer &password) {
        FastHashMap::const_iterator it = fast_hash_map_.find(
                android::base::get_unaligned(&expected_handle->user_id));
        uint64_t user_id = android::base::get_unaligned(&expected_handle->user_id);
        FastHashMap::const_iterator it = fast_hash_map_.find(user_id);
        if (it != fast_hash_map_.end() && VerifyFast(it->second, password)) {
            return true;
        } else {
            if (GateKeeper::DoVerify(expected_handle, password)) {
                uint64_t salt;
                GetRandom(&salt, sizeof(salt));
                fast_hash_map_[expected_handle->user_id] = ComputeFastHash(password, salt);
                fast_hash_map_[user_id] = ComputeFastHash(password, salt);
                return true;
            }
        }