Update SharedCredential definition

PiperOrigin-RevId: 507568902
This commit is contained in:
Janusz Sobczak
2023-02-06 13:33:23 -08:00
committed by Copybara-Service
parent d1d7cfad56
commit 5f4144cd0b
33 changed files with 398 additions and 402 deletions
@@ -218,9 +218,8 @@ absl::StatusOr<std::string> AdvertisementDecoder::DecryptLdt(
return absl::UnavailableError("No credentials");
}
for (const auto& credential : credentials) {
absl::StatusOr<LdtEncryptor> encryptor =
LdtEncryptor::Create(credential.authenticity_key(),
credential.metadata_encryption_key_tag());
absl::StatusOr<LdtEncryptor> encryptor = LdtEncryptor::Create(
credential.key_seed(), credential.metadata_encryption_key_tag());
if (encryptor.ok()) {
absl::StatusOr<std::string> result =
encryptor->DecryptAndVerify(data_elements, salt);
@@ -424,9 +423,10 @@ bool AdvertisementDecoder::MatchesScanFilter(
std::vector<CredentialSelector> AdvertisementDecoder::GetCredentialSelectors(
const ScanRequest& scan_request) {
std::vector<internal::IdentityType> all_types = {
internal::IDENTITY_TYPE_PRIVATE, internal::IDENTITY_TYPE_TRUSTED,
internal::IDENTITY_TYPE_PROVISIONED, internal::IDENTITY_TYPE_PUBLIC};
std::vector<IdentityType> all_types = {
IdentityType::IDENTITY_TYPE_PRIVATE, IdentityType::IDENTITY_TYPE_TRUSTED,
IdentityType::IDENTITY_TYPE_PUBLIC,
IdentityType::IDENTITY_TYPE_PROVISIONED};
std::vector<CredentialSelector> selectors(all_types.size());
for (auto identity_type :
(scan_request.identity_types.empty() ? all_types