Merge "Fix unaligned access to auth token user_id" am: 21a17b091e am: 01759662fd am: 7b9b164946

Change-Id: Ibe10561445571d7607ea93d7a988a9ab847e234a
This commit is contained in:
Automerger Merge Worker 2020-02-19 22:20:32 +00:00
commit 970ea1cf68

View file

@ -122,7 +122,8 @@ static bool generateKeymasterKey(Keymaster& keymaster, const KeyAuthentication&
return false;
}
const hw_auth_token_t* at = reinterpret_cast<const hw_auth_token_t*>(auth.token.data());
paramBuilder.Authorization(km::TAG_USER_SECURE_ID, at->user_id);
auto user_id = at->user_id; // Make a copy because at->user_id is unaligned.
paramBuilder.Authorization(km::TAG_USER_SECURE_ID, user_id);
paramBuilder.Authorization(km::TAG_USER_AUTH_TYPE, km::HardwareAuthenticatorType::PASSWORD);
paramBuilder.Authorization(km::TAG_AUTH_TIMEOUT, AUTH_TIMEOUT);
}