From 792ec7bf1beb96a0ed2c6b746ae41fb69d1f6fc6 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Mon, 7 Mar 2022 16:29:53 -0500 Subject: [PATCH] fix_ToT (#15931) --- .../operational-credentials-server.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index dc3a9850e96f51..3d6e4156410ac9 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -531,6 +531,9 @@ bool emberAfOperationalCredentialsClusterAddNOCCallback(app::CommandHandler * co FabricIndex fabricIndex = 0; Credentials::GroupDataProvider::KeySet keyset; + uint8_t compressed_fabric_id_buffer[sizeof(uint64_t)]; + MutableByteSpan compressed_fabric_id(compressed_fabric_id_buffer); + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: commissioner has added a NOC"); if (nullptr == groups) @@ -582,7 +585,8 @@ bool emberAfOperationalCredentialsClusterAddNOCCallback(app::CommandHandler * co keyset.policy = GroupKeyManagement::GroupKeySecurityPolicy::kTrustFirst; keyset.num_keys_used = 1; memcpy(keyset.epoch_keys[0].key, ipkValue.data(), Crypto::CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES); - err = groups->SetKeySet(fabricIndex, keyset); + err = gFabricBeingCommissioned.GetCompressedId(compressed_fabric_id); + err = groups->SetKeySet(fabricIndex, compressed_fabric_id, keyset); VerifyOrExit(err == CHIP_NO_ERROR, nocResponse = ConvertToNOCResponseStatus(err)); // We might have a new operational identity, so we should start advertising it right away.