Skip to content

Commit

Permalink
Merge pull request #5 from bzbarsky-apple/testing
Browse files Browse the repository at this point in the history
Fix darwin tests
  • Loading branch information
tcarmelveilleux authored Jun 8, 2022
2 parents f89a544 + bb698d3 commit d145381
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,18 @@ CHIP_ERROR DeviceController::InitControllerNOCChain(const ControllerInitParams &
Credentials::P256PublicKeySpan rootPublicKey;
FabricId fabricId;

// There are three possibilities here in terms of what happens with our
// operational key:
// 1) We have an externally owned operational keypair.
// 2) We have an operational keypair that the fabric table should clone via
// serialize/deserialize.
// 3) We have no keypair at all, and the fabric table has been initialized
// with a key store.
if (params.hasExternallyOwnedOperationalKeypair)
{
ReturnErrorOnFailure(newFabric.SetExternallyOwnedOperationalKeypair(params.operationalKeypair));
}
else
else if (params.operationalKeypair)
{
ReturnErrorOnFailure(newFabric.SetOperationalKeypair(params.operationalKeypair));
}
Expand Down
4 changes: 1 addition & 3 deletions src/credentials/FabricTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,7 @@ class DLL_EXPORT FabricTable

// Currently only operational key is managed by this API.
/**
* @brief
*
* If nothing is pending to commit, returns CHIP_NO_ERROR right away.
* @brief If nothing is pending to commit, returns CHIP_NO_ERROR right away.
*
* @return CHIP_ERROR
*/
Expand Down
1 change: 1 addition & 0 deletions src/darwin/Framework/CHIP/MatterControllerFactory.mm
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ - (BOOL)startup:(MatterControllerFactoryParams *)startupParams

params.groupDataProvider = _groupDataProvider;
params.fabricIndependentStorage = _persistentStorageDelegateBridge;
params.operationalKeystore = _keystore;
errorCode = _controllerFactory->Init(params);
if (errorCode != CHIP_NO_ERROR) {
CHIP_LOG_ERROR("Error: %@", kErrorControllerFactoryInit);
Expand Down

0 comments on commit d145381

Please sign in to comment.