Skip to content

Commit

Permalink
Review proposed change initilize IPK keyset start_time
Browse files Browse the repository at this point in the history
  • Loading branch information
DamMicSzm committed Aug 1, 2023
1 parent cf7e1e4 commit 6443b29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,10 @@ bool emberAfOperationalCredentialsClusterAddNOCCallback(app::CommandHandler * co

// Set the Identity Protection Key (IPK)
// The IPK SHALL be the operational group key under GroupKeySetID of 0
keyset.keyset_id = Credentials::GroupDataProvider::kIdentityProtectionKeySetId;
keyset.policy = GroupKeyManagement::GroupKeySecurityPolicyEnum::kTrustFirst;
keyset.num_keys_used = 1;
keyset.keyset_id = Credentials::GroupDataProvider::kIdentityProtectionKeySetId;
keyset.policy = GroupKeyManagement::GroupKeySecurityPolicyEnum::kTrustFirst;
keyset.num_keys_used = 1;
keyset.epoch_keys[0].start_time = 0;
memcpy(keyset.epoch_keys[0].key, ipkValue.data(), Crypto::CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES);

err = newFabricInfo->GetCompressedFabricIdBytes(compressed_fabric_id);
Expand Down
4 changes: 2 additions & 2 deletions src/credentials/GroupDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class GroupDataProvider
{
static constexpr size_t kLengthBytes = Crypto::CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES;
// Validity start time in microseconds since 2000-01-01T00:00:00 UTC ("the Epoch")
uint64_t start_time = 0;
uint64_t start_time;
// Actual key bits. Depending on context, it may be a raw epoch key (as seen within `SetKeySet` calls)
// or it may be the derived operational group key (as seen in any other usage).
uint8_t key[kLengthBytes];
Expand Down Expand Up @@ -202,7 +202,7 @@ class GroupDataProvider
virtual ~GroupDataProvider() = default;

// Not copyable
GroupDataProvider(const GroupDataProvider &) = delete;
GroupDataProvider(const GroupDataProvider &) = delete;
GroupDataProvider & operator=(const GroupDataProvider &) = delete;

uint16_t GetMaxGroupsPerFabric() const { return mMaxGroupsPerFabric; }
Expand Down

0 comments on commit 6443b29

Please sign in to comment.