Commit 23b4aba3 authored by Ryan Hansberry's avatar Ryan Hansberry Committed by Commit Bot

[SmartLock] Always pass empty key label to cryptohome AddKey().

This code was written with the assumption that the key label of the
AuthorizationRequest sent to cryptohome while creating easy unlock keys
be empty, in order to act as a wild card. This CL always passes an empty
an empty key label to that AuthorizationRequest, instead of using the
copied label of the |user_context_|.

Bug: 1002336
Change-Id: Icfccf46ed479a1e7a29e8d09837e1223d62a4caa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1797205Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695779}
parent 386d50f2
...@@ -349,9 +349,12 @@ void EasyUnlockCreateKeysOperation::OnGetSystemSalt( ...@@ -349,9 +349,12 @@ void EasyUnlockCreateKeysOperation::OnGetSystemSalt(
cryptohome::AddKeyRequest request; cryptohome::AddKeyRequest request;
cryptohome::KeyDefinitionToKey(key_def, request.mutable_key()); cryptohome::KeyDefinitionToKey(key_def, request.mutable_key());
request.set_clobber_if_exists(true); request.set_clobber_if_exists(true);
// Create the authorization request with an empty label, in order to act as a
// wildcard. See https://crbug.com/1002336 for more.
cryptohome::HomedirMethods::GetInstance()->AddKeyEx( cryptohome::HomedirMethods::GetInstance()->AddKeyEx(
cryptohome::Identification(user_context_.GetAccountId()), cryptohome::Identification(user_context_.GetAccountId()),
cryptohome::CreateAuthorizationRequest(auth_key->GetLabel(), cryptohome::CreateAuthorizationRequest(std::string() /* label */,
auth_key->GetSecret()), auth_key->GetSecret()),
request, request,
base::Bind(&EasyUnlockCreateKeysOperation::OnKeyCreated, base::Bind(&EasyUnlockCreateKeysOperation::OnKeyCreated,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment