@matter/protocol 0.16.0-alpha.0-20251217-038f88085 → 0.16.0-alpha.0-20251221-21acf226d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/action/client/ClientBdx.d.ts +17 -0
- package/dist/cjs/action/client/ClientBdx.d.ts.map +1 -0
- package/dist/cjs/action/client/ClientBdx.js +22 -0
- package/dist/cjs/action/client/ClientBdx.js.map +6 -0
- package/dist/cjs/action/client/ClientInteraction.d.ts +10 -1
- package/dist/cjs/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/cjs/action/client/ClientInteraction.js +25 -2
- package/dist/cjs/action/client/ClientInteraction.js.map +1 -1
- package/dist/cjs/action/client/QueuedClientInteraction.d.ts +11 -3
- package/dist/cjs/action/client/QueuedClientInteraction.d.ts.map +1 -1
- package/dist/cjs/action/client/QueuedClientInteraction.js +6 -2
- package/dist/cjs/action/client/QueuedClientInteraction.js.map +1 -1
- package/dist/cjs/action/client/index.d.ts +1 -0
- package/dist/cjs/action/client/index.d.ts.map +1 -1
- package/dist/cjs/action/client/index.js +1 -0
- package/dist/cjs/action/client/index.js.map +1 -1
- package/dist/cjs/action/request/Read.d.ts.map +1 -1
- package/dist/cjs/action/request/Read.js +2 -2
- package/dist/cjs/action/request/Read.js.map +1 -1
- package/dist/cjs/action/request/Write.js +4 -3
- package/dist/cjs/action/request/Write.js.map +1 -1
- package/dist/cjs/advertisement/ble/BleAdvertisement.d.ts +1 -1
- package/dist/cjs/advertisement/ble/BleAdvertisement.d.ts.map +1 -1
- package/dist/cjs/advertisement/ble/BleAdvertisement.js +2 -2
- package/dist/cjs/advertisement/ble/BleAdvertisement.js.map +1 -1
- package/dist/cjs/advertisement/mdns/CommissionableMdnsAdvertisement.d.ts +1 -1
- package/dist/cjs/advertisement/mdns/CommissionableMdnsAdvertisement.js +1 -1
- package/dist/cjs/advertisement/mdns/CommissionableMdnsAdvertisement.js.map +1 -1
- package/dist/cjs/advertisement/mdns/OperationalMdnsAdvertisement.d.ts.map +1 -1
- package/dist/cjs/advertisement/mdns/OperationalMdnsAdvertisement.js +3 -5
- package/dist/cjs/advertisement/mdns/OperationalMdnsAdvertisement.js.map +1 -1
- package/dist/cjs/bdx/BdxClient.d.ts +2 -0
- package/dist/cjs/bdx/BdxClient.d.ts.map +1 -1
- package/dist/cjs/bdx/BdxClient.js +6 -0
- package/dist/cjs/bdx/BdxClient.js.map +1 -1
- package/dist/cjs/bdx/BdxError.d.ts +2 -0
- package/dist/cjs/bdx/BdxError.d.ts.map +1 -1
- package/dist/cjs/bdx/BdxError.js +2 -0
- package/dist/cjs/bdx/BdxError.js.map +1 -1
- package/dist/cjs/bdx/BdxMessenger.d.ts +5 -1
- package/dist/cjs/bdx/BdxMessenger.d.ts.map +1 -1
- package/dist/cjs/bdx/BdxMessenger.js +12 -4
- package/dist/cjs/bdx/BdxMessenger.js.map +1 -1
- package/dist/cjs/bdx/BdxProtocol.d.ts +14 -7
- package/dist/cjs/bdx/BdxProtocol.d.ts.map +1 -1
- package/dist/cjs/bdx/BdxProtocol.js +81 -19
- package/dist/cjs/bdx/BdxProtocol.js.map +1 -1
- package/dist/cjs/bdx/BdxSession.d.ts +10 -3
- package/dist/cjs/bdx/BdxSession.d.ts.map +1 -1
- package/dist/cjs/bdx/BdxSession.js +33 -8
- package/dist/cjs/bdx/BdxSession.js.map +1 -1
- package/dist/cjs/bdx/BdxSessionConfiguration.d.ts +16 -1
- package/dist/cjs/bdx/BdxSessionConfiguration.d.ts.map +1 -1
- package/dist/cjs/bdx/BdxSessionConfiguration.js +6 -1
- package/dist/cjs/bdx/BdxSessionConfiguration.js.map +1 -1
- package/dist/cjs/bdx/FileDesignator.d.ts +15 -1
- package/dist/cjs/bdx/FileDesignator.d.ts.map +1 -1
- package/dist/cjs/bdx/FileDesignator.js +28 -2
- package/dist/cjs/bdx/FileDesignator.js.map +1 -1
- package/dist/cjs/bdx/PersistedFileDesignator.d.ts +10 -2
- package/dist/cjs/bdx/PersistedFileDesignator.d.ts.map +1 -1
- package/dist/cjs/bdx/PersistedFileDesignator.js +23 -5
- package/dist/cjs/bdx/PersistedFileDesignator.js.map +1 -1
- package/dist/cjs/bdx/ScopedStorage.d.ts +18 -0
- package/dist/cjs/bdx/ScopedStorage.d.ts.map +1 -0
- package/dist/cjs/bdx/ScopedStorage.js +36 -0
- package/dist/cjs/bdx/ScopedStorage.js.map +6 -0
- package/dist/cjs/bdx/bdx-session-initiator.d.ts.map +1 -1
- package/dist/cjs/bdx/bdx-session-initiator.js +10 -2
- package/dist/cjs/bdx/bdx-session-initiator.js.map +1 -1
- package/dist/cjs/bdx/flow/DrivenSendingFlow.d.ts.map +1 -1
- package/dist/cjs/bdx/flow/DrivenSendingFlow.js +2 -0
- package/dist/cjs/bdx/flow/DrivenSendingFlow.js.map +1 -1
- package/dist/cjs/bdx/flow/DrivingReceivingFlow.d.ts.map +1 -1
- package/dist/cjs/bdx/flow/DrivingReceivingFlow.js +1 -0
- package/dist/cjs/bdx/flow/DrivingReceivingFlow.js.map +1 -1
- package/dist/cjs/bdx/flow/Flow.d.ts +7 -0
- package/dist/cjs/bdx/flow/Flow.d.ts.map +1 -1
- package/dist/cjs/bdx/flow/Flow.js +22 -1
- package/dist/cjs/bdx/flow/Flow.js.map +1 -1
- package/dist/cjs/bdx/flow/FollowingReceivingFlow.d.ts.map +1 -1
- package/dist/cjs/bdx/flow/FollowingReceivingFlow.js +3 -0
- package/dist/cjs/bdx/flow/FollowingReceivingFlow.js.map +1 -1
- package/dist/cjs/bdx/flow/FollowingSendingFlow.d.ts.map +1 -1
- package/dist/cjs/bdx/flow/FollowingSendingFlow.js +1 -0
- package/dist/cjs/bdx/flow/FollowingSendingFlow.js.map +1 -1
- package/dist/cjs/bdx/flow/OutboundFlow.d.ts.map +1 -1
- package/dist/cjs/bdx/flow/OutboundFlow.js +1 -0
- package/dist/cjs/bdx/flow/OutboundFlow.js.map +1 -1
- package/dist/cjs/bdx/index.d.ts +1 -0
- package/dist/cjs/bdx/index.d.ts.map +1 -1
- package/dist/cjs/bdx/index.js +1 -0
- package/dist/cjs/bdx/index.js.map +1 -1
- package/dist/cjs/certificate/kinds/Icac.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/Icac.js +1 -7
- package/dist/cjs/certificate/kinds/Icac.js.map +1 -1
- package/dist/cjs/certificate/kinds/Rcac.d.ts +1 -0
- package/dist/cjs/certificate/kinds/Rcac.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/Rcac.js +3 -0
- package/dist/cjs/certificate/kinds/Rcac.js.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/operational.d.ts +1 -1
- package/dist/cjs/certificate/kinds/definitions/operational.js +1 -1
- package/dist/cjs/certificate/kinds/definitions/operational.js.map +1 -1
- package/dist/cjs/common/FailsafeContext.js +2 -2
- package/dist/cjs/common/FailsafeContext.js.map +1 -1
- package/dist/cjs/dcl/DclClient.d.ts.map +1 -1
- package/dist/cjs/dcl/DclClient.js +1 -2
- package/dist/cjs/dcl/DclClient.js.map +1 -1
- package/dist/cjs/dcl/DclOtaUpdateService.d.ts +30 -31
- package/dist/cjs/dcl/DclOtaUpdateService.d.ts.map +1 -1
- package/dist/cjs/dcl/DclOtaUpdateService.js +191 -92
- package/dist/cjs/dcl/DclOtaUpdateService.js.map +2 -2
- package/dist/cjs/dcl/index.d.ts +0 -3
- package/dist/cjs/dcl/index.d.ts.map +1 -1
- package/dist/cjs/dcl/index.js +0 -3
- package/dist/cjs/dcl/index.js.map +1 -1
- package/dist/cjs/fabric/Fabric.d.ts +53 -9
- package/dist/cjs/fabric/Fabric.d.ts.map +1 -1
- package/dist/cjs/fabric/Fabric.js +59 -32
- package/dist/cjs/fabric/Fabric.js.map +1 -1
- package/dist/cjs/fabric/FabricAuthority.js +1 -1
- package/dist/cjs/fabric/FabricAuthority.js.map +1 -1
- package/dist/cjs/fabric/FabricManager.d.ts +14 -5
- package/dist/cjs/fabric/FabricManager.d.ts.map +1 -1
- package/dist/cjs/fabric/FabricManager.js +63 -42
- package/dist/cjs/fabric/FabricManager.js.map +1 -1
- package/dist/cjs/groups/FabricGroups.d.ts.map +1 -1
- package/dist/cjs/groups/FabricGroups.js +4 -8
- package/dist/cjs/groups/FabricGroups.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interaction/InteractionMessenger.d.ts +1 -106
- package/dist/cjs/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/cjs/interaction/InteractionMessenger.js +2 -143
- package/dist/cjs/interaction/InteractionMessenger.js.map +2 -2
- package/dist/cjs/interaction/index.d.ts +0 -1
- package/dist/cjs/interaction/index.d.ts.map +1 -1
- package/dist/cjs/interaction/index.js +0 -1
- package/dist/cjs/interaction/index.js.map +1 -1
- package/dist/cjs/mdns/MdnsClient.d.ts +4 -4
- package/dist/cjs/mdns/MdnsClient.d.ts.map +1 -1
- package/dist/cjs/mdns/MdnsClient.js +12 -15
- package/dist/cjs/mdns/MdnsClient.js.map +1 -1
- package/dist/cjs/mdns/MdnsConsts.d.ts +3 -3
- package/dist/cjs/mdns/MdnsConsts.d.ts.map +1 -1
- package/dist/cjs/mdns/MdnsConsts.js +3 -2
- package/dist/cjs/mdns/MdnsConsts.js.map +1 -1
- package/dist/{esm/dcl → cjs/ota}/OtaImageHeader.d.ts.map +1 -1
- package/dist/cjs/{dcl → ota}/OtaImageHeader.js.map +1 -1
- package/dist/cjs/{dcl → ota}/OtaImageReader.d.ts.map +1 -1
- package/dist/cjs/{dcl → ota}/OtaImageReader.js +0 -2
- package/dist/cjs/ota/OtaImageReader.js.map +6 -0
- package/dist/{esm/dcl → cjs/ota}/OtaImageWriter.d.ts +1 -1
- package/dist/cjs/{dcl → ota}/OtaImageWriter.d.ts.map +1 -1
- package/dist/cjs/{dcl → ota}/OtaImageWriter.js.map +1 -1
- package/dist/cjs/ota/index.d.ts +9 -0
- package/dist/cjs/ota/index.d.ts.map +1 -0
- package/dist/cjs/ota/index.js +26 -0
- package/dist/cjs/ota/index.js.map +6 -0
- package/dist/cjs/peer/ControllerCommissioner.d.ts.map +1 -1
- package/dist/cjs/peer/ControllerCommissioner.js +5 -0
- package/dist/cjs/peer/ControllerCommissioner.js.map +1 -1
- package/dist/cjs/peer/ControllerCommissioningFlow.d.ts +11 -3
- package/dist/cjs/peer/ControllerCommissioningFlow.d.ts.map +1 -1
- package/dist/cjs/peer/ControllerCommissioningFlow.js +119 -40
- package/dist/cjs/peer/ControllerCommissioningFlow.js.map +1 -1
- package/dist/cjs/peer/PeerSet.d.ts.map +1 -1
- package/dist/cjs/peer/PeerSet.js +17 -10
- package/dist/cjs/peer/PeerSet.js.map +1 -1
- package/dist/cjs/protocol/DeviceAdvertiser.js +3 -3
- package/dist/cjs/protocol/DeviceAdvertiser.js.map +1 -1
- package/dist/cjs/protocol/ExchangeProvider.d.ts +2 -2
- package/dist/cjs/protocol/ExchangeProvider.d.ts.map +1 -1
- package/dist/cjs/protocol/ExchangeProvider.js +2 -2
- package/dist/cjs/protocol/ExchangeProvider.js.map +1 -1
- package/dist/cjs/protocol/MessageExchange.js +3 -3
- package/dist/cjs/protocol/MessageExchange.js.map +1 -1
- package/dist/cjs/protocol/ProtocolMocks.d.ts +2 -2
- package/dist/cjs/protocol/ProtocolMocks.d.ts.map +1 -1
- package/dist/cjs/protocol/ProtocolMocks.js +1 -1
- package/dist/cjs/protocol/ProtocolMocks.js.map +1 -1
- package/dist/cjs/session/NodeSession.d.ts.map +1 -1
- package/dist/cjs/session/NodeSession.js +2 -2
- package/dist/cjs/session/NodeSession.js.map +1 -1
- package/dist/cjs/session/Session.d.ts.map +1 -1
- package/dist/cjs/session/Session.js +1 -0
- package/dist/cjs/session/Session.js.map +1 -1
- package/dist/cjs/session/SessionManager.js +2 -2
- package/dist/cjs/session/SessionManager.js.map +1 -1
- package/dist/cjs/session/SessionParameters.d.ts.map +1 -1
- package/dist/cjs/session/SessionParameters.js +7 -1
- package/dist/cjs/session/SessionParameters.js.map +1 -1
- package/dist/cjs/session/pase/PaseServer.d.ts.map +1 -1
- package/dist/cjs/session/pase/PaseServer.js +1 -0
- package/dist/cjs/session/pase/PaseServer.js.map +1 -1
- package/dist/esm/action/client/ClientBdx.d.ts +17 -0
- package/dist/esm/action/client/ClientBdx.d.ts.map +1 -0
- package/dist/esm/action/client/ClientBdx.js +6 -0
- package/dist/esm/action/client/ClientBdx.js.map +6 -0
- package/dist/esm/action/client/ClientInteraction.d.ts +10 -1
- package/dist/esm/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/esm/action/client/ClientInteraction.js +24 -1
- package/dist/esm/action/client/ClientInteraction.js.map +1 -1
- package/dist/esm/action/client/QueuedClientInteraction.d.ts +11 -3
- package/dist/esm/action/client/QueuedClientInteraction.d.ts.map +1 -1
- package/dist/esm/action/client/QueuedClientInteraction.js +5 -1
- package/dist/esm/action/client/QueuedClientInteraction.js.map +1 -1
- package/dist/esm/action/client/index.d.ts +1 -0
- package/dist/esm/action/client/index.d.ts.map +1 -1
- package/dist/esm/action/client/index.js +1 -0
- package/dist/esm/action/client/index.js.map +1 -1
- package/dist/esm/action/request/Read.d.ts.map +1 -1
- package/dist/esm/action/request/Read.js +2 -2
- package/dist/esm/action/request/Read.js.map +1 -1
- package/dist/esm/action/request/Write.js +4 -3
- package/dist/esm/action/request/Write.js.map +1 -1
- package/dist/esm/advertisement/ble/BleAdvertisement.d.ts +1 -1
- package/dist/esm/advertisement/ble/BleAdvertisement.d.ts.map +1 -1
- package/dist/esm/advertisement/ble/BleAdvertisement.js +2 -2
- package/dist/esm/advertisement/ble/BleAdvertisement.js.map +1 -1
- package/dist/esm/advertisement/mdns/CommissionableMdnsAdvertisement.d.ts +1 -1
- package/dist/esm/advertisement/mdns/CommissionableMdnsAdvertisement.js +1 -1
- package/dist/esm/advertisement/mdns/CommissionableMdnsAdvertisement.js.map +1 -1
- package/dist/esm/advertisement/mdns/OperationalMdnsAdvertisement.d.ts.map +1 -1
- package/dist/esm/advertisement/mdns/OperationalMdnsAdvertisement.js +4 -6
- package/dist/esm/advertisement/mdns/OperationalMdnsAdvertisement.js.map +1 -1
- package/dist/esm/bdx/BdxClient.d.ts +2 -0
- package/dist/esm/bdx/BdxClient.d.ts.map +1 -1
- package/dist/esm/bdx/BdxClient.js +6 -0
- package/dist/esm/bdx/BdxClient.js.map +1 -1
- package/dist/esm/bdx/BdxError.d.ts +2 -0
- package/dist/esm/bdx/BdxError.d.ts.map +1 -1
- package/dist/esm/bdx/BdxError.js +2 -0
- package/dist/esm/bdx/BdxError.js.map +1 -1
- package/dist/esm/bdx/BdxMessenger.d.ts +5 -1
- package/dist/esm/bdx/BdxMessenger.d.ts.map +1 -1
- package/dist/esm/bdx/BdxMessenger.js +14 -5
- package/dist/esm/bdx/BdxMessenger.js.map +1 -1
- package/dist/esm/bdx/BdxProtocol.d.ts +14 -7
- package/dist/esm/bdx/BdxProtocol.d.ts.map +1 -1
- package/dist/esm/bdx/BdxProtocol.js +82 -20
- package/dist/esm/bdx/BdxProtocol.js.map +1 -1
- package/dist/esm/bdx/BdxSession.d.ts +10 -3
- package/dist/esm/bdx/BdxSession.d.ts.map +1 -1
- package/dist/esm/bdx/BdxSession.js +34 -9
- package/dist/esm/bdx/BdxSession.js.map +1 -1
- package/dist/esm/bdx/BdxSessionConfiguration.d.ts +16 -1
- package/dist/esm/bdx/BdxSessionConfiguration.d.ts.map +1 -1
- package/dist/esm/bdx/BdxSessionConfiguration.js +6 -1
- package/dist/esm/bdx/BdxSessionConfiguration.js.map +1 -1
- package/dist/esm/bdx/FileDesignator.d.ts +15 -1
- package/dist/esm/bdx/FileDesignator.d.ts.map +1 -1
- package/dist/esm/bdx/FileDesignator.js +29 -3
- package/dist/esm/bdx/FileDesignator.js.map +1 -1
- package/dist/esm/bdx/PersistedFileDesignator.d.ts +10 -2
- package/dist/esm/bdx/PersistedFileDesignator.d.ts.map +1 -1
- package/dist/esm/bdx/PersistedFileDesignator.js +24 -6
- package/dist/esm/bdx/PersistedFileDesignator.js.map +1 -1
- package/dist/esm/bdx/ScopedStorage.d.ts +18 -0
- package/dist/esm/bdx/ScopedStorage.d.ts.map +1 -0
- package/dist/esm/bdx/ScopedStorage.js +16 -0
- package/dist/esm/bdx/ScopedStorage.js.map +6 -0
- package/dist/esm/bdx/bdx-session-initiator.d.ts.map +1 -1
- package/dist/esm/bdx/bdx-session-initiator.js +10 -2
- package/dist/esm/bdx/bdx-session-initiator.js.map +1 -1
- package/dist/esm/bdx/flow/DrivenSendingFlow.d.ts.map +1 -1
- package/dist/esm/bdx/flow/DrivenSendingFlow.js +2 -0
- package/dist/esm/bdx/flow/DrivenSendingFlow.js.map +1 -1
- package/dist/esm/bdx/flow/DrivingReceivingFlow.d.ts.map +1 -1
- package/dist/esm/bdx/flow/DrivingReceivingFlow.js +1 -0
- package/dist/esm/bdx/flow/DrivingReceivingFlow.js.map +1 -1
- package/dist/esm/bdx/flow/Flow.d.ts +7 -0
- package/dist/esm/bdx/flow/Flow.d.ts.map +1 -1
- package/dist/esm/bdx/flow/Flow.js +23 -2
- package/dist/esm/bdx/flow/Flow.js.map +1 -1
- package/dist/esm/bdx/flow/FollowingReceivingFlow.d.ts.map +1 -1
- package/dist/esm/bdx/flow/FollowingReceivingFlow.js +3 -0
- package/dist/esm/bdx/flow/FollowingReceivingFlow.js.map +1 -1
- package/dist/esm/bdx/flow/FollowingSendingFlow.d.ts.map +1 -1
- package/dist/esm/bdx/flow/FollowingSendingFlow.js +1 -0
- package/dist/esm/bdx/flow/FollowingSendingFlow.js.map +1 -1
- package/dist/esm/bdx/flow/OutboundFlow.d.ts.map +1 -1
- package/dist/esm/bdx/flow/OutboundFlow.js +1 -0
- package/dist/esm/bdx/flow/OutboundFlow.js.map +1 -1
- package/dist/esm/bdx/index.d.ts +1 -0
- package/dist/esm/bdx/index.d.ts.map +1 -1
- package/dist/esm/bdx/index.js +1 -0
- package/dist/esm/bdx/index.js.map +1 -1
- package/dist/esm/certificate/kinds/Icac.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/Icac.js +1 -7
- package/dist/esm/certificate/kinds/Icac.js.map +1 -1
- package/dist/esm/certificate/kinds/Rcac.d.ts +1 -0
- package/dist/esm/certificate/kinds/Rcac.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/Rcac.js +3 -0
- package/dist/esm/certificate/kinds/Rcac.js.map +1 -1
- package/dist/esm/certificate/kinds/definitions/operational.d.ts +1 -1
- package/dist/esm/certificate/kinds/definitions/operational.js +1 -1
- package/dist/esm/certificate/kinds/definitions/operational.js.map +1 -1
- package/dist/esm/common/FailsafeContext.js +2 -2
- package/dist/esm/common/FailsafeContext.js.map +1 -1
- package/dist/esm/dcl/DclClient.d.ts.map +1 -1
- package/dist/esm/dcl/DclClient.js +1 -2
- package/dist/esm/dcl/DclClient.js.map +1 -1
- package/dist/esm/dcl/DclOtaUpdateService.d.ts +30 -31
- package/dist/esm/dcl/DclOtaUpdateService.d.ts.map +1 -1
- package/dist/esm/dcl/DclOtaUpdateService.js +191 -93
- package/dist/esm/dcl/DclOtaUpdateService.js.map +2 -2
- package/dist/esm/dcl/index.d.ts +0 -3
- package/dist/esm/dcl/index.d.ts.map +1 -1
- package/dist/esm/dcl/index.js +0 -3
- package/dist/esm/dcl/index.js.map +1 -1
- package/dist/esm/fabric/Fabric.d.ts +53 -9
- package/dist/esm/fabric/Fabric.d.ts.map +1 -1
- package/dist/esm/fabric/Fabric.js +67 -33
- package/dist/esm/fabric/Fabric.js.map +1 -1
- package/dist/esm/fabric/FabricAuthority.js +1 -1
- package/dist/esm/fabric/FabricAuthority.js.map +1 -1
- package/dist/esm/fabric/FabricManager.d.ts +14 -5
- package/dist/esm/fabric/FabricManager.d.ts.map +1 -1
- package/dist/esm/fabric/FabricManager.js +66 -43
- package/dist/esm/fabric/FabricManager.js.map +1 -1
- package/dist/esm/groups/FabricGroups.d.ts.map +1 -1
- package/dist/esm/groups/FabricGroups.js +5 -9
- package/dist/esm/groups/FabricGroups.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interaction/InteractionMessenger.d.ts +1 -106
- package/dist/esm/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/esm/interaction/InteractionMessenger.js +2 -144
- package/dist/esm/interaction/InteractionMessenger.js.map +2 -2
- package/dist/esm/interaction/index.d.ts +0 -1
- package/dist/esm/interaction/index.d.ts.map +1 -1
- package/dist/esm/interaction/index.js +0 -1
- package/dist/esm/interaction/index.js.map +1 -1
- package/dist/esm/mdns/MdnsClient.d.ts +4 -4
- package/dist/esm/mdns/MdnsClient.d.ts.map +1 -1
- package/dist/esm/mdns/MdnsClient.js +13 -17
- package/dist/esm/mdns/MdnsClient.js.map +1 -1
- package/dist/esm/mdns/MdnsConsts.d.ts +3 -3
- package/dist/esm/mdns/MdnsConsts.d.ts.map +1 -1
- package/dist/esm/mdns/MdnsConsts.js +3 -2
- package/dist/esm/mdns/MdnsConsts.js.map +1 -1
- package/dist/{cjs/dcl → esm/ota}/OtaImageHeader.d.ts.map +1 -1
- package/dist/esm/{dcl → ota}/OtaImageHeader.js.map +1 -1
- package/dist/esm/{dcl → ota}/OtaImageReader.d.ts.map +1 -1
- package/dist/esm/{dcl → ota}/OtaImageReader.js +0 -3
- package/dist/esm/ota/OtaImageReader.js.map +6 -0
- package/dist/{cjs/dcl → esm/ota}/OtaImageWriter.d.ts +1 -1
- package/dist/esm/{dcl → ota}/OtaImageWriter.d.ts.map +1 -1
- package/dist/esm/{dcl → ota}/OtaImageWriter.js.map +1 -1
- package/dist/esm/ota/index.d.ts +9 -0
- package/dist/esm/ota/index.d.ts.map +1 -0
- package/dist/esm/ota/index.js +9 -0
- package/dist/esm/ota/index.js.map +6 -0
- package/dist/esm/peer/ControllerCommissioner.d.ts.map +1 -1
- package/dist/esm/peer/ControllerCommissioner.js +5 -0
- package/dist/esm/peer/ControllerCommissioner.js.map +1 -1
- package/dist/esm/peer/ControllerCommissioningFlow.d.ts +11 -3
- package/dist/esm/peer/ControllerCommissioningFlow.d.ts.map +1 -1
- package/dist/esm/peer/ControllerCommissioningFlow.js +119 -41
- package/dist/esm/peer/ControllerCommissioningFlow.js.map +1 -1
- package/dist/esm/peer/PeerSet.d.ts.map +1 -1
- package/dist/esm/peer/PeerSet.js +17 -10
- package/dist/esm/peer/PeerSet.js.map +1 -1
- package/dist/esm/protocol/DeviceAdvertiser.js +3 -3
- package/dist/esm/protocol/DeviceAdvertiser.js.map +1 -1
- package/dist/esm/protocol/ExchangeProvider.d.ts +2 -2
- package/dist/esm/protocol/ExchangeProvider.d.ts.map +1 -1
- package/dist/esm/protocol/ExchangeProvider.js +2 -2
- package/dist/esm/protocol/ExchangeProvider.js.map +1 -1
- package/dist/esm/protocol/MessageExchange.js +3 -3
- package/dist/esm/protocol/MessageExchange.js.map +1 -1
- package/dist/esm/protocol/ProtocolMocks.d.ts +2 -2
- package/dist/esm/protocol/ProtocolMocks.d.ts.map +1 -1
- package/dist/esm/protocol/ProtocolMocks.js +11 -2
- package/dist/esm/protocol/ProtocolMocks.js.map +1 -1
- package/dist/esm/session/NodeSession.d.ts.map +1 -1
- package/dist/esm/session/NodeSession.js +3 -3
- package/dist/esm/session/NodeSession.js.map +1 -1
- package/dist/esm/session/Session.d.ts.map +1 -1
- package/dist/esm/session/Session.js +1 -0
- package/dist/esm/session/Session.js.map +1 -1
- package/dist/esm/session/SessionManager.js +2 -2
- package/dist/esm/session/SessionManager.js.map +1 -1
- package/dist/esm/session/SessionParameters.d.ts.map +1 -1
- package/dist/esm/session/SessionParameters.js +7 -1
- package/dist/esm/session/SessionParameters.js.map +1 -1
- package/dist/esm/session/pase/PaseServer.d.ts.map +1 -1
- package/dist/esm/session/pase/PaseServer.js +1 -0
- package/dist/esm/session/pase/PaseServer.js.map +1 -1
- package/package.json +6 -6
- package/src/action/client/ClientBdx.ts +19 -0
- package/src/action/client/ClientInteraction.ts +34 -4
- package/src/action/client/QueuedClientInteraction.ts +16 -12
- package/src/action/client/index.ts +1 -0
- package/src/action/request/Read.ts +8 -2
- package/src/action/request/Write.ts +3 -3
- package/src/advertisement/ble/BleAdvertisement.ts +4 -4
- package/src/advertisement/mdns/CommissionableMdnsAdvertisement.ts +1 -1
- package/src/advertisement/mdns/OperationalMdnsAdvertisement.ts +4 -6
- package/src/bdx/BdxClient.ts +8 -0
- package/src/bdx/BdxError.ts +2 -0
- package/src/bdx/BdxMessenger.ts +16 -5
- package/src/bdx/BdxProtocol.ts +104 -22
- package/src/bdx/BdxSession.ts +38 -16
- package/src/bdx/BdxSessionConfiguration.ts +24 -2
- package/src/bdx/FileDesignator.ts +31 -2
- package/src/bdx/PersistedFileDesignator.ts +35 -8
- package/src/bdx/ScopedStorage.ts +25 -0
- package/src/bdx/bdx-session-initiator.ts +11 -2
- package/src/bdx/flow/DrivenSendingFlow.ts +3 -0
- package/src/bdx/flow/DrivingReceivingFlow.ts +1 -0
- package/src/bdx/flow/Flow.ts +29 -2
- package/src/bdx/flow/FollowingReceivingFlow.ts +3 -0
- package/src/bdx/flow/FollowingSendingFlow.ts +2 -0
- package/src/bdx/flow/OutboundFlow.ts +1 -0
- package/src/bdx/index.ts +1 -0
- package/src/certificate/kinds/Icac.ts +4 -1
- package/src/certificate/kinds/Rcac.ts +4 -0
- package/src/certificate/kinds/definitions/operational.ts +1 -1
- package/src/common/FailsafeContext.ts +2 -2
- package/src/dcl/DclClient.ts +1 -2
- package/src/dcl/DclOtaUpdateService.ts +266 -125
- package/src/dcl/index.ts +0 -3
- package/src/fabric/Fabric.ts +118 -39
- package/src/fabric/FabricAuthority.ts +1 -1
- package/src/fabric/FabricManager.ts +76 -49
- package/src/groups/FabricGroups.ts +5 -9
- package/src/index.ts +1 -0
- package/src/interaction/InteractionMessenger.ts +2 -186
- package/src/interaction/index.ts +0 -1
- package/src/mdns/MdnsClient.ts +14 -19
- package/src/mdns/MdnsConsts.ts +5 -4
- package/src/{dcl → ota}/OtaImageReader.ts +1 -5
- package/src/{dcl → ota}/OtaImageWriter.ts +1 -1
- package/src/ota/index.ts +9 -0
- package/src/peer/ControllerCommissioner.ts +7 -0
- package/src/peer/ControllerCommissioningFlow.ts +161 -54
- package/src/peer/PeerSet.ts +25 -12
- package/src/protocol/DeviceAdvertiser.ts +5 -5
- package/src/protocol/ExchangeProvider.ts +3 -3
- package/src/protocol/MessageExchange.ts +3 -3
- package/src/protocol/ProtocolMocks.ts +13 -4
- package/src/session/NodeSession.ts +3 -3
- package/src/session/Session.ts +1 -0
- package/src/session/SessionManager.ts +2 -2
- package/src/session/SessionParameters.ts +10 -2
- package/src/session/pase/PaseServer.ts +2 -1
- package/dist/cjs/dcl/OtaImageReader.js.map +0 -6
- package/dist/cjs/interaction/SubscriptionClient.d.ts +0 -39
- package/dist/cjs/interaction/SubscriptionClient.d.ts.map +0 -1
- package/dist/cjs/interaction/SubscriptionClient.js +0 -93
- package/dist/cjs/interaction/SubscriptionClient.js.map +0 -6
- package/dist/esm/dcl/OtaImageReader.js.map +0 -6
- package/dist/esm/interaction/SubscriptionClient.d.ts +0 -39
- package/dist/esm/interaction/SubscriptionClient.d.ts.map +0 -1
- package/dist/esm/interaction/SubscriptionClient.js +0 -73
- package/dist/esm/interaction/SubscriptionClient.js.map +0 -6
- package/src/interaction/SubscriptionClient.ts +0 -104
- /package/dist/cjs/{dcl → ota}/OtaImageHeader.d.ts +0 -0
- /package/dist/cjs/{dcl → ota}/OtaImageHeader.js +0 -0
- /package/dist/cjs/{dcl → ota}/OtaImageReader.d.ts +0 -0
- /package/dist/cjs/{dcl → ota}/OtaImageWriter.js +0 -0
- /package/dist/esm/{dcl → ota}/OtaImageHeader.d.ts +0 -0
- /package/dist/esm/{dcl → ota}/OtaImageHeader.js +0 -0
- /package/dist/esm/{dcl → ota}/OtaImageReader.d.ts +0 -0
- /package/dist/esm/{dcl → ota}/OtaImageWriter.js +0 -0
- /package/src/{dcl → ota}/OtaImageHeader.ts +0 -0
package/src/fabric/Fabric.ts
CHANGED
|
@@ -31,12 +31,19 @@ import { FabricAccessControl } from "#interaction/FabricAccessControl.js";
|
|
|
31
31
|
import { PeerAddress } from "#peer/PeerAddress.js";
|
|
32
32
|
import { MessageExchange } from "#protocol/MessageExchange.js";
|
|
33
33
|
import { SecureSession } from "#session/SecureSession.js";
|
|
34
|
-
import {
|
|
34
|
+
import {
|
|
35
|
+
CaseAuthenticatedTag,
|
|
36
|
+
FabricId,
|
|
37
|
+
FabricIndex,
|
|
38
|
+
GlobalFabricId,
|
|
39
|
+
GroupId,
|
|
40
|
+
NodeId,
|
|
41
|
+
StatusResponse,
|
|
42
|
+
VendorId,
|
|
43
|
+
} from "#types";
|
|
35
44
|
|
|
36
45
|
const logger = Logger.get("Fabric");
|
|
37
46
|
|
|
38
|
-
const COMPRESSED_FABRIC_ID_INFO = Bytes.fromString("CompressedFabric");
|
|
39
|
-
|
|
40
47
|
export class PublicKeyError extends MatterError {}
|
|
41
48
|
|
|
42
49
|
export type ExposedFabricInformation = {
|
|
@@ -54,8 +61,8 @@ export class Fabric {
|
|
|
54
61
|
readonly fabricId: FabricId;
|
|
55
62
|
readonly nodeId: NodeId;
|
|
56
63
|
readonly rootNodeId: NodeId;
|
|
57
|
-
readonly
|
|
58
|
-
|
|
64
|
+
readonly globalId: GlobalFabricId;
|
|
65
|
+
#rootPublicKey?: Bytes;
|
|
59
66
|
#rootVendorId: VendorId;
|
|
60
67
|
readonly rootCert: Bytes;
|
|
61
68
|
readonly identityProtectionKey: Bytes;
|
|
@@ -78,14 +85,24 @@ export class Fabric {
|
|
|
78
85
|
#storage?: StorageContext;
|
|
79
86
|
#isDeleting?: boolean;
|
|
80
87
|
|
|
81
|
-
|
|
88
|
+
/**
|
|
89
|
+
* Create a fabric synchronously.
|
|
90
|
+
*
|
|
91
|
+
* Certain derived fields that require async crypto operations to compute must be supplied here. Use {@link create}
|
|
92
|
+
* to populate these fields automatically.
|
|
93
|
+
*/
|
|
94
|
+
constructor(crypto: Crypto, config: Fabric.ConstructorConfig) {
|
|
82
95
|
this.#crypto = crypto;
|
|
83
96
|
this.fabricIndex = config.fabricIndex;
|
|
84
97
|
this.fabricId = config.fabricId;
|
|
85
98
|
this.nodeId = config.nodeId;
|
|
86
99
|
this.rootNodeId = config.rootNodeId;
|
|
87
|
-
|
|
88
|
-
|
|
100
|
+
if ("operationalId" in config) {
|
|
101
|
+
this.globalId = GlobalFabricId(config.operationalId);
|
|
102
|
+
} else {
|
|
103
|
+
this.globalId = config.globalId;
|
|
104
|
+
}
|
|
105
|
+
this.#rootPublicKey = config.rootPublicKey;
|
|
89
106
|
this.#rootVendorId = config.rootVendorId;
|
|
90
107
|
this.rootCert = config.rootCert;
|
|
91
108
|
this.identityProtectionKey = config.identityProtectionKey;
|
|
@@ -100,17 +117,52 @@ export class Fabric {
|
|
|
100
117
|
this.#groups = new FabricGroups(this);
|
|
101
118
|
}
|
|
102
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Create a fabric.
|
|
122
|
+
*
|
|
123
|
+
* This async creation path populates derived fields that require async crypto operations to compute.
|
|
124
|
+
*/
|
|
125
|
+
static async create(crypto: Crypto, config: Fabric.Config) {
|
|
126
|
+
let { globalId, operationalIdentityProtectionKey } = config;
|
|
127
|
+
|
|
128
|
+
// Compute global ID if not passed as config
|
|
129
|
+
if (globalId === undefined) {
|
|
130
|
+
const caKey = config.rootPublicKey ?? Rcac.publicKeyOfTlv(config.rootCert);
|
|
131
|
+
globalId = await GlobalFabricId.compute(crypto, config.fabricId, caKey);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Compute operational IPK if not passed as config
|
|
135
|
+
if (operationalIdentityProtectionKey === undefined) {
|
|
136
|
+
operationalIdentityProtectionKey = await crypto.createHkdfKey(
|
|
137
|
+
config.identityProtectionKey,
|
|
138
|
+
Bytes.fromBigInt(globalId, 8),
|
|
139
|
+
GROUP_SECURITY_INFO,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return new Fabric(crypto, {
|
|
144
|
+
...config,
|
|
145
|
+
globalId,
|
|
146
|
+
operationalIdentityProtectionKey,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
103
150
|
get crypto() {
|
|
104
151
|
return this.#crypto;
|
|
105
152
|
}
|
|
106
153
|
|
|
107
|
-
|
|
108
|
-
|
|
154
|
+
/**
|
|
155
|
+
* Obtain configuration required to recreate fabric.
|
|
156
|
+
*
|
|
157
|
+
* TODO - we currently use this for persistence; remove when we move to OperationalCredentials as "source of truth"
|
|
158
|
+
*/
|
|
159
|
+
get config(): Fabric.SyncConfig {
|
|
160
|
+
const config = {
|
|
109
161
|
fabricIndex: this.fabricIndex,
|
|
110
162
|
fabricId: this.fabricId,
|
|
111
163
|
nodeId: this.nodeId,
|
|
112
164
|
rootNodeId: this.rootNodeId,
|
|
113
|
-
|
|
165
|
+
globalId: this.globalId,
|
|
114
166
|
rootPublicKey: this.rootPublicKey,
|
|
115
167
|
keyPair: this.#keyPair.keyPair,
|
|
116
168
|
rootVendorId: this.rootVendorId,
|
|
@@ -122,6 +174,11 @@ export class Fabric {
|
|
|
122
174
|
vidVerificationStatement: this.vidVerificationStatement,
|
|
123
175
|
label: this.#label,
|
|
124
176
|
};
|
|
177
|
+
|
|
178
|
+
// Backwards compatibility
|
|
179
|
+
(config as unknown as { operationalId: Bytes }).operationalId = Bytes.fromBigInt(this.globalId, 8);
|
|
180
|
+
|
|
181
|
+
return config;
|
|
125
182
|
}
|
|
126
183
|
|
|
127
184
|
get label() {
|
|
@@ -185,6 +242,13 @@ export class Fabric {
|
|
|
185
242
|
return this.#vvsc;
|
|
186
243
|
}
|
|
187
244
|
|
|
245
|
+
get rootPublicKey() {
|
|
246
|
+
if (this.#rootPublicKey === undefined) {
|
|
247
|
+
this.#rootPublicKey = Rcac.publicKeyOfTlv(this.rootCert);
|
|
248
|
+
}
|
|
249
|
+
return this.#rootPublicKey;
|
|
250
|
+
}
|
|
251
|
+
|
|
188
252
|
get rootVendorId() {
|
|
189
253
|
return this.#rootVendorId;
|
|
190
254
|
}
|
|
@@ -373,7 +437,6 @@ export class FabricBuilder {
|
|
|
373
437
|
#fabricId?: FabricId;
|
|
374
438
|
#nodeId?: NodeId;
|
|
375
439
|
#rootNodeId?: NodeId;
|
|
376
|
-
#rootPublicKey?: Bytes;
|
|
377
440
|
#identityProtectionKey?: Bytes;
|
|
378
441
|
#vidVerificationStatement?: Bytes;
|
|
379
442
|
#vvsc?: Bytes;
|
|
@@ -405,7 +468,6 @@ export class FabricBuilder {
|
|
|
405
468
|
const root = Rcac.fromTlv(rootCert);
|
|
406
469
|
await root.verify(this.#crypto);
|
|
407
470
|
this.#rootCert = rootCert;
|
|
408
|
-
this.#rootPublicKey = root.cert.ellipticCurvePublicKey;
|
|
409
471
|
return this;
|
|
410
472
|
}
|
|
411
473
|
|
|
@@ -423,7 +485,7 @@ export class FabricBuilder {
|
|
|
423
485
|
} = Noc.fromTlv(operationalCert).cert;
|
|
424
486
|
logger.debug(
|
|
425
487
|
"Installing operational certificate",
|
|
426
|
-
Diagnostic.dict({ nodeId, fabricId, caseAuthenticatedTags }),
|
|
488
|
+
Diagnostic.dict({ nodeId: NodeId.strOf(nodeId), fabricId, caseAuthenticatedTags }),
|
|
427
489
|
);
|
|
428
490
|
if (caseAuthenticatedTags !== undefined) {
|
|
429
491
|
CaseAuthenticatedTag.validateNocTagList(caseAuthenticatedTags);
|
|
@@ -481,17 +543,16 @@ export class FabricBuilder {
|
|
|
481
543
|
this.#rootNodeId = fabric.rootNodeId;
|
|
482
544
|
this.#identityProtectionKey = fabric.identityProtectionKey;
|
|
483
545
|
this.#rootCert = fabric.rootCert;
|
|
484
|
-
this.#rootPublicKey = fabric.rootPublicKey;
|
|
485
546
|
this.#vidVerificationStatement = fabric.vidVerificationStatement;
|
|
486
547
|
this.#vvsc = fabric.vvsc;
|
|
487
548
|
this.#label = fabric.label;
|
|
488
549
|
}
|
|
489
550
|
|
|
490
|
-
|
|
491
|
-
if (this.#fabricId === undefined || this.#
|
|
551
|
+
get globalId() {
|
|
552
|
+
if (this.#fabricId === undefined || this.#rootCert === undefined) {
|
|
492
553
|
throw new MatterFlowError("Node Operational Data needs to be set first.");
|
|
493
554
|
}
|
|
494
|
-
return
|
|
555
|
+
return GlobalFabricId.compute(this.#crypto, this.#fabricId, Rcac.publicKeyOfTlv(this.#rootCert));
|
|
495
556
|
}
|
|
496
557
|
|
|
497
558
|
get nodeId() {
|
|
@@ -510,38 +571,22 @@ export class FabricBuilder {
|
|
|
510
571
|
if (this.#fabricIndex !== undefined) throw new InternalError("FabricBuilder can only be built once");
|
|
511
572
|
if (this.#rootNodeId === undefined) throw new InternalError("rootNodeId needs to be set");
|
|
512
573
|
if (this.#rootVendorId === undefined) throw new InternalError("vendorId needs to be set");
|
|
513
|
-
if (this.#rootCert === undefined
|
|
514
|
-
throw new InternalError("rootCert needs to be set");
|
|
574
|
+
if (this.#rootCert === undefined) throw new InternalError("rootCert needs to be set");
|
|
515
575
|
if (this.#identityProtectionKey === undefined) throw new InternalError("identityProtectionKey needs to be set");
|
|
516
576
|
if (this.#operationalCert === undefined || this.#fabricId === undefined || this.#nodeId === undefined)
|
|
517
577
|
throw new InternalError("operationalCert needs to be set");
|
|
518
578
|
|
|
519
579
|
this.#fabricIndex = fabricIndex;
|
|
520
|
-
const saltWriter = new DataWriter();
|
|
521
|
-
saltWriter.writeUInt64(this.#fabricId);
|
|
522
|
-
const operationalId = await this.#crypto.createHkdfKey(
|
|
523
|
-
Bytes.of(this.#rootPublicKey).slice(1),
|
|
524
|
-
saltWriter.toByteArray(),
|
|
525
|
-
COMPRESSED_FABRIC_ID_INFO,
|
|
526
|
-
8,
|
|
527
|
-
);
|
|
528
580
|
|
|
529
|
-
return
|
|
581
|
+
return await Fabric.create(this.#crypto, {
|
|
530
582
|
fabricIndex: this.#fabricIndex,
|
|
531
583
|
fabricId: this.#fabricId,
|
|
532
584
|
nodeId: this.#nodeId,
|
|
533
585
|
rootNodeId: this.#rootNodeId,
|
|
534
|
-
operationalId: operationalId,
|
|
535
|
-
rootPublicKey: this.#rootPublicKey,
|
|
536
586
|
keyPair: this.#keyPair,
|
|
537
587
|
rootVendorId: this.#rootVendorId,
|
|
538
588
|
rootCert: this.#rootCert,
|
|
539
589
|
identityProtectionKey: this.#identityProtectionKey, // Epoch Key
|
|
540
|
-
operationalIdentityProtectionKey: await this.#crypto.createHkdfKey(
|
|
541
|
-
this.#identityProtectionKey,
|
|
542
|
-
operationalId,
|
|
543
|
-
GROUP_SECURITY_INFO,
|
|
544
|
-
),
|
|
545
590
|
intermediateCACert: this.#intermediateCACert,
|
|
546
591
|
operationalCert: this.#operationalCert,
|
|
547
592
|
vidVerificationStatement: this.#vidVerificationStatement,
|
|
@@ -552,22 +597,56 @@ export class FabricBuilder {
|
|
|
552
597
|
}
|
|
553
598
|
|
|
554
599
|
export namespace Fabric {
|
|
600
|
+
/**
|
|
601
|
+
* Configuration required to initialize a fabric.
|
|
602
|
+
*/
|
|
555
603
|
export type Config = {
|
|
556
604
|
fabricIndex: FabricIndex;
|
|
557
605
|
fabricId: FabricId;
|
|
558
606
|
nodeId: NodeId;
|
|
559
607
|
rootNodeId: NodeId;
|
|
560
|
-
operationalId: Bytes;
|
|
561
|
-
rootPublicKey: Bytes;
|
|
562
608
|
keyPair: BinaryKeyPair;
|
|
563
609
|
rootVendorId: VendorId;
|
|
564
610
|
rootCert: Bytes;
|
|
565
611
|
identityProtectionKey: Bytes;
|
|
566
612
|
vidVerificationStatement?: Bytes;
|
|
567
613
|
vvsc?: Bytes;
|
|
568
|
-
operationalIdentityProtectionKey: Bytes;
|
|
569
614
|
intermediateCACert: Bytes | undefined;
|
|
570
615
|
operationalCert: Bytes;
|
|
571
616
|
label: string;
|
|
617
|
+
|
|
618
|
+
// These are derived; Fabric.create() will generate if necessary
|
|
619
|
+
rootPublicKey?: Bytes;
|
|
620
|
+
globalId?: GlobalFabricId;
|
|
621
|
+
operationalIdentityProtectionKey?: Bytes;
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Configuration required to initialize a fabric without asynchronous crypto operations.
|
|
626
|
+
*/
|
|
627
|
+
export type SyncConfig = Config & {
|
|
628
|
+
operationalIdentityProtectionKey: Bytes;
|
|
629
|
+
globalId: GlobalFabricId;
|
|
572
630
|
};
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Configuration passed to fabric constructor.
|
|
634
|
+
*
|
|
635
|
+
* Provides deprecated fields for backwards compatibility.
|
|
636
|
+
*/
|
|
637
|
+
export type ConstructorConfig = Omit<SyncConfig, "globalId"> &
|
|
638
|
+
(
|
|
639
|
+
| {
|
|
640
|
+
globalId: GlobalFabricId;
|
|
641
|
+
}
|
|
642
|
+
| {
|
|
643
|
+
/** @deprecated */
|
|
644
|
+
operationalId: Bytes;
|
|
645
|
+
}
|
|
646
|
+
);
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* An object that may be used to identify a fabric.
|
|
650
|
+
*/
|
|
651
|
+
export type Identifier = FabricIndex | GlobalFabricId | { fabricIndex: FabricIndex };
|
|
573
652
|
}
|
|
@@ -147,7 +147,7 @@ export class FabricAuthority {
|
|
|
147
147
|
let index = config.adminFabricIndex;
|
|
148
148
|
if (index === undefined) {
|
|
149
149
|
index = this.#fabrics.allocateFabricIndex();
|
|
150
|
-
} else if (this.#fabrics.
|
|
150
|
+
} else if (this.#fabrics.maybeFor(index) !== undefined) {
|
|
151
151
|
throw new ImplementationError(`Cannot allocate controller fabric ${index} because index is in use`);
|
|
152
152
|
}
|
|
153
153
|
|
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
AsyncObservable,
|
|
9
|
+
BasicSet,
|
|
9
10
|
Bytes,
|
|
10
11
|
Construction,
|
|
11
12
|
Crypto,
|
|
13
|
+
Diagnostic,
|
|
12
14
|
Environment,
|
|
13
15
|
Environmental,
|
|
14
16
|
ImplementationError,
|
|
@@ -22,8 +24,7 @@ import {
|
|
|
22
24
|
StorageContext,
|
|
23
25
|
StorageManager,
|
|
24
26
|
} from "#general";
|
|
25
|
-
import {
|
|
26
|
-
import { FabricId, FabricIndex } from "#types";
|
|
27
|
+
import { FabricId, FabricIndex, GlobalFabricId, NodeId } from "#types";
|
|
27
28
|
import { Fabric } from "./Fabric.js";
|
|
28
29
|
|
|
29
30
|
const logger = Logger.get("FabricManager");
|
|
@@ -35,7 +36,7 @@ export class FabricTableFullError extends MatterError {}
|
|
|
35
36
|
export class FabricManager {
|
|
36
37
|
#crypto: Crypto;
|
|
37
38
|
#nextFabricIndex = 1;
|
|
38
|
-
readonly #fabrics = new
|
|
39
|
+
readonly #fabrics = new BasicSet<Fabric>();
|
|
39
40
|
#initializationDone = false;
|
|
40
41
|
#storage?: StorageContext;
|
|
41
42
|
#events = {
|
|
@@ -64,7 +65,7 @@ export class FabricManager {
|
|
|
64
65
|
|
|
65
66
|
const fabrics = await this.#storage.get<Fabric.Config[]>("fabrics", []);
|
|
66
67
|
for (const fabricConfig of fabrics) {
|
|
67
|
-
this.#addNewFabric(
|
|
68
|
+
this.#addNewFabric(await Fabric.create(crypto, fabricConfig));
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
this.#nextFabricIndex = await this.#storage.get("nextFabricIndex", this.#nextFabricIndex);
|
|
@@ -105,32 +106,63 @@ export class FabricManager {
|
|
|
105
106
|
await this.#storage?.clear();
|
|
106
107
|
}
|
|
107
108
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Test whether the fabric identified by {@link identifier} is present.
|
|
111
|
+
*/
|
|
112
|
+
has(address: Fabric.Identifier) {
|
|
113
|
+
let fabric;
|
|
114
|
+
if (typeof address === "bigint") {
|
|
115
|
+
fabric = this.#fabrics.get("globalId", address);
|
|
116
|
+
} else {
|
|
117
|
+
if (typeof address === "object") {
|
|
118
|
+
address = address.fabricIndex;
|
|
119
|
+
}
|
|
120
|
+
fabric = this.#fabrics.get("fabricIndex", address);
|
|
111
121
|
}
|
|
112
|
-
|
|
113
|
-
return fabric && !fabric.isDeleting;
|
|
122
|
+
return fabric !== undefined && !fabric.isDeleting;
|
|
114
123
|
}
|
|
115
124
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
125
|
+
/**
|
|
126
|
+
* Obtain the fabric identified by {@link identifier}.
|
|
127
|
+
*
|
|
128
|
+
* Throws if the fabric is not found.
|
|
129
|
+
*/
|
|
130
|
+
for(identifier: Fabric.Identifier) {
|
|
131
|
+
let fabric;
|
|
132
|
+
if (typeof identifier === "bigint") {
|
|
133
|
+
fabric = this.#fabrics.get("globalId", identifier);
|
|
134
|
+
} else {
|
|
135
|
+
if (typeof identifier === "object") {
|
|
136
|
+
identifier = identifier.fabricIndex;
|
|
137
|
+
}
|
|
138
|
+
fabric = this.#fabrics.get("fabricIndex", identifier);
|
|
119
139
|
}
|
|
120
|
-
|
|
121
|
-
if (fabric === undefined) {
|
|
122
|
-
|
|
140
|
+
|
|
141
|
+
if (fabric === undefined || fabric.isDeleting) {
|
|
142
|
+
const str = typeof identifier === "bigint" ? GlobalFabricId.strOf(identifier) : `#${identifier}`;
|
|
143
|
+
throw new FabricNotFoundError(
|
|
144
|
+
`Fabric index ${str} ${fabric === undefined ? "does not exist" : "is deleted"}`,
|
|
145
|
+
);
|
|
123
146
|
}
|
|
124
147
|
return fabric;
|
|
125
148
|
}
|
|
126
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Get the fabric identified by {@link identifier} if present.
|
|
152
|
+
*/
|
|
153
|
+
maybeFor(identifier: Fabric.Identifier) {
|
|
154
|
+
if (this.has(identifier)) {
|
|
155
|
+
return this.for(identifier);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
127
159
|
allocateFabricIndex() {
|
|
128
160
|
this.#construction.assert();
|
|
129
161
|
|
|
130
162
|
for (let i = 0; i < 254; i++) {
|
|
131
163
|
const fabricIndex = this.#nextFabricIndex++;
|
|
132
164
|
if (this.#nextFabricIndex > 254) this.#nextFabricIndex = 1;
|
|
133
|
-
if (!this.#fabrics.
|
|
165
|
+
if (!this.#fabrics.get("fabricIndex", FabricIndex(fabricIndex))) {
|
|
134
166
|
return FabricIndex(fabricIndex);
|
|
135
167
|
}
|
|
136
168
|
}
|
|
@@ -163,7 +195,7 @@ export class FabricManager {
|
|
|
163
195
|
|
|
164
196
|
#addNewFabric(fabric: Fabric) {
|
|
165
197
|
const { fabricIndex } = fabric;
|
|
166
|
-
if (this.#fabrics.
|
|
198
|
+
if (this.#fabrics.get("fabricIndex", fabricIndex)) {
|
|
167
199
|
throw new MatterFlowError(`Fabric with index ${fabricIndex} already exists.`);
|
|
168
200
|
}
|
|
169
201
|
|
|
@@ -176,8 +208,12 @@ export class FabricManager {
|
|
|
176
208
|
|
|
177
209
|
/** Insert Fabric into the manager without emitting events */
|
|
178
210
|
#addOrUpdateFabricEntry(fabric: Fabric) {
|
|
179
|
-
const
|
|
180
|
-
|
|
211
|
+
const existing = this.#fabrics.get("fabricIndex", fabric.fabricIndex);
|
|
212
|
+
if (existing) {
|
|
213
|
+
this.#fabrics.delete(existing);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
this.#fabrics.add(fabric);
|
|
181
217
|
|
|
182
218
|
fabric.leaving.on(() => this.events.leaving.emit(fabric));
|
|
183
219
|
fabric.deleting.on(() => this.events.deleting.emit(fabric));
|
|
@@ -186,7 +222,7 @@ export class FabricManager {
|
|
|
186
222
|
fabric.persistCallback = (isUpdate = true) => {
|
|
187
223
|
if (!this.#storage) {
|
|
188
224
|
if (isUpdate) {
|
|
189
|
-
logger.warn(`Fabric ${fabricIndex} cannot persist because FabricManager has no storage`);
|
|
225
|
+
logger.warn(`Fabric ${fabric.fabricIndex} cannot persist because FabricManager has no storage`);
|
|
190
226
|
}
|
|
191
227
|
return;
|
|
192
228
|
}
|
|
@@ -198,14 +234,14 @@ export class FabricManager {
|
|
|
198
234
|
});
|
|
199
235
|
};
|
|
200
236
|
if (this.#storage !== undefined && fabric.storage === undefined) {
|
|
201
|
-
fabric.storage = this.#storage.createContext(`fabric-${fabricIndex}`);
|
|
237
|
+
fabric.storage = this.#storage.createContext(`fabric-${fabric.fabricIndex}`);
|
|
202
238
|
}
|
|
203
239
|
}
|
|
204
240
|
|
|
205
241
|
async #handleFabricDeleted(fabric: Fabric) {
|
|
206
242
|
await this.#construction;
|
|
207
243
|
|
|
208
|
-
this.#fabrics.delete(fabric
|
|
244
|
+
this.#fabrics.delete(fabric);
|
|
209
245
|
if (this.#storage) {
|
|
210
246
|
await this.persistFabrics();
|
|
211
247
|
}
|
|
@@ -221,7 +257,7 @@ export class FabricManager {
|
|
|
221
257
|
get fabrics() {
|
|
222
258
|
this.#construction.assert();
|
|
223
259
|
|
|
224
|
-
return
|
|
260
|
+
return this.#fabrics.filter(fabric => !fabric.isDeleting);
|
|
225
261
|
}
|
|
226
262
|
|
|
227
263
|
get length() {
|
|
@@ -239,18 +275,31 @@ export class FabricManager {
|
|
|
239
275
|
async findFabricFromDestinationId(destinationId: Bytes, initiatorRandom: Bytes) {
|
|
240
276
|
this.#construction.assert();
|
|
241
277
|
|
|
242
|
-
for (const fabric of this.#fabrics
|
|
278
|
+
for (const fabric of this.#fabrics) {
|
|
243
279
|
const candidateDestinationIds = await fabric.destinationIdsFor(fabric.nodeId, initiatorRandom);
|
|
244
280
|
if (candidateDestinationIds.some(candidate => Bytes.areEqual(candidate, destinationId))) {
|
|
245
281
|
if (fabric.isDeleting) {
|
|
246
|
-
throw new FabricNotFoundError("Fabric is deleting");
|
|
282
|
+
throw new FabricNotFoundError("Fabric is deleting for CASE sigma2");
|
|
247
283
|
}
|
|
248
284
|
|
|
249
285
|
return fabric;
|
|
250
286
|
}
|
|
251
287
|
}
|
|
252
288
|
|
|
253
|
-
|
|
289
|
+
const fabrics = this.#fabrics.map(
|
|
290
|
+
fabric =>
|
|
291
|
+
`#${fabric.fabricIndex} (node ID ${NodeId.strOf(fabric.nodeId)}) keys ${fabric.groups.keySets
|
|
292
|
+
.allKeysForId(0)
|
|
293
|
+
.map(({ key }) => Bytes.toHex(key))
|
|
294
|
+
.join(" & ")}`,
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
logger.debug(
|
|
298
|
+
`No match for destination ID`,
|
|
299
|
+
Diagnostic.dict({ destId: destinationId, random: initiatorRandom, ...fabrics }),
|
|
300
|
+
);
|
|
301
|
+
|
|
302
|
+
throw new FabricNotFoundError("Fabric not found for CASE sigma2");
|
|
254
303
|
}
|
|
255
304
|
|
|
256
305
|
findByKeypair(keypair: Key) {
|
|
@@ -264,28 +313,6 @@ export class FabricManager {
|
|
|
264
313
|
return undefined;
|
|
265
314
|
}
|
|
266
315
|
|
|
267
|
-
maybeForIndex(index: FabricIndex) {
|
|
268
|
-
this.#construction.assert();
|
|
269
|
-
|
|
270
|
-
const fabric = this.#fabrics.get(index);
|
|
271
|
-
if (fabric && !fabric.isDeleting) {
|
|
272
|
-
return fabric;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
forIndex(index: FabricIndex) {
|
|
277
|
-
this.#construction.assert();
|
|
278
|
-
|
|
279
|
-
const fabric = this.#fabrics.get(index);
|
|
280
|
-
if (fabric === undefined) {
|
|
281
|
-
throw new FabricNotFoundError(`Fabric index ${index} does not exist`);
|
|
282
|
-
}
|
|
283
|
-
if (fabric.isDeleting) {
|
|
284
|
-
throw new FabricNotFoundError(`Fabric index ${index} is deleting`);
|
|
285
|
-
}
|
|
286
|
-
return fabric;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
316
|
forDescriptor(descriptor: { rootPublicKey: Bytes; fabricId: FabricId }) {
|
|
290
317
|
this.#construction.assert();
|
|
291
318
|
|
|
@@ -300,7 +327,7 @@ export class FabricManager {
|
|
|
300
327
|
await this.#construction;
|
|
301
328
|
|
|
302
329
|
const { fabricIndex } = fabric;
|
|
303
|
-
const existingFabric = this
|
|
330
|
+
const existingFabric = this.for(fabricIndex);
|
|
304
331
|
if (existingFabric === undefined) {
|
|
305
332
|
throw new FabricNotFoundError(
|
|
306
333
|
`Fabric with index ${fabricIndex} cannot be replaced because it does not exist.`,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import type { Fabric } from "#fabric/Fabric.js";
|
|
7
|
-
import { BasicMap, Bytes, InternalError, MatterFlowError, StorageContext } from "#general";
|
|
7
|
+
import { BasicMap, Bytes, hex, InternalError, MatterFlowError, StorageContext } from "#general";
|
|
8
8
|
import { GroupKeySet, KeySets, OperationalKeySet } from "#groups/KeySets.js";
|
|
9
9
|
import { MessagingState } from "#groups/MessagingState.js";
|
|
10
10
|
import { GroupId, MATTER_EPOCH_OFFSET_US } from "#types";
|
|
@@ -122,19 +122,15 @@ export class FabricGroups {
|
|
|
122
122
|
await this.#cleanUpCounters(groupKeySetId);
|
|
123
123
|
|
|
124
124
|
// Lets pre-calculate the operational keys
|
|
125
|
-
const
|
|
126
|
-
const operationalEpochKey0 = await this.#fabric.crypto.createHkdfKey(
|
|
127
|
-
epochKey0,
|
|
128
|
-
operationalId,
|
|
129
|
-
GROUP_SECURITY_INFO,
|
|
130
|
-
);
|
|
125
|
+
const globalId = Bytes.fromHex(hex.fixed(this.#fabric.globalId, 16));
|
|
126
|
+
const operationalEpochKey0 = await this.#fabric.crypto.createHkdfKey(epochKey0, globalId, GROUP_SECURITY_INFO);
|
|
131
127
|
const operationalEpochKey1 =
|
|
132
128
|
epochKey1 !== null
|
|
133
|
-
? await this.#fabric.crypto.createHkdfKey(epochKey1,
|
|
129
|
+
? await this.#fabric.crypto.createHkdfKey(epochKey1, globalId, GROUP_SECURITY_INFO)
|
|
134
130
|
: null;
|
|
135
131
|
const operationalEpochKey2 =
|
|
136
132
|
epochKey2 !== null
|
|
137
|
-
? await this.#fabric.crypto.createHkdfKey(epochKey2,
|
|
133
|
+
? await this.#fabric.crypto.createHkdfKey(epochKey2, globalId, GROUP_SECURITY_INFO)
|
|
138
134
|
: null;
|
|
139
135
|
this.#keySets.add({
|
|
140
136
|
...groupKeySet,
|
package/src/index.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from "./fabric/index.js";
|
|
|
21
21
|
export * from "./groups/index.js";
|
|
22
22
|
export * from "./interaction/index.js";
|
|
23
23
|
export * from "./mdns/index.js";
|
|
24
|
+
export * from "./ota/index.js";
|
|
24
25
|
export * from "./peer/index.js";
|
|
25
26
|
export * from "./protocol/index.js";
|
|
26
27
|
export * from "./securechannel/index.js";
|