mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Add initial pairing in scalable seeker
PiperOrigin-RevId: 541034178
This commit is contained in:
committed by
Copybara-Service
parent
4914cbc2f9
commit
20acd4eeb9
@@ -46,11 +46,17 @@ void FakeFastPairRepository::GetDeviceMetadata(
|
||||
|
||||
std::unique_ptr<FakeFastPairRepository> FakeFastPairRepository::Create(
|
||||
absl::string_view model_id, absl::string_view public_anti_spoof_key) {
|
||||
std::string decoded_key;
|
||||
absl::Base64Unescape(public_anti_spoof_key, &decoded_key);
|
||||
proto::Device metadata;
|
||||
auto repository = std::make_unique<FakeFastPairRepository>();
|
||||
metadata.mutable_anti_spoofing_key_pair()->set_public_key(decoded_key);
|
||||
if (public_anti_spoof_key.length() == kPublicKeyByteSize) {
|
||||
metadata.mutable_anti_spoofing_key_pair()->set_public_key(
|
||||
public_anti_spoof_key);
|
||||
} else {
|
||||
std::string decoded_key;
|
||||
absl::Base64Unescape(public_anti_spoof_key, &decoded_key);
|
||||
CHECK_EQ(decoded_key.length(), kPublicKeyByteSize);
|
||||
metadata.mutable_anti_spoofing_key_pair()->set_public_key(decoded_key);
|
||||
}
|
||||
repository->SetFakeMetadata(model_id, metadata);
|
||||
return repository;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user