Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: chrome/browser/signin/easy_unlock_service_regular.cc

Issue 2863533003: [EasyUnlock] Serialize and store BeaconSeeds along as cryptohome key metadata. (Closed)
Patch Set: comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/signin/easy_unlock_service_regular.cc
diff --git a/chrome/browser/signin/easy_unlock_service_regular.cc b/chrome/browser/signin/easy_unlock_service_regular.cc
index 38598e88950e1f0f9e5c21d5efa6065956276891..5446c93304f54cc351a979fef627dbc4fa1313e7 100644
--- a/chrome/browser/signin/easy_unlock_service_regular.cc
+++ b/chrome/browser/signin/easy_unlock_service_regular.cc
@@ -11,6 +11,7 @@
#include "base/base64url.h"
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/json/json_string_value_serializer.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/sys_info.h"
@@ -135,6 +136,23 @@ void EasyUnlockServiceRegular::OnRemoteDevicesLoaded(
dict->SetString("permitRecord.id", b64_public_key);
dict->SetString("permitRecord.type", "license");
dict->SetString("permitRecord.data", b64_public_key);
+
+ // TODO(tengs): Retrieve the actual BeaconSeeds from the RemoteDevice.
+ std::vector<cryptauth::BeaconSeed> beacon_seeds;
+ std::unique_ptr<base::ListValue> beacon_seed_list(new base::ListValue());
+ for (const auto& beacon_seed : beacon_seeds) {
+ std::string b64_beacon_seed;
+ base::Base64UrlEncode(beacon_seed.SerializeAsString(),
+ base::Base64UrlEncodePolicy::INCLUDE_PADDING,
+ &b64_beacon_seed);
+ beacon_seed_list->AppendString(b64_beacon_seed);
+ }
+
+ std::string serialized_beacon_seeds;
+ JSONStringValueSerializer serializer(&serialized_beacon_seeds);
+ serializer.Serialize(*beacon_seed_list);
+ dict->SetString("serializedBeaconSeeds", serialized_beacon_seeds);
+
device_list->Append(std::move(dict));
}
@@ -255,6 +273,11 @@ const base::ListValue* EasyUnlockServiceRegular::GetRemoteDevices() const {
void EasyUnlockServiceRegular::SetRemoteDevices(
const base::ListValue& devices) {
+ std::string remote_devices_json;
+ JSONStringValueSerializer serializer(&remote_devices_json);
+ serializer.Serialize(devices);
+ PA_LOG(INFO) << "Setting RemoteDevices:\n " << remote_devices_json;
+
DictionaryPrefUpdate pairing_update(profile()->GetPrefs(),
prefs::kEasyUnlockPairing);
if (devices.empty())
« no previous file with comments | « chrome/browser/signin/chrome_proximity_auth_client.cc ('k') | chrome/browser/signin/easy_unlock_service_signin_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698