Skip to content

Commit

Permalink
Fix uninitialised values in KeySet and AttributePathExpandIterator (#…
Browse files Browse the repository at this point in the history
…28356)

* Fix uninitialised value in KeySet

* Fix uninitilised mGlobalAttributeEndIndex

* Restyled by clang-format

* Review proposed change initilize mGlobalAttributeEndIndex

* Change initialize values in KeySet to initilize only start_time in EpochKey

* Restyled by clang-format

* Review proposed change initilize IPK keyset start_time

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
DamMicSzm and restyled-commits authored Aug 3, 2023
1 parent c3c4795 commit 7df6d0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/app/AttributePathExpandIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ void AttributePathExpandIterator::PrepareAttributeIndexRange(const AttributePath
}
mGlobalAttributeEndIndex = static_cast<uint8_t>(mGlobalAttributeIndex + 1);
}
else
{
mGlobalAttributeIndex = UINT8_MAX;
mGlobalAttributeEndIndex = 0;
}
}
}

Expand Down
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

0 comments on commit 7df6d0a

Please sign in to comment.