forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow Darwin framework consumers to provide a controller NOC and keyp…
…air. Specific changes: * Rename initWithKeypair API to initWithSigningKeypair, since we can now also init with an operational keypair. * Fix FabricInfo::SetOperationalKeypair to correcty handle the mHasExternallyOwnedOperationalKey case. The old code would try to deserialize into the externally owned keypair. * Fix FabricInfo::GetOperationalKey to just return the key even it it's null, instead of allocating a random key that does not match anything. I have checked that consumers all either null-check the call or have just called SetOperationalKeypair or SetExternallyOwnedOperationalKeypair. SetFabricInfo is updated to error out if the incoming fabric info has a null operational key. This change was needed for basic API sanity in terms of not accidentally switching a fabric from an externally managed operational key to an internally managed randomly generated one. * Fix backwards boolean check in FabricInfo::Reset that was causing us to leak internally managed keys and try to delete externally managed ones. * Change Darwin CHIPDeviceControllerStartupParams to allow providing an operational keypair to be used for the NOC. * Change Darwin CHIPDeviceControllerStartupParams To allow providing a NOC instead of having one generated inside the framework. * Refactor the code for initializing CHIPDeviceControllerStartupParamsInternal to better share code and support the new functionality. * Allow initializing CHIPOperationalCredentialsDelegate without a NOC-signing keypair. This is needed because the SDK's controller init requires a credentials delegate. When initialized in this way, the delegate will just return error when asked to create a NOC. * Added tests for the new API (which caught a number of the issues listed above). Fixes project-chip#18444
- Loading branch information
1 parent
d79a0e3
commit bb2e6ef
Showing
14 changed files
with
878 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.