@matter/protocol 0.18.0 → 0.18.1-alpha.0-20261111-b84c5d1bc
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/Val.d.ts +8 -0
- package/dist/cjs/action/Val.d.ts.map +1 -1
- package/dist/cjs/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/cjs/action/client/ClientInteraction.js +45 -32
- package/dist/cjs/action/client/ClientInteraction.js.map +1 -1
- package/dist/cjs/action/client/ClientRequest.d.ts +14 -0
- package/dist/cjs/action/client/ClientRequest.d.ts.map +1 -1
- package/dist/cjs/action/client/InputChunk.js +39 -2
- package/dist/cjs/action/client/InputChunk.js.map +1 -1
- package/dist/cjs/action/client/subscription/ClientSubscription.d.ts +2 -0
- package/dist/cjs/action/client/subscription/ClientSubscription.d.ts.map +1 -1
- package/dist/cjs/action/client/subscription/ClientSubscription.js +4 -0
- package/dist/cjs/action/client/subscription/ClientSubscription.js.map +1 -1
- package/dist/cjs/action/client/subscription/ClientSubscriptionHandler.d.ts.map +1 -1
- package/dist/cjs/action/client/subscription/ClientSubscriptionHandler.js +14 -0
- package/dist/cjs/action/client/subscription/ClientSubscriptionHandler.js.map +1 -1
- package/dist/cjs/action/client/subscription/PeerSubscription.d.ts +32 -0
- package/dist/cjs/action/client/subscription/PeerSubscription.d.ts.map +1 -1
- package/dist/cjs/action/client/subscription/PeerSubscription.js +61 -0
- package/dist/cjs/action/client/subscription/PeerSubscription.js.map +1 -1
- package/dist/cjs/action/errors.d.ts +3 -1
- package/dist/cjs/action/errors.d.ts.map +1 -1
- package/dist/cjs/action/errors.js +7 -2
- package/dist/cjs/action/errors.js.map +1 -1
- package/dist/cjs/action/protocols.d.ts +6 -1
- package/dist/cjs/action/protocols.d.ts.map +1 -1
- package/dist/cjs/action/request/Invoke.d.ts +24 -1
- package/dist/cjs/action/request/Invoke.d.ts.map +1 -1
- package/dist/cjs/action/request/Invoke.js +40 -12
- package/dist/cjs/action/request/Invoke.js.map +1 -1
- package/dist/cjs/action/request/Write.d.ts.map +1 -1
- package/dist/cjs/action/request/Write.js +6 -5
- package/dist/cjs/action/request/Write.js.map +1 -1
- package/dist/cjs/action/response/InvokeResult.d.ts +8 -2
- package/dist/cjs/action/response/InvokeResult.d.ts.map +1 -1
- package/dist/cjs/action/response/InvokeResult.js +28 -0
- package/dist/cjs/action/response/InvokeResult.js.map +2 -2
- package/dist/cjs/action/response/ReadResult.d.ts +14 -5
- package/dist/cjs/action/response/ReadResult.d.ts.map +1 -1
- package/dist/cjs/action/server/AttributeReadResponse.d.ts.map +1 -1
- package/dist/cjs/action/server/AttributeReadResponse.js +1 -1
- package/dist/cjs/action/server/AttributeReadResponse.js.map +1 -1
- package/dist/cjs/action/server/AttributeWriteResponse.d.ts.map +1 -1
- package/dist/cjs/action/server/AttributeWriteResponse.js +4 -2
- package/dist/cjs/action/server/AttributeWriteResponse.js.map +1 -1
- package/dist/cjs/action/server/EventReadResponse.d.ts.map +1 -1
- package/dist/cjs/action/server/EventReadResponse.js +1 -0
- package/dist/cjs/action/server/EventReadResponse.js.map +1 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertisement.d.ts +1 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertisement.d.ts.map +1 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertisement.js +7 -7
- package/dist/cjs/advertisement/mdns/MdnsAdvertisement.js.map +1 -1
- package/dist/cjs/ble/Ble.d.ts +2 -0
- package/dist/cjs/ble/Ble.d.ts.map +1 -1
- package/dist/cjs/ble/Ble.js +4 -0
- package/dist/cjs/ble/Ble.js.map +1 -1
- package/dist/cjs/certificate/CdSigners.d.ts +52 -0
- package/dist/cjs/certificate/CdSigners.d.ts.map +1 -0
- package/dist/cjs/certificate/CdSigners.js +111 -0
- package/dist/cjs/certificate/CdSigners.js.map +6 -0
- package/dist/cjs/certificate/CertificateAuthority.d.ts +1 -1
- package/dist/cjs/certificate/CertificateAuthority.d.ts.map +1 -1
- package/dist/cjs/certificate/DeviceAttestationValidator.d.ts +59 -7
- package/dist/cjs/certificate/DeviceAttestationValidator.d.ts.map +1 -1
- package/dist/cjs/certificate/DeviceAttestationValidator.js +122 -42
- package/dist/cjs/certificate/DeviceAttestationValidator.js.map +1 -1
- package/dist/cjs/certificate/DeviceCertification.d.ts.map +1 -1
- package/dist/cjs/certificate/DeviceCertification.js +5 -2
- package/dist/cjs/certificate/DeviceCertification.js.map +1 -1
- package/dist/cjs/certificate/NocsrValidator.d.ts +57 -0
- package/dist/cjs/certificate/NocsrValidator.d.ts.map +1 -0
- package/dist/cjs/certificate/NocsrValidator.js +109 -0
- package/dist/cjs/certificate/NocsrValidator.js.map +6 -0
- package/dist/cjs/certificate/PeerData.d.ts +12 -0
- package/dist/cjs/certificate/PeerData.d.ts.map +1 -0
- package/dist/cjs/certificate/PeerData.js +33 -0
- package/dist/cjs/certificate/PeerData.js.map +6 -0
- package/dist/cjs/certificate/index.d.ts +2 -0
- package/dist/cjs/certificate/index.d.ts.map +1 -1
- package/dist/cjs/certificate/index.js +2 -0
- package/dist/cjs/certificate/index.js.map +1 -1
- package/dist/cjs/certificate/kinds/AttestationCertificates.d.ts +42 -6
- package/dist/cjs/certificate/kinds/AttestationCertificates.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/AttestationCertificates.js +110 -13
- package/dist/cjs/certificate/kinds/AttestationCertificates.js.map +1 -1
- package/dist/cjs/certificate/kinds/Certificate.d.ts +13 -7
- package/dist/cjs/certificate/kinds/Certificate.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/Certificate.js +146 -240
- package/dist/cjs/certificate/kinds/Certificate.js.map +2 -2
- package/dist/cjs/certificate/kinds/CertificationDeclaration.d.ts +21 -3
- package/dist/cjs/certificate/kinds/CertificationDeclaration.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/CertificationDeclaration.js +76 -20
- package/dist/cjs/certificate/kinds/CertificationDeclaration.js.map +1 -1
- package/dist/cjs/certificate/kinds/DistinguishedName.d.ts +190 -0
- package/dist/cjs/certificate/kinds/DistinguishedName.d.ts.map +1 -0
- package/dist/cjs/certificate/kinds/DistinguishedName.js +417 -0
- package/dist/cjs/certificate/kinds/DistinguishedName.js.map +6 -0
- package/dist/cjs/certificate/kinds/Icac.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/Icac.js +5 -10
- package/dist/cjs/certificate/kinds/Icac.js.map +1 -1
- package/dist/cjs/certificate/kinds/Noc.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/Noc.js +5 -4
- package/dist/cjs/certificate/kinds/Noc.js.map +1 -1
- package/dist/cjs/certificate/kinds/OperationalBase.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/OperationalBase.js +4 -2
- package/dist/cjs/certificate/kinds/OperationalBase.js.map +1 -1
- package/dist/cjs/certificate/kinds/Rcac.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/Rcac.js +5 -10
- package/dist/cjs/certificate/kinds/Rcac.js.map +1 -1
- package/dist/cjs/certificate/kinds/Vvsc.d.ts +3 -3
- package/dist/cjs/certificate/kinds/Vvsc.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/Vvsc.js +19 -14
- package/dist/cjs/certificate/kinds/Vvsc.js.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/asn.d.ts +1 -1
- package/dist/cjs/certificate/kinds/definitions/asn.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/asn.js.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/attestation.d.ts +15 -15
- package/dist/cjs/certificate/kinds/definitions/attestation.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/base.d.ts +33 -0
- package/dist/cjs/certificate/kinds/definitions/base.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/base.js +8 -1
- package/dist/cjs/certificate/kinds/definitions/base.js.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/operational.d.ts +24 -20
- package/dist/cjs/certificate/kinds/definitions/operational.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/operational.js +5 -3
- package/dist/cjs/certificate/kinds/definitions/operational.js.map +1 -1
- package/dist/cjs/codec/MessageCodec.d.ts +27 -2
- package/dist/cjs/codec/MessageCodec.d.ts.map +1 -1
- package/dist/cjs/codec/MessageCodec.js +81 -74
- package/dist/cjs/codec/MessageCodec.js.map +1 -1
- package/dist/cjs/common/OperationalCredentialsTypes.d.ts +6 -0
- package/dist/cjs/common/OperationalCredentialsTypes.d.ts.map +1 -1
- package/dist/cjs/common/OperationalCredentialsTypes.js +2 -0
- package/dist/cjs/common/OperationalCredentialsTypes.js.map +1 -1
- package/dist/cjs/dcl/DclCertificateService.d.ts +28 -7
- package/dist/cjs/dcl/DclCertificateService.d.ts.map +1 -1
- package/dist/cjs/dcl/DclCertificateService.js +103 -30
- package/dist/cjs/dcl/DclCertificateService.js.map +1 -1
- package/dist/cjs/fabric/Fabric.d.ts +10 -5
- package/dist/cjs/fabric/Fabric.d.ts.map +1 -1
- package/dist/cjs/fabric/Fabric.js +12 -5
- package/dist/cjs/fabric/Fabric.js.map +1 -1
- package/dist/cjs/fabric/FabricManager.d.ts +2 -2
- package/dist/cjs/fabric/FabricManager.js +2 -2
- package/dist/cjs/groups/FabricGroups.d.ts +2 -0
- package/dist/cjs/groups/FabricGroups.d.ts.map +1 -1
- package/dist/cjs/groups/FabricGroups.js +4 -0
- package/dist/cjs/groups/FabricGroups.js.map +1 -1
- package/dist/cjs/groups/Groups.d.ts +7 -0
- package/dist/cjs/groups/Groups.d.ts.map +1 -1
- package/dist/cjs/groups/Groups.js +11 -2
- package/dist/cjs/groups/Groups.js.map +1 -1
- package/dist/cjs/groups/KeySets.d.ts +3 -3
- package/dist/cjs/groups/KeySets.js +3 -3
- package/dist/cjs/interaction/InteractionMessenger.d.ts +18 -1
- package/dist/cjs/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/cjs/interaction/InteractionMessenger.js +49 -19
- package/dist/cjs/interaction/InteractionMessenger.js.map +1 -1
- package/dist/cjs/mdns/InterfaceResponder.d.ts +137 -0
- package/dist/cjs/mdns/InterfaceResponder.d.ts.map +1 -0
- package/dist/cjs/mdns/InterfaceResponder.js +799 -0
- package/dist/cjs/mdns/InterfaceResponder.js.map +6 -0
- package/dist/cjs/mdns/MdnsServer.d.ts +82 -9
- package/dist/cjs/mdns/MdnsServer.d.ts.map +1 -1
- package/dist/cjs/mdns/MdnsServer.js +337 -267
- package/dist/cjs/mdns/MdnsServer.js.map +2 -2
- package/dist/cjs/mdns/MdnsService.d.ts.map +1 -1
- package/dist/cjs/mdns/MdnsService.js +3 -1
- package/dist/cjs/mdns/MdnsService.js.map +1 -1
- package/dist/cjs/peer/AdministratorCommands.d.ts +26 -0
- package/dist/cjs/peer/AdministratorCommands.d.ts.map +1 -0
- package/dist/cjs/peer/AdministratorCommands.js +40 -0
- package/dist/cjs/peer/AdministratorCommands.js.map +6 -0
- package/dist/cjs/peer/CommissioningConnection.d.ts.map +1 -1
- package/dist/cjs/peer/CommissioningConnection.js +4 -2
- package/dist/cjs/peer/CommissioningConnection.js.map +1 -1
- package/dist/cjs/peer/ControllerCommissioner.d.ts +9 -0
- package/dist/cjs/peer/ControllerCommissioner.d.ts.map +1 -1
- package/dist/cjs/peer/ControllerCommissioner.js +59 -13
- package/dist/cjs/peer/ControllerCommissioner.js.map +1 -1
- package/dist/cjs/peer/ControllerCommissioningFlow.d.ts +7 -7
- package/dist/cjs/peer/ControllerCommissioningFlow.d.ts.map +1 -1
- package/dist/cjs/peer/ControllerCommissioningFlow.js +124 -67
- package/dist/cjs/peer/ControllerCommissioningFlow.js.map +1 -1
- package/dist/cjs/peer/OperationalCertificateUpdate.d.ts +181 -0
- package/dist/cjs/peer/OperationalCertificateUpdate.d.ts.map +1 -0
- package/dist/cjs/peer/OperationalCertificateUpdate.js +553 -0
- package/dist/cjs/peer/OperationalCertificateUpdate.js.map +6 -0
- package/dist/cjs/peer/Peer.d.ts +5 -0
- package/dist/cjs/peer/Peer.d.ts.map +1 -1
- package/dist/cjs/peer/Peer.js +29 -1
- package/dist/cjs/peer/Peer.js.map +1 -1
- package/dist/cjs/peer/PeerAddressStore.d.ts +37 -0
- package/dist/cjs/peer/PeerAddressStore.d.ts.map +1 -0
- package/dist/cjs/peer/PeerAddressStore.js +114 -0
- package/dist/cjs/peer/PeerAddressStore.js.map +6 -0
- package/dist/cjs/peer/PeerConnection.d.ts.map +1 -1
- package/dist/cjs/peer/PeerConnection.js +0 -1
- package/dist/cjs/peer/PeerConnection.js.map +1 -1
- package/dist/cjs/peer/PeerDescriptor.d.ts +3 -4
- package/dist/cjs/peer/PeerDescriptor.d.ts.map +1 -1
- package/dist/cjs/peer/PeerDescriptor.js.map +1 -1
- package/dist/cjs/peer/PeerExchangeProvider.d.ts.map +1 -1
- package/dist/cjs/peer/PeerExchangeProvider.js +2 -1
- package/dist/cjs/peer/PeerExchangeProvider.js.map +1 -1
- package/dist/cjs/peer/PeerLossContext.d.ts +10 -2
- package/dist/cjs/peer/PeerLossContext.d.ts.map +1 -1
- package/dist/cjs/peer/PhysicalDeviceProperties.d.ts +13 -0
- package/dist/cjs/peer/PhysicalDeviceProperties.d.ts.map +1 -1
- package/dist/cjs/peer/PhysicalDeviceProperties.js +3 -2
- package/dist/cjs/peer/PhysicalDeviceProperties.js.map +1 -1
- package/dist/cjs/peer/RebootResubscribeArmer.d.ts +3 -3
- package/dist/cjs/peer/RebootResubscribeArmer.d.ts.map +1 -1
- package/dist/cjs/peer/RebootResubscribeArmer.js +21 -9
- package/dist/cjs/peer/RebootResubscribeArmer.js.map +1 -1
- package/dist/cjs/peer/index.d.ts +2 -0
- package/dist/cjs/peer/index.d.ts.map +1 -1
- package/dist/cjs/peer/index.js +2 -0
- package/dist/cjs/peer/index.js.map +1 -1
- package/dist/cjs/protocol/DeviceAdvertiser.d.ts.map +1 -1
- package/dist/cjs/protocol/DeviceAdvertiser.js +1 -1
- package/dist/cjs/protocol/DeviceAdvertiser.js.map +1 -1
- package/dist/cjs/protocol/ExchangeManager.d.ts +0 -1
- package/dist/cjs/protocol/ExchangeManager.d.ts.map +1 -1
- package/dist/cjs/protocol/ExchangeManager.js +136 -64
- package/dist/cjs/protocol/ExchangeManager.js.map +1 -1
- package/dist/cjs/protocol/ExchangeProvider.d.ts +3 -2
- package/dist/cjs/protocol/ExchangeProvider.d.ts.map +1 -1
- package/dist/cjs/protocol/ExchangeProvider.js.map +1 -1
- package/dist/cjs/protocol/MessageExchange.d.ts +13 -0
- package/dist/cjs/protocol/MessageExchange.d.ts.map +1 -1
- package/dist/cjs/protocol/MessageExchange.js +23 -7
- package/dist/cjs/protocol/MessageExchange.js.map +1 -1
- package/dist/cjs/protocol/MessageReceptionState.d.ts +1 -1
- package/dist/cjs/protocol/errors.d.ts +7 -1
- package/dist/cjs/protocol/errors.d.ts.map +1 -1
- package/dist/cjs/protocol/errors.js +3 -0
- package/dist/cjs/protocol/errors.js.map +1 -1
- package/dist/cjs/securechannel/SecureChannelMessenger.d.ts +6 -1
- package/dist/cjs/securechannel/SecureChannelMessenger.d.ts.map +1 -1
- package/dist/cjs/securechannel/SecureChannelMessenger.js +27 -12
- package/dist/cjs/securechannel/SecureChannelMessenger.js.map +1 -1
- package/dist/cjs/session/GroupSession.d.ts +58 -15
- package/dist/cjs/session/GroupSession.d.ts.map +1 -1
- package/dist/cjs/session/GroupSession.js +97 -102
- package/dist/cjs/session/GroupSession.js.map +2 -2
- package/dist/cjs/session/NodeSession.d.ts +50 -1
- package/dist/cjs/session/NodeSession.d.ts.map +1 -1
- package/dist/cjs/session/NodeSession.js +80 -4
- package/dist/cjs/session/NodeSession.js.map +1 -1
- package/dist/cjs/session/SecureSession.d.ts +9 -0
- package/dist/cjs/session/SecureSession.d.ts.map +1 -1
- package/dist/cjs/session/SecureSession.js +12 -0
- package/dist/cjs/session/SecureSession.js.map +1 -1
- package/dist/cjs/session/Session.d.ts +2 -2
- package/dist/cjs/session/Session.d.ts.map +1 -1
- package/dist/cjs/session/Session.js +1 -1
- package/dist/cjs/session/SessionManager.d.ts +76 -28
- package/dist/cjs/session/SessionManager.d.ts.map +1 -1
- package/dist/cjs/session/SessionManager.js +316 -153
- package/dist/cjs/session/SessionManager.js.map +2 -2
- package/dist/cjs/session/UnsecuredSession.d.ts +0 -1
- package/dist/cjs/session/UnsecuredSession.d.ts.map +1 -1
- package/dist/cjs/session/UnsecuredSession.js +2 -4
- package/dist/cjs/session/UnsecuredSession.js.map +1 -1
- package/dist/cjs/session/case/CaseClient.d.ts +5 -0
- package/dist/cjs/session/case/CaseClient.d.ts.map +1 -1
- package/dist/cjs/session/case/CaseClient.js +12 -11
- package/dist/cjs/session/case/CaseClient.js.map +2 -2
- package/dist/cjs/session/case/CaseServer.d.ts.map +1 -1
- package/dist/cjs/session/case/CaseServer.js +31 -11
- package/dist/cjs/session/case/CaseServer.js.map +1 -1
- package/dist/esm/action/Val.d.ts +8 -0
- package/dist/esm/action/Val.d.ts.map +1 -1
- package/dist/esm/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/esm/action/client/ClientInteraction.js +45 -32
- package/dist/esm/action/client/ClientInteraction.js.map +1 -1
- package/dist/esm/action/client/ClientRequest.d.ts +14 -0
- package/dist/esm/action/client/ClientRequest.d.ts.map +1 -1
- package/dist/esm/action/client/InputChunk.js +39 -2
- package/dist/esm/action/client/InputChunk.js.map +1 -1
- package/dist/esm/action/client/subscription/ClientSubscription.d.ts +2 -0
- package/dist/esm/action/client/subscription/ClientSubscription.d.ts.map +1 -1
- package/dist/esm/action/client/subscription/ClientSubscription.js +4 -0
- package/dist/esm/action/client/subscription/ClientSubscription.js.map +1 -1
- package/dist/esm/action/client/subscription/ClientSubscriptionHandler.d.ts.map +1 -1
- package/dist/esm/action/client/subscription/ClientSubscriptionHandler.js +14 -0
- package/dist/esm/action/client/subscription/ClientSubscriptionHandler.js.map +1 -1
- package/dist/esm/action/client/subscription/PeerSubscription.d.ts +32 -0
- package/dist/esm/action/client/subscription/PeerSubscription.d.ts.map +1 -1
- package/dist/esm/action/client/subscription/PeerSubscription.js +61 -0
- package/dist/esm/action/client/subscription/PeerSubscription.js.map +1 -1
- package/dist/esm/action/errors.d.ts +3 -1
- package/dist/esm/action/errors.d.ts.map +1 -1
- package/dist/esm/action/errors.js +7 -2
- package/dist/esm/action/errors.js.map +1 -1
- package/dist/esm/action/protocols.d.ts +6 -1
- package/dist/esm/action/protocols.d.ts.map +1 -1
- package/dist/esm/action/request/Invoke.d.ts +24 -1
- package/dist/esm/action/request/Invoke.d.ts.map +1 -1
- package/dist/esm/action/request/Invoke.js +41 -13
- package/dist/esm/action/request/Invoke.js.map +1 -1
- package/dist/esm/action/request/Write.d.ts.map +1 -1
- package/dist/esm/action/request/Write.js +7 -6
- package/dist/esm/action/request/Write.js.map +1 -1
- package/dist/esm/action/response/InvokeResult.d.ts +8 -2
- package/dist/esm/action/response/InvokeResult.d.ts.map +1 -1
- package/dist/esm/action/response/InvokeResult.js +26 -0
- package/dist/esm/action/response/InvokeResult.js.map +2 -2
- package/dist/esm/action/response/ReadResult.d.ts +14 -5
- package/dist/esm/action/response/ReadResult.d.ts.map +1 -1
- package/dist/esm/action/server/AttributeReadResponse.d.ts.map +1 -1
- package/dist/esm/action/server/AttributeReadResponse.js +2 -2
- package/dist/esm/action/server/AttributeReadResponse.js.map +1 -1
- package/dist/esm/action/server/AttributeWriteResponse.d.ts.map +1 -1
- package/dist/esm/action/server/AttributeWriteResponse.js +11 -3
- package/dist/esm/action/server/AttributeWriteResponse.js.map +1 -1
- package/dist/esm/action/server/EventReadResponse.d.ts.map +1 -1
- package/dist/esm/action/server/EventReadResponse.js +1 -0
- package/dist/esm/action/server/EventReadResponse.js.map +1 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertisement.d.ts +1 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertisement.d.ts.map +1 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertisement.js +7 -7
- package/dist/esm/advertisement/mdns/MdnsAdvertisement.js.map +1 -1
- package/dist/esm/ble/Ble.d.ts +2 -0
- package/dist/esm/ble/Ble.d.ts.map +1 -1
- package/dist/esm/ble/Ble.js +4 -0
- package/dist/esm/ble/Ble.js.map +1 -1
- package/dist/esm/certificate/CdSigners.d.ts +52 -0
- package/dist/esm/certificate/CdSigners.d.ts.map +1 -0
- package/dist/esm/certificate/CdSigners.js +91 -0
- package/dist/esm/certificate/CdSigners.js.map +6 -0
- package/dist/esm/certificate/CertificateAuthority.d.ts +1 -1
- package/dist/esm/certificate/CertificateAuthority.d.ts.map +1 -1
- package/dist/esm/certificate/DeviceAttestationValidator.d.ts +59 -7
- package/dist/esm/certificate/DeviceAttestationValidator.d.ts.map +1 -1
- package/dist/esm/certificate/DeviceAttestationValidator.js +124 -45
- package/dist/esm/certificate/DeviceAttestationValidator.js.map +1 -1
- package/dist/esm/certificate/DeviceCertification.d.ts.map +1 -1
- package/dist/esm/certificate/DeviceCertification.js +5 -2
- package/dist/esm/certificate/DeviceCertification.js.map +1 -1
- package/dist/esm/certificate/NocsrValidator.d.ts +57 -0
- package/dist/esm/certificate/NocsrValidator.d.ts.map +1 -0
- package/dist/esm/certificate/NocsrValidator.js +89 -0
- package/dist/esm/certificate/NocsrValidator.js.map +6 -0
- package/dist/esm/certificate/PeerData.d.ts +12 -0
- package/dist/esm/certificate/PeerData.d.ts.map +1 -0
- package/dist/esm/certificate/PeerData.js +13 -0
- package/dist/esm/certificate/PeerData.js.map +6 -0
- package/dist/esm/certificate/index.d.ts +2 -0
- package/dist/esm/certificate/index.d.ts.map +1 -1
- package/dist/esm/certificate/index.js +2 -0
- package/dist/esm/certificate/index.js.map +1 -1
- package/dist/esm/certificate/kinds/AttestationCertificates.d.ts +42 -6
- package/dist/esm/certificate/kinds/AttestationCertificates.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/AttestationCertificates.js +112 -15
- package/dist/esm/certificate/kinds/AttestationCertificates.js.map +1 -1
- package/dist/esm/certificate/kinds/Certificate.d.ts +13 -7
- package/dist/esm/certificate/kinds/Certificate.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/Certificate.js +153 -256
- package/dist/esm/certificate/kinds/Certificate.js.map +2 -2
- package/dist/esm/certificate/kinds/CertificationDeclaration.d.ts +21 -3
- package/dist/esm/certificate/kinds/CertificationDeclaration.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/CertificationDeclaration.js +79 -20
- package/dist/esm/certificate/kinds/CertificationDeclaration.js.map +1 -1
- package/dist/esm/certificate/kinds/DistinguishedName.d.ts +190 -0
- package/dist/esm/certificate/kinds/DistinguishedName.d.ts.map +1 -0
- package/dist/esm/certificate/kinds/DistinguishedName.js +422 -0
- package/dist/esm/certificate/kinds/DistinguishedName.js.map +6 -0
- package/dist/esm/certificate/kinds/Icac.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/Icac.js +6 -11
- package/dist/esm/certificate/kinds/Icac.js.map +1 -1
- package/dist/esm/certificate/kinds/Noc.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/Noc.js +5 -4
- package/dist/esm/certificate/kinds/Noc.js.map +1 -1
- package/dist/esm/certificate/kinds/OperationalBase.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/OperationalBase.js +4 -2
- package/dist/esm/certificate/kinds/OperationalBase.js.map +1 -1
- package/dist/esm/certificate/kinds/Rcac.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/Rcac.js +6 -11
- package/dist/esm/certificate/kinds/Rcac.js.map +1 -1
- package/dist/esm/certificate/kinds/Vvsc.d.ts +3 -3
- package/dist/esm/certificate/kinds/Vvsc.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/Vvsc.js +20 -15
- package/dist/esm/certificate/kinds/Vvsc.js.map +1 -1
- package/dist/esm/certificate/kinds/definitions/asn.d.ts +1 -1
- package/dist/esm/certificate/kinds/definitions/asn.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/definitions/asn.js.map +1 -1
- package/dist/esm/certificate/kinds/definitions/attestation.d.ts +15 -15
- package/dist/esm/certificate/kinds/definitions/attestation.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/definitions/base.d.ts +33 -0
- package/dist/esm/certificate/kinds/definitions/base.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/definitions/base.js +9 -2
- package/dist/esm/certificate/kinds/definitions/base.js.map +1 -1
- package/dist/esm/certificate/kinds/definitions/operational.d.ts +24 -20
- package/dist/esm/certificate/kinds/definitions/operational.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/definitions/operational.js +5 -3
- package/dist/esm/certificate/kinds/definitions/operational.js.map +1 -1
- package/dist/esm/codec/MessageCodec.d.ts +27 -2
- package/dist/esm/codec/MessageCodec.d.ts.map +1 -1
- package/dist/esm/codec/MessageCodec.js +82 -75
- package/dist/esm/codec/MessageCodec.js.map +1 -1
- package/dist/esm/common/OperationalCredentialsTypes.d.ts +6 -0
- package/dist/esm/common/OperationalCredentialsTypes.d.ts.map +1 -1
- package/dist/esm/common/OperationalCredentialsTypes.js +2 -0
- package/dist/esm/common/OperationalCredentialsTypes.js.map +1 -1
- package/dist/esm/dcl/DclCertificateService.d.ts +28 -7
- package/dist/esm/dcl/DclCertificateService.d.ts.map +1 -1
- package/dist/esm/dcl/DclCertificateService.js +108 -31
- package/dist/esm/dcl/DclCertificateService.js.map +1 -1
- package/dist/esm/fabric/Fabric.d.ts +10 -5
- package/dist/esm/fabric/Fabric.d.ts.map +1 -1
- package/dist/esm/fabric/Fabric.js +12 -5
- package/dist/esm/fabric/Fabric.js.map +1 -1
- package/dist/esm/fabric/FabricManager.d.ts +2 -2
- package/dist/esm/fabric/FabricManager.js +2 -2
- package/dist/esm/groups/FabricGroups.d.ts +2 -0
- package/dist/esm/groups/FabricGroups.d.ts.map +1 -1
- package/dist/esm/groups/FabricGroups.js +4 -0
- package/dist/esm/groups/FabricGroups.js.map +1 -1
- package/dist/esm/groups/Groups.d.ts +7 -0
- package/dist/esm/groups/Groups.d.ts.map +1 -1
- package/dist/esm/groups/Groups.js +11 -2
- package/dist/esm/groups/Groups.js.map +1 -1
- package/dist/esm/groups/KeySets.d.ts +3 -3
- package/dist/esm/groups/KeySets.js +3 -3
- package/dist/esm/interaction/InteractionMessenger.d.ts +18 -1
- package/dist/esm/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/esm/interaction/InteractionMessenger.js +50 -20
- package/dist/esm/interaction/InteractionMessenger.js.map +1 -1
- package/dist/esm/mdns/InterfaceResponder.d.ts +137 -0
- package/dist/esm/mdns/InterfaceResponder.d.ts.map +1 -0
- package/dist/esm/mdns/InterfaceResponder.js +794 -0
- package/dist/esm/mdns/InterfaceResponder.js.map +6 -0
- package/dist/esm/mdns/MdnsServer.d.ts +82 -9
- package/dist/esm/mdns/MdnsServer.d.ts.map +1 -1
- package/dist/esm/mdns/MdnsServer.js +341 -273
- package/dist/esm/mdns/MdnsServer.js.map +2 -2
- package/dist/esm/mdns/MdnsService.d.ts.map +1 -1
- package/dist/esm/mdns/MdnsService.js +3 -1
- package/dist/esm/mdns/MdnsService.js.map +1 -1
- package/dist/esm/peer/AdministratorCommands.d.ts +26 -0
- package/dist/esm/peer/AdministratorCommands.d.ts.map +1 -0
- package/dist/esm/peer/AdministratorCommands.js +20 -0
- package/dist/esm/peer/AdministratorCommands.js.map +6 -0
- package/dist/esm/peer/CommissioningConnection.d.ts.map +1 -1
- package/dist/esm/peer/CommissioningConnection.js +4 -2
- package/dist/esm/peer/CommissioningConnection.js.map +1 -1
- package/dist/esm/peer/ControllerCommissioner.d.ts +9 -0
- package/dist/esm/peer/ControllerCommissioner.d.ts.map +1 -1
- package/dist/esm/peer/ControllerCommissioner.js +59 -13
- package/dist/esm/peer/ControllerCommissioner.js.map +1 -1
- package/dist/esm/peer/ControllerCommissioningFlow.d.ts +7 -7
- package/dist/esm/peer/ControllerCommissioningFlow.d.ts.map +1 -1
- package/dist/esm/peer/ControllerCommissioningFlow.js +125 -70
- package/dist/esm/peer/ControllerCommissioningFlow.js.map +1 -1
- package/dist/esm/peer/OperationalCertificateUpdate.d.ts +181 -0
- package/dist/esm/peer/OperationalCertificateUpdate.d.ts.map +1 -0
- package/dist/esm/peer/OperationalCertificateUpdate.js +553 -0
- package/dist/esm/peer/OperationalCertificateUpdate.js.map +6 -0
- package/dist/esm/peer/Peer.d.ts +5 -0
- package/dist/esm/peer/Peer.d.ts.map +1 -1
- package/dist/esm/peer/Peer.js +29 -1
- package/dist/esm/peer/Peer.js.map +1 -1
- package/dist/esm/peer/PeerAddressStore.d.ts +37 -0
- package/dist/esm/peer/PeerAddressStore.d.ts.map +1 -0
- package/dist/esm/peer/PeerAddressStore.js +94 -0
- package/dist/esm/peer/PeerAddressStore.js.map +6 -0
- package/dist/esm/peer/PeerConnection.d.ts.map +1 -1
- package/dist/esm/peer/PeerConnection.js +0 -1
- package/dist/esm/peer/PeerConnection.js.map +1 -1
- package/dist/esm/peer/PeerDescriptor.d.ts +3 -4
- package/dist/esm/peer/PeerDescriptor.d.ts.map +1 -1
- package/dist/esm/peer/PeerDescriptor.js.map +1 -1
- package/dist/esm/peer/PeerExchangeProvider.d.ts.map +1 -1
- package/dist/esm/peer/PeerExchangeProvider.js +3 -2
- package/dist/esm/peer/PeerExchangeProvider.js.map +1 -1
- package/dist/esm/peer/PeerLossContext.d.ts +10 -2
- package/dist/esm/peer/PeerLossContext.d.ts.map +1 -1
- package/dist/esm/peer/PhysicalDeviceProperties.d.ts +13 -0
- package/dist/esm/peer/PhysicalDeviceProperties.d.ts.map +1 -1
- package/dist/esm/peer/PhysicalDeviceProperties.js +3 -2
- package/dist/esm/peer/PhysicalDeviceProperties.js.map +1 -1
- package/dist/esm/peer/RebootResubscribeArmer.d.ts +3 -3
- package/dist/esm/peer/RebootResubscribeArmer.d.ts.map +1 -1
- package/dist/esm/peer/RebootResubscribeArmer.js +21 -9
- package/dist/esm/peer/RebootResubscribeArmer.js.map +1 -1
- package/dist/esm/peer/index.d.ts +2 -0
- package/dist/esm/peer/index.d.ts.map +1 -1
- package/dist/esm/peer/index.js +2 -0
- package/dist/esm/peer/index.js.map +1 -1
- package/dist/esm/protocol/DeviceAdvertiser.d.ts.map +1 -1
- package/dist/esm/protocol/DeviceAdvertiser.js +1 -1
- package/dist/esm/protocol/DeviceAdvertiser.js.map +1 -1
- package/dist/esm/protocol/ExchangeManager.d.ts +0 -1
- package/dist/esm/protocol/ExchangeManager.d.ts.map +1 -1
- package/dist/esm/protocol/ExchangeManager.js +145 -67
- package/dist/esm/protocol/ExchangeManager.js.map +1 -1
- package/dist/esm/protocol/ExchangeProvider.d.ts +3 -2
- package/dist/esm/protocol/ExchangeProvider.d.ts.map +1 -1
- package/dist/esm/protocol/ExchangeProvider.js.map +1 -1
- package/dist/esm/protocol/MessageExchange.d.ts +13 -0
- package/dist/esm/protocol/MessageExchange.d.ts.map +1 -1
- package/dist/esm/protocol/MessageExchange.js +23 -7
- package/dist/esm/protocol/MessageExchange.js.map +1 -1
- package/dist/esm/protocol/MessageReceptionState.d.ts +1 -1
- package/dist/esm/protocol/errors.d.ts +7 -1
- package/dist/esm/protocol/errors.d.ts.map +1 -1
- package/dist/esm/protocol/errors.js +4 -1
- package/dist/esm/protocol/errors.js.map +1 -1
- package/dist/esm/securechannel/SecureChannelMessenger.d.ts +6 -1
- package/dist/esm/securechannel/SecureChannelMessenger.d.ts.map +1 -1
- package/dist/esm/securechannel/SecureChannelMessenger.js +27 -12
- package/dist/esm/securechannel/SecureChannelMessenger.js.map +1 -1
- package/dist/esm/session/GroupSession.d.ts +58 -15
- package/dist/esm/session/GroupSession.d.ts.map +1 -1
- package/dist/esm/session/GroupSession.js +97 -102
- package/dist/esm/session/GroupSession.js.map +2 -2
- package/dist/esm/session/NodeSession.d.ts +50 -1
- package/dist/esm/session/NodeSession.d.ts.map +1 -1
- package/dist/esm/session/NodeSession.js +83 -5
- package/dist/esm/session/NodeSession.js.map +1 -1
- package/dist/esm/session/SecureSession.d.ts +9 -0
- package/dist/esm/session/SecureSession.d.ts.map +1 -1
- package/dist/esm/session/SecureSession.js +18 -1
- package/dist/esm/session/SecureSession.js.map +1 -1
- package/dist/esm/session/Session.d.ts +2 -2
- package/dist/esm/session/Session.d.ts.map +1 -1
- package/dist/esm/session/Session.js +1 -1
- package/dist/esm/session/SessionManager.d.ts +76 -28
- package/dist/esm/session/SessionManager.d.ts.map +1 -1
- package/dist/esm/session/SessionManager.js +319 -156
- package/dist/esm/session/SessionManager.js.map +2 -2
- package/dist/esm/session/UnsecuredSession.d.ts +0 -1
- package/dist/esm/session/UnsecuredSession.d.ts.map +1 -1
- package/dist/esm/session/UnsecuredSession.js +5 -3
- package/dist/esm/session/UnsecuredSession.js.map +1 -1
- package/dist/esm/session/case/CaseClient.d.ts +5 -0
- package/dist/esm/session/case/CaseClient.d.ts.map +1 -1
- package/dist/esm/session/case/CaseClient.js +12 -11
- package/dist/esm/session/case/CaseClient.js.map +2 -2
- package/dist/esm/session/case/CaseServer.d.ts.map +1 -1
- package/dist/esm/session/case/CaseServer.js +31 -11
- package/dist/esm/session/case/CaseServer.js.map +1 -1
- package/package.json +5 -5
- package/src/action/Val.ts +8 -0
- package/src/action/client/ClientInteraction.ts +57 -33
- package/src/action/client/ClientRequest.ts +15 -0
- package/src/action/client/InputChunk.ts +57 -2
- package/src/action/client/subscription/ClientSubscription.ts +5 -0
- package/src/action/client/subscription/ClientSubscriptionHandler.ts +15 -0
- package/src/action/client/subscription/PeerSubscription.ts +73 -0
- package/src/action/errors.ts +10 -3
- package/src/action/protocols.ts +7 -1
- package/src/action/request/Invoke.ts +60 -15
- package/src/action/request/Write.ts +7 -6
- package/src/action/response/InvokeResult.ts +32 -2
- package/src/action/response/ReadResult.ts +15 -5
- package/src/action/server/AttributeReadResponse.ts +3 -2
- package/src/action/server/AttributeWriteResponse.ts +14 -3
- package/src/action/server/EventReadResponse.ts +1 -0
- package/src/advertisement/mdns/MdnsAdvertisement.ts +9 -9
- package/src/ble/Ble.ts +5 -0
- package/src/certificate/CdSigners.ts +137 -0
- package/src/certificate/CertificateAuthority.ts +1 -1
- package/src/certificate/DeviceAttestationValidator.ts +213 -56
- package/src/certificate/DeviceCertification.ts +6 -2
- package/src/certificate/NocsrValidator.ts +140 -0
- package/src/certificate/PeerData.ts +15 -0
- package/src/certificate/index.ts +2 -0
- package/src/certificate/kinds/AttestationCertificates.ts +183 -15
- package/src/certificate/kinds/Certificate.ts +203 -308
- package/src/certificate/kinds/CertificationDeclaration.ts +100 -46
- package/src/certificate/kinds/DistinguishedName.ts +677 -0
- package/src/certificate/kinds/Icac.ts +7 -12
- package/src/certificate/kinds/Noc.ts +12 -8
- package/src/certificate/kinds/OperationalBase.ts +5 -2
- package/src/certificate/kinds/Rcac.ts +7 -12
- package/src/certificate/kinds/Vvsc.ts +24 -15
- package/src/certificate/kinds/definitions/asn.ts +1 -1
- package/src/certificate/kinds/definitions/attestation.ts +15 -15
- package/src/certificate/kinds/definitions/base.ts +43 -1
- package/src/certificate/kinds/definitions/operational.ts +4 -3
- package/src/codec/MessageCodec.ts +92 -81
- package/src/common/OperationalCredentialsTypes.ts +7 -0
- package/src/dcl/DclCertificateService.ts +135 -36
- package/src/fabric/Fabric.ts +13 -6
- package/src/fabric/FabricManager.ts +2 -2
- package/src/groups/FabricGroups.ts +5 -0
- package/src/groups/Groups.ts +12 -3
- package/src/groups/KeySets.ts +3 -3
- package/src/interaction/InteractionMessenger.ts +58 -20
- package/src/mdns/InterfaceResponder.ts +1031 -0
- package/src/mdns/MdnsServer.ts +400 -360
- package/src/mdns/MdnsService.ts +2 -0
- package/src/peer/AdministratorCommands.ts +37 -0
- package/src/peer/CommissioningConnection.ts +5 -1
- package/src/peer/ControllerCommissioner.ts +69 -19
- package/src/peer/ControllerCommissioningFlow.ts +149 -99
- package/src/peer/OperationalCertificateUpdate.ts +922 -0
- package/src/peer/Peer.ts +31 -16
- package/src/peer/PeerAddressStore.ts +119 -0
- package/src/peer/PeerConnection.ts +0 -1
- package/src/peer/PeerDescriptor.ts +3 -4
- package/src/peer/PeerExchangeProvider.ts +4 -6
- package/src/peer/PeerLossContext.ts +11 -2
- package/src/peer/PhysicalDeviceProperties.ts +25 -12
- package/src/peer/RebootResubscribeArmer.ts +37 -16
- package/src/peer/index.ts +2 -0
- package/src/protocol/DeviceAdvertiser.ts +5 -1
- package/src/protocol/ExchangeManager.ts +162 -88
- package/src/protocol/ExchangeProvider.ts +3 -2
- package/src/protocol/MessageExchange.ts +29 -7
- package/src/protocol/MessageReceptionState.ts +2 -2
- package/src/protocol/errors.ts +7 -1
- package/src/securechannel/SecureChannelMessenger.ts +26 -13
- package/src/session/GroupSession.ts +147 -111
- package/src/session/NodeSession.ts +89 -4
- package/src/session/SecureSession.ts +27 -1
- package/src/session/Session.ts +2 -2
- package/src/session/SessionManager.ts +429 -189
- package/src/session/UnsecuredSession.ts +9 -3
- package/src/session/case/CaseClient.ts +15 -10
- package/src/session/case/CaseServer.ts +41 -17
package/src/mdns/MdnsService.ts
CHANGED
|
@@ -54,6 +54,7 @@ export class MdnsService {
|
|
|
54
54
|
const vars = environment.get(VariableService);
|
|
55
55
|
this.#enableIpv4 = vars.boolean("mdns.ipv4") ?? options?.ipv4 ?? true;
|
|
56
56
|
this.limitedToNetInterface = vars.get("mdns.networkInterface", options?.networkInterface);
|
|
57
|
+
const logStatistics = vars.boolean("mdns.statistics") ?? false;
|
|
57
58
|
|
|
58
59
|
this.#construction = Construction(this, async () => {
|
|
59
60
|
try {
|
|
@@ -61,6 +62,7 @@ export class MdnsService {
|
|
|
61
62
|
lifetime: this.#construction,
|
|
62
63
|
enableIpv4: this.enableIpv4,
|
|
63
64
|
netInterface: this.limitedToNetInterface,
|
|
65
|
+
logStatistics,
|
|
64
66
|
});
|
|
65
67
|
} catch (cause) {
|
|
66
68
|
// Withdraw before rejecting so a retry constructs a new instance instead of awaiting this crashed one
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2026 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { ClientInteraction } from "#action/client/ClientInteraction.js";
|
|
8
|
+
import { ClientRequest } from "#action/client/ClientRequest.js";
|
|
9
|
+
import { Invoke } from "#action/request/Invoke.js";
|
|
10
|
+
import { InvokeResult } from "#action/response/InvokeResult.js";
|
|
11
|
+
import { ClusterType } from "@matter/types";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Helpers for the administrator commands that the commissioning flow and the operational certificate update send over
|
|
15
|
+
* a secure session they hold themselves.
|
|
16
|
+
*/
|
|
17
|
+
export namespace AdministratorCommands {
|
|
18
|
+
/**
|
|
19
|
+
* Invoke one command and return its response fields, or `undefined` for a command that answers with a status only.
|
|
20
|
+
*
|
|
21
|
+
* Throws the status error when the peer answers with a status other than success.
|
|
22
|
+
*
|
|
23
|
+
* TODO improve response typing
|
|
24
|
+
*
|
|
25
|
+
* @param transmission how the request reaches the peer, such as {@link ClientRequest.requireExistingSession}
|
|
26
|
+
*/
|
|
27
|
+
export async function invoke<const C extends ClusterType.Concrete>(
|
|
28
|
+
interaction: ClientInteraction,
|
|
29
|
+
request: Invoke.ConcreteCommandRequest<C>,
|
|
30
|
+
options: Omit<Invoke.Definition, "commands"> = {},
|
|
31
|
+
transmission?: ClientRequest,
|
|
32
|
+
) {
|
|
33
|
+
return InvokeResult.responseOfSingleCommand(
|
|
34
|
+
interaction.invoke({ ...Invoke({ commands: [request], ...options }), ...transmission }),
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { BleError } from "#ble/Ble.js";
|
|
7
8
|
import { CommissionableDevice } from "#common/Scanner.js";
|
|
8
9
|
import { CommissioningError, PairRetransmissionLimitReachedError } from "#peer/CommissioningError.js";
|
|
9
10
|
import { NodeSession } from "#session/NodeSession.js";
|
|
@@ -175,7 +176,9 @@ export async function CommissioningConnection(
|
|
|
175
176
|
asErr.message,
|
|
176
177
|
);
|
|
177
178
|
lastNonRetryableError = asErr;
|
|
178
|
-
} else if (
|
|
179
|
+
} else if (
|
|
180
|
+
causedBy(asErr, NoResponseTimeoutError, TransientPeerCommunicationError, NetworkError, BleError)
|
|
181
|
+
) {
|
|
179
182
|
lastError = asErr;
|
|
180
183
|
logger.warn(
|
|
181
184
|
`Address ${ServerAddress.urlFor(candidate.address)} unreachable for ${candidate.device.deviceIdentifier}`,
|
|
@@ -234,6 +237,7 @@ export async function CommissioningConnection(
|
|
|
234
237
|
if (lastError !== undefined) {
|
|
235
238
|
throw new PairRetransmissionLimitReachedError(
|
|
236
239
|
`Failed to connect on any discovered server: ${lastError.message}`,
|
|
240
|
+
{ cause: lastError },
|
|
237
241
|
);
|
|
238
242
|
}
|
|
239
243
|
throw new PairRetransmissionLimitReachedError("Failed to connect on any discovered server");
|
|
@@ -22,6 +22,7 @@ import { DedicatedChannelExchangeProvider } from "#protocol/ExchangeProvider.js"
|
|
|
22
22
|
import { ChannelStatusResponseError } from "#securechannel/SecureChannelMessenger.js";
|
|
23
23
|
import { NodeSession } from "#session/NodeSession.js";
|
|
24
24
|
import { PaseClient } from "#session/pase/PaseClient.js";
|
|
25
|
+
import { Session } from "#session/Session.js";
|
|
25
26
|
import { SessionManager } from "#session/SessionManager.js";
|
|
26
27
|
import { SessionParameters } from "#session/SessionParameters.js";
|
|
27
28
|
import {
|
|
@@ -49,6 +50,7 @@ import {
|
|
|
49
50
|
import { FabricIndex, NodeId, SECURE_CHANNEL_PROTOCOL_ID, SecureChannelStatusCode } from "@matter/types";
|
|
50
51
|
import { GeneralCommissioning } from "@matter/types/clusters/general-commissioning";
|
|
51
52
|
import { DclCertificateService } from "../dcl/DclCertificateService.js";
|
|
53
|
+
import { OperationalCertificateUpdate } from "./OperationalCertificateUpdate.js";
|
|
52
54
|
import { PeerAddress } from "./PeerAddress.js";
|
|
53
55
|
import { CommissioningTransitionError, PeerCommunicationError } from "./PeerCommunicationError.js";
|
|
54
56
|
import { PeerSet } from "./PeerSet.js";
|
|
@@ -249,6 +251,17 @@ export class ControllerCommissioner {
|
|
|
249
251
|
return instance;
|
|
250
252
|
}
|
|
251
253
|
|
|
254
|
+
/**
|
|
255
|
+
* Replace the operational certificate of a commissioned peer with one for a new key pair the peer generates.
|
|
256
|
+
*
|
|
257
|
+
* See {@link OperationalCertificateUpdate.update} for the sequence, failure handling and errors.
|
|
258
|
+
*
|
|
259
|
+
* @see {@link MatterSpecification.v161.Core} § 11.18.6.9
|
|
260
|
+
*/
|
|
261
|
+
async updateOperationalCertificate(options: OperationalCertificateUpdate.Options) {
|
|
262
|
+
return OperationalCertificateUpdate.update(this.#context, options);
|
|
263
|
+
}
|
|
264
|
+
|
|
252
265
|
/**
|
|
253
266
|
* Commission a previously discovered node.
|
|
254
267
|
*/
|
|
@@ -403,7 +416,7 @@ export class ControllerCommissioner {
|
|
|
403
416
|
options.retryFailureAsPeerCommunication !== undefined &&
|
|
404
417
|
causedBy(error, PairRetransmissionLimitReachedError)
|
|
405
418
|
) {
|
|
406
|
-
throw new PeerCommunicationError(options.retryFailureAsPeerCommunication);
|
|
419
|
+
throw new PeerCommunicationError(options.retryFailureAsPeerCommunication, { cause: error });
|
|
407
420
|
}
|
|
408
421
|
throw error;
|
|
409
422
|
}
|
|
@@ -466,16 +479,23 @@ export class ControllerCommissioner {
|
|
|
466
479
|
SECURE_CHANNEL_PROTOCOL_ID,
|
|
467
480
|
);
|
|
468
481
|
|
|
482
|
+
const unsecuredBleClose =
|
|
483
|
+
paseChannel instanceof BleChannel ? this.#closeOnBleLoss(unsecuredSession, paseChannel) : undefined;
|
|
484
|
+
|
|
485
|
+
let paseSession: NodeSession;
|
|
486
|
+
let paseBleClose: (() => Promise<void> | undefined) | undefined;
|
|
469
487
|
try {
|
|
470
|
-
|
|
488
|
+
paseSession = await this.#paseClient.pair(
|
|
471
489
|
this.#context.sessions.sessionParameters,
|
|
472
490
|
paseExchange,
|
|
473
491
|
paseChannel,
|
|
474
492
|
passcode,
|
|
475
493
|
{ abort: signal, suppressPeerLoss, onPbkdfParamResponse },
|
|
476
494
|
);
|
|
495
|
+
if (paseChannel instanceof BleChannel) {
|
|
496
|
+
paseBleClose = this.#closeOnBleLoss(paseSession, paseChannel);
|
|
497
|
+
}
|
|
477
498
|
await unsecuredSession.detachChannel()?.release();
|
|
478
|
-
return caseSession;
|
|
479
499
|
} catch (e) {
|
|
480
500
|
// Close the exchange and rethrow
|
|
481
501
|
if (causedBy(e, ChannelStatusResponseError)) {
|
|
@@ -485,10 +505,56 @@ export class ControllerCommissioner {
|
|
|
485
505
|
}
|
|
486
506
|
throw e;
|
|
487
507
|
} finally {
|
|
508
|
+
await unsecuredBleClose?.();
|
|
488
509
|
await unsecuredSession.initiateForceClose({
|
|
489
510
|
cause: new CommissioningTransitionError("PASE session has transitioned to CASE"),
|
|
490
511
|
});
|
|
491
512
|
}
|
|
513
|
+
|
|
514
|
+
// Keep after the last await: a session the BLE watch closed must not win the candidate race
|
|
515
|
+
const bleClosing = paseBleClose?.();
|
|
516
|
+
if (bleClosing !== undefined) {
|
|
517
|
+
await bleClosing;
|
|
518
|
+
throw new BleChannelClosedError(`BLE transport closed while PASE completed on ${paseSession.via}`);
|
|
519
|
+
}
|
|
520
|
+
return paseSession;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Force-closes `session` with a {@link BleChannelClosedError} once `channel` closes, so its pending exchanges reject
|
|
525
|
+
* at once instead of waiting out PASE response or MRP timeouts. A channel that already closed closes the session
|
|
526
|
+
* immediately. The watch ends when the session starts closing.
|
|
527
|
+
*
|
|
528
|
+
* {@link ControllerCommissioningFlow} treats the resulting `BleDisconnectedError` as a commissioning-channel
|
|
529
|
+
* drop, so a non-concurrent device that leaves BLE after ConnectNetwork continues over its operational network.
|
|
530
|
+
*
|
|
531
|
+
* @returns a function returning the force-close a channel loss started, or `undefined`; that promise never rejects
|
|
532
|
+
*/
|
|
533
|
+
#closeOnBleLoss(session: Session, channel: BleChannel) {
|
|
534
|
+
let forceClose: Promise<void> | undefined;
|
|
535
|
+
const stopWatching = () => {
|
|
536
|
+
channel.closed.off(onChannelClosed);
|
|
537
|
+
session.closing.off(onSessionClosing);
|
|
538
|
+
};
|
|
539
|
+
const onSessionClosing = (closing: boolean) => {
|
|
540
|
+
if (closing) {
|
|
541
|
+
stopWatching();
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
const onChannelClosed = () => {
|
|
545
|
+
stopWatching();
|
|
546
|
+
forceClose = session
|
|
547
|
+
.initiateForceClose({ cause: new BleChannelClosedError(`BLE transport closed on ${session.via}`) })
|
|
548
|
+
.catch(error => logger.warn(session.via, "Error while force-closing PASE session on BLE close", error));
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
if (channel.isClosed) {
|
|
552
|
+
onChannelClosed();
|
|
553
|
+
} else {
|
|
554
|
+
channel.closed.on(onChannelClosed);
|
|
555
|
+
session.closing.on(onSessionClosing);
|
|
556
|
+
}
|
|
557
|
+
return () => forceClose;
|
|
492
558
|
}
|
|
493
559
|
|
|
494
560
|
/** Validate if a Peer Address is already known and commissioned */
|
|
@@ -634,22 +700,6 @@ export class ControllerCommissioner {
|
|
|
634
700
|
logger.info(`Start commissioning of node ${address.toString()} into fabric ${fabric.fabricId}`);
|
|
635
701
|
const exchangeProvider = new DedicatedChannelExchangeProvider(this.#context.exchanges, ephemeralSession);
|
|
636
702
|
|
|
637
|
-
// BLE-only: BTP MRP retrans blocks pending invokes for ~45s when a non-concurrent device
|
|
638
|
-
// drops BLE after connectNetwork. Force-close on BLE-lost so the awaited invoke rejects
|
|
639
|
-
// immediately and the commissioning flow can flip to the non-concurrent CASE path.
|
|
640
|
-
if (!ephemeralSession.isClosed) {
|
|
641
|
-
const paseChannel = ephemeralSession.channel.transportChannel;
|
|
642
|
-
if (paseChannel instanceof BleChannel) {
|
|
643
|
-
paseChannel.closed.once(() => {
|
|
644
|
-
ephemeralSession
|
|
645
|
-
.initiateForceClose({
|
|
646
|
-
cause: new BleChannelClosedError(`BLE transport closed on ${ephemeralSession.via}`),
|
|
647
|
-
})
|
|
648
|
-
.catch(error => logger.warn("Error while force-closing PASE session on BLE close", error));
|
|
649
|
-
});
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
|
|
653
703
|
await using commissioner = new commissioningFlowImpl(
|
|
654
704
|
new ClientInteraction({
|
|
655
705
|
environment: this.#context.environment,
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
import { ClientInteraction } from "#action/client/ClientInteraction.js";
|
|
8
8
|
import { ClientRead } from "#action/client/ClientRead.js";
|
|
9
|
+
import { ClientRequest } from "#action/client/ClientRequest.js";
|
|
9
10
|
import { WriteResult } from "#action/index.js";
|
|
10
11
|
import { Invoke } from "#action/request/Invoke.js";
|
|
11
12
|
import { Read } from "#action/request/Read.js";
|
|
12
13
|
import { Write } from "#action/request/Write.js";
|
|
13
|
-
import { ResultStatus } from "#action/response/ResultStatus.js";
|
|
14
14
|
import { BleDisconnectedError } from "#ble/Ble.js";
|
|
15
|
-
import {
|
|
15
|
+
import { NocsrValidator } from "#certificate/NocsrValidator.js";
|
|
16
16
|
import { PeerMessageMissingError, PeerUnresponsiveError } from "#peer/PeerCommunicationError.js";
|
|
17
17
|
import { OperationalDataset } from "#thread/OperationalDataset.js";
|
|
18
18
|
import {
|
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
ChannelType,
|
|
24
24
|
Diagnostic,
|
|
25
25
|
Duration,
|
|
26
|
-
EcdsaSignature,
|
|
27
26
|
ImplementationError,
|
|
28
27
|
Instant,
|
|
29
28
|
Logger,
|
|
@@ -37,7 +36,7 @@ import {
|
|
|
37
36
|
Timer,
|
|
38
37
|
Timespan,
|
|
39
38
|
Timestamp,
|
|
40
|
-
|
|
39
|
+
InternalError,
|
|
41
40
|
} from "@matter/general";
|
|
42
41
|
import {
|
|
43
42
|
ClusterId,
|
|
@@ -46,7 +45,6 @@ import {
|
|
|
46
45
|
FabricIndex,
|
|
47
46
|
Global,
|
|
48
47
|
NodeId,
|
|
49
|
-
Status,
|
|
50
48
|
StatusResponseError,
|
|
51
49
|
VendorId,
|
|
52
50
|
} from "@matter/types";
|
|
@@ -65,9 +63,9 @@ import {
|
|
|
65
63
|
DeviceAttestationValidator,
|
|
66
64
|
} from "../certificate/DeviceAttestationValidator.js";
|
|
67
65
|
import { Dac } from "../certificate/kinds/AttestationCertificates.js";
|
|
68
|
-
import { TlvCertSigningRequest } from "../common/OperationalCredentialsTypes.js";
|
|
69
66
|
import { DclCertificateService } from "../dcl/DclCertificateService.js";
|
|
70
67
|
import { Fabric } from "../fabric/Fabric.js";
|
|
68
|
+
import { AdministratorCommands } from "./AdministratorCommands.js";
|
|
71
69
|
import { CommissioningError } from "./CommissioningError.js";
|
|
72
70
|
import { PeerAddress } from "./PeerAddress.js";
|
|
73
71
|
|
|
@@ -139,13 +137,13 @@ export type ControllerCommissioningFlowOptions = {
|
|
|
139
137
|
* - throw any error to reject by rethrowing that error verbatim (no wrapping)
|
|
140
138
|
* - `undefined`: accept with warning logging (backward compatibility)
|
|
141
139
|
*
|
|
142
|
-
* The callback receives
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
140
|
+
* The callback receives the findings collected during validation: warning/info-level findings
|
|
141
|
+
* (e.g. provisional CD, test CD, no revocation data) and the recoverable error-level findings
|
|
142
|
+
* `TrustedAsTestCertificate` and `CertificationDeclarationFieldMismatch` for the BasicInformation
|
|
143
|
+
* VendorID and ProductID, which the commissioner must decide on like a hard failure. When a hard
|
|
144
|
+
* failure (invalid chain, bad signature, revoked certificate, untrusted PAA, DCL service
|
|
145
|
+
* unavailable) stops validation, its error-level finding comes last, after the findings collected
|
|
146
|
+
* until then.
|
|
149
147
|
*
|
|
150
148
|
* TODO: Make required in next breaking version and remove undefined backward-compatible accept
|
|
151
149
|
*/
|
|
@@ -329,6 +327,7 @@ export class ControllerCommissioningFlow {
|
|
|
329
327
|
protected collectedCommissioningData: CollectedCommissioningData = {};
|
|
330
328
|
#defaultFailSafeTime = DEFAULT_FAILSAFE_TIME;
|
|
331
329
|
#armFailsafeInterval?: Timer;
|
|
330
|
+
#periodicArm?: Promise<unknown>;
|
|
332
331
|
|
|
333
332
|
constructor(
|
|
334
333
|
/** ClientInteraction for the initiated PASE session */
|
|
@@ -354,7 +353,7 @@ export class ControllerCommissioningFlow {
|
|
|
354
353
|
this.fabric = fabric;
|
|
355
354
|
this.transitionToCase = transitionToCase;
|
|
356
355
|
this.commissioningOptions = commissioningOptions;
|
|
357
|
-
logger.debug(
|
|
356
|
+
logger.debug("Commissioning options", Diagnostic.dict(loggedOptionsOf(commissioningOptions)));
|
|
358
357
|
this.#initializeCommissioningSteps();
|
|
359
358
|
}
|
|
360
359
|
|
|
@@ -434,35 +433,25 @@ export class ControllerCommissioningFlow {
|
|
|
434
433
|
Diagnostic.errorMessage(error),
|
|
435
434
|
Diagnostic.weak("(continuing commissioning)"),
|
|
436
435
|
);
|
|
437
|
-
|
|
438
|
-
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
const isCommissioningFailure = causedBy(error, CommissioningError, StatusResponseError);
|
|
440
|
+
if (isCommissioningFailure) {
|
|
441
|
+
logger.warn(
|
|
439
442
|
`Commissioning step ${step.stepNumber}.${step.subStepNumber}: ${step.name} failed with error:`,
|
|
440
443
|
Diagnostic.errorMessage(error),
|
|
441
444
|
Diagnostic.weak("(terminating commissioning)"),
|
|
442
445
|
);
|
|
443
|
-
|
|
444
|
-
// SHALL result in the Commissioner and Commissionee returning to step 2 (device discovery and
|
|
445
|
-
// commissioning channel establishment) and repeating each step. The failure of any of the steps
|
|
446
|
-
// 11 through 15 in concurrent connection commissioning flow SHALL result in the Commissioner and
|
|
447
|
-
// Commissionee returning to step 11 (configuration of operational network information). In the
|
|
448
|
-
// case of failure of any of the steps 11 through 15 in concurrent connection commissioning flow,
|
|
449
|
-
// the Commissioner and Commissionee SHALL reuse the existing PASE-derived encryption keys over
|
|
450
|
-
// the commissioning channel and all steps up to and including step 10 are considered to have
|
|
451
|
-
// been successfully completed.
|
|
452
|
-
|
|
453
|
-
// Commissioners that need to restart from step 2 MAY immediately expire the fail-safe by invoking
|
|
454
|
-
// the ArmFailSafe command with an ExpiryLengthSeconds field set to 0. Otherwise, Commissioners
|
|
455
|
-
// will need to wait until the current fail-safe timer has expired for the Commissionee to begin
|
|
456
|
-
// accepting PASE again.
|
|
457
|
-
await this.#resetFailsafeTimer();
|
|
446
|
+
}
|
|
458
447
|
|
|
459
|
-
|
|
448
|
+
await this.#expireFailsafe(error);
|
|
460
449
|
|
|
461
|
-
|
|
450
|
+
if (isCommissioningFailure) {
|
|
451
|
+
StatusResponseError.accept(error);
|
|
462
452
|
throw repackErrorAs(error, CommissioningError);
|
|
463
|
-
} else {
|
|
464
|
-
throw error;
|
|
465
453
|
}
|
|
454
|
+
throw error;
|
|
466
455
|
}
|
|
467
456
|
}
|
|
468
457
|
}
|
|
@@ -485,6 +474,10 @@ export class ControllerCommissioningFlow {
|
|
|
485
474
|
}
|
|
486
475
|
for await (const data of this.interaction.read(request)) {
|
|
487
476
|
for await (const entry of data) {
|
|
477
|
+
if (entry.kind === "attr-status") {
|
|
478
|
+
logger.debug("Commissioning read returned status", entry.status, "for", entry.path);
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
488
481
|
if (entry.kind !== "attr-value") {
|
|
489
482
|
continue;
|
|
490
483
|
}
|
|
@@ -502,31 +495,16 @@ export class ControllerCommissioningFlow {
|
|
|
502
495
|
return [...attributeMap.values()];
|
|
503
496
|
}
|
|
504
497
|
|
|
505
|
-
|
|
498
|
+
/**
|
|
499
|
+
* Invoke one command and return the fields of its response, or nothing for a status response. The fields are
|
|
500
|
+
* decoded but not checked against the response schema, so a mandatory field the device left out is `undefined`.
|
|
501
|
+
*/
|
|
506
502
|
async #invokeCommand<const C extends ClusterType.Concrete>(
|
|
507
503
|
request: Invoke.ConcreteCommandRequest<C>,
|
|
508
504
|
options: Omit<Invoke.Definition, "commands"> = {},
|
|
505
|
+
transmission?: ClientRequest,
|
|
509
506
|
) {
|
|
510
|
-
|
|
511
|
-
Invoke({
|
|
512
|
-
commands: [request],
|
|
513
|
-
...options,
|
|
514
|
-
}),
|
|
515
|
-
)) {
|
|
516
|
-
for (const entry of data) {
|
|
517
|
-
// We send only one command, so we only get one response back
|
|
518
|
-
switch (entry.kind) {
|
|
519
|
-
case "cmd-status":
|
|
520
|
-
if (entry.status !== Status.Success) {
|
|
521
|
-
throw ResultStatus.errorOf(entry);
|
|
522
|
-
}
|
|
523
|
-
return;
|
|
524
|
-
|
|
525
|
-
case "cmd-response":
|
|
526
|
-
return entry.data;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
}
|
|
507
|
+
return AdministratorCommands.invoke(this.interaction, request, options, transmission);
|
|
530
508
|
}
|
|
531
509
|
|
|
532
510
|
/**
|
|
@@ -795,6 +773,10 @@ export class ControllerCommissioningFlow {
|
|
|
795
773
|
|
|
796
774
|
for await (const data of networkData) {
|
|
797
775
|
for await (const entry of data) {
|
|
776
|
+
if (entry.kind === "attr-status") {
|
|
777
|
+
logger.debug("Commissioning read returned status", entry.status, "for", entry.path);
|
|
778
|
+
continue;
|
|
779
|
+
}
|
|
798
780
|
if (entry.kind !== "attr-value") {
|
|
799
781
|
continue;
|
|
800
782
|
}
|
|
@@ -937,13 +919,13 @@ export class ControllerCommissioningFlow {
|
|
|
937
919
|
logger.debug(
|
|
938
920
|
`Re-Arm Failsafe Timer during longer actions with device. Time left: ${Duration.format(Timespan(now, this.#commissioningExpiryTime).duration)}`,
|
|
939
921
|
);
|
|
940
|
-
this.#
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
);
|
|
922
|
+
this.#periodicArm = this.#armFailsafe(
|
|
923
|
+
Duration.max(this.#defaultFailSafeTime, this.#failSafeTimeLeft),
|
|
924
|
+
).catch(error => {
|
|
925
|
+
logger.warn("Error while re-arming failsafe during reconnect", error);
|
|
926
|
+
this.#armFailsafeInterval?.stop();
|
|
927
|
+
this.#armFailsafeInterval = undefined;
|
|
928
|
+
});
|
|
947
929
|
} else {
|
|
948
930
|
// Stop as soon as we are over the maximum commissioning time
|
|
949
931
|
this.#armFailsafeInterval?.stop();
|
|
@@ -1011,6 +993,15 @@ export class ControllerCommissioningFlow {
|
|
|
1011
993
|
);
|
|
1012
994
|
}
|
|
1013
995
|
|
|
996
|
+
/**
|
|
997
|
+
* Whether {@link failure} reports that the device stopped answering on the channel commissioning runs on, so a
|
|
998
|
+
* further command would only wait for its own timeout. A failed operational reconnect does not count: it reports
|
|
999
|
+
* that CASE could not be established, while the commissioning channel may still work.
|
|
1000
|
+
*/
|
|
1001
|
+
#deviceStoppedResponding(failure: Error) {
|
|
1002
|
+
return !(failure instanceof OperativeConnectionFailedError) && this.#isCommissioningChannelDrop(failure);
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1014
1005
|
/**
|
|
1015
1006
|
* Respond to a commissioning-channel drop by treating the device as non-concurrent: stop the
|
|
1016
1007
|
* periodic failsafe re-arm timer (BLE is gone anyway) and flip the flag so `#reconnectWithDevice`
|
|
@@ -1089,21 +1080,54 @@ export class ControllerCommissioningFlow {
|
|
|
1089
1080
|
return { transportFailure: false, networkingStatus, debugText };
|
|
1090
1081
|
}
|
|
1091
1082
|
|
|
1092
|
-
|
|
1083
|
+
/**
|
|
1084
|
+
* End the device's fail-safe after commissioning failed, so the device accepts a new PASE session right away.
|
|
1085
|
+
* Commissioning does not resume after a failure, so it always restarts from initial phase step 2, and the spec
|
|
1086
|
+
* allows this: "Commissioners that need to restart from initial phase step 2 MAY immediately expire the fail-safe
|
|
1087
|
+
* by invoking the ArmFailSafe command with an ExpiryLengthSeconds field set to 0."
|
|
1088
|
+
*
|
|
1089
|
+
* Stops the periodic re-arm, so it cannot arm the fail-safe again. Sends nothing when the device stopped
|
|
1090
|
+
* responding (see {@link #deviceStoppedResponding}). Otherwise it waits for a re-arm already sent, then sends over
|
|
1091
|
+
* the PASE session, or after the operational reconnect only over a session that exists now, so a device that
|
|
1092
|
+
* dropped the session is not reconnected only to end its fail-safe. A failure only logs: the device ends the
|
|
1093
|
+
* fail-safe itself when it expires.
|
|
1094
|
+
*
|
|
1095
|
+
* @see {@link MatterSpecification.v161.Core} § 5.5.1
|
|
1096
|
+
*/
|
|
1097
|
+
async #expireFailsafe(failure: Error) {
|
|
1098
|
+
this.#armFailsafeInterval?.stop();
|
|
1099
|
+
this.#armFailsafeInterval = undefined;
|
|
1100
|
+
|
|
1093
1101
|
if (this.#currentFailSafeEndTime === undefined) return;
|
|
1102
|
+
if (this.#deviceStoppedResponding(failure)) {
|
|
1103
|
+
logger.debug("Device stopped responding, leaving the failsafe to expire");
|
|
1104
|
+
return;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
await this.#periodicArm;
|
|
1094
1108
|
try {
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1109
|
+
this.#ensureGeneralCommissioningSuccess(
|
|
1110
|
+
"armFailSafe",
|
|
1111
|
+
await this.#invokeCommand(
|
|
1112
|
+
{
|
|
1113
|
+
endpoint: RootEndpointNumber,
|
|
1114
|
+
cluster: GeneralCommissioning,
|
|
1115
|
+
command: "armFailSafe",
|
|
1116
|
+
fields: {
|
|
1117
|
+
breadcrumb: this.lastBreadcrumb,
|
|
1118
|
+
expiryLengthSeconds: 0,
|
|
1119
|
+
},
|
|
1120
|
+
},
|
|
1121
|
+
{},
|
|
1122
|
+
{ requireExistingSession: true },
|
|
1123
|
+
),
|
|
1124
|
+
);
|
|
1125
|
+
this.#currentFailSafeEndTime = undefined;
|
|
1105
1126
|
} catch (error) {
|
|
1106
|
-
logger.
|
|
1127
|
+
logger.info(
|
|
1128
|
+
"Could not end the failsafe, the device stays in commissioning until its failsafe expires:",
|
|
1129
|
+
Diagnostic.errorMessage(asError(error)),
|
|
1130
|
+
);
|
|
1107
1131
|
}
|
|
1108
1132
|
}
|
|
1109
1133
|
|
|
@@ -1292,8 +1316,8 @@ export class ControllerCommissioningFlow {
|
|
|
1292
1316
|
attestationElements,
|
|
1293
1317
|
attestationSignature,
|
|
1294
1318
|
attestationNonce,
|
|
1295
|
-
vendorId: this.collectedCommissioningData.vendorId
|
|
1296
|
-
productId: this.collectedCommissioningData.productId
|
|
1319
|
+
vendorId: this.collectedCommissioningData.vendorId,
|
|
1320
|
+
productId: this.collectedCommissioningData.productId,
|
|
1297
1321
|
},
|
|
1298
1322
|
);
|
|
1299
1323
|
findings = result.findings;
|
|
@@ -1306,7 +1330,10 @@ export class ControllerCommissioningFlow {
|
|
|
1306
1330
|
}
|
|
1307
1331
|
baseError = asError(error);
|
|
1308
1332
|
if (error instanceof DeviceAttestationError) {
|
|
1309
|
-
findings = [
|
|
1333
|
+
findings = [
|
|
1334
|
+
...error.precedingFindings,
|
|
1335
|
+
{ level: "error", type: error.failure, message: error.message },
|
|
1336
|
+
];
|
|
1310
1337
|
} else {
|
|
1311
1338
|
// Unexpected validation error (e.g. an unrecoverably corrupt trust-store certificate).
|
|
1312
1339
|
// Surface it as an error finding so the onFailure policy can still judge it, instead of
|
|
@@ -1320,8 +1347,11 @@ export class ControllerCommissioningFlow {
|
|
|
1320
1347
|
if (findings.length > 0) {
|
|
1321
1348
|
const decision = await this.#resolveAttestationFindings(findings);
|
|
1322
1349
|
if (!decision.proceed) {
|
|
1350
|
+
const errorMessages = findings.filter(({ level }) => level === "error").map(({ message }) => message);
|
|
1323
1351
|
baseError ??= new CommissioningError(
|
|
1324
|
-
|
|
1352
|
+
errorMessages.length
|
|
1353
|
+
? `Device attestation rejected by policy: ${errorMessages.join("; ")}`
|
|
1354
|
+
: `Device attestation produced ${findings.length} finding(s) and was rejected by policy`,
|
|
1325
1355
|
);
|
|
1326
1356
|
if (decision.reason !== undefined) {
|
|
1327
1357
|
throw new CommissioningError(decision.reason, { cause: baseError });
|
|
@@ -1336,7 +1366,10 @@ export class ControllerCommissioningFlow {
|
|
|
1336
1366
|
if (dacPublicKey === undefined) {
|
|
1337
1367
|
// Attestation failed but policy accepted it, so the key the validator would have returned is missing
|
|
1338
1368
|
try {
|
|
1339
|
-
dacPublicKey = PublicKey(
|
|
1369
|
+
dacPublicKey = PublicKey(
|
|
1370
|
+
Dac.fromAsn1(deviceAttestation, { acceptProfileViolation: true, acceptMalformedVidPid: true }).cert
|
|
1371
|
+
.ellipticCurvePublicKey,
|
|
1372
|
+
);
|
|
1340
1373
|
} catch (cause) {
|
|
1341
1374
|
throw new CommissioningError(
|
|
1342
1375
|
"Device attestation was accepted but the DAC cannot be parsed, so the CSR signature cannot be verified",
|
|
@@ -1401,37 +1434,31 @@ export class ControllerCommissioningFlow {
|
|
|
1401
1434
|
* DCL contains the name and other information of the Commissioner’s manufacturer.
|
|
1402
1435
|
*/
|
|
1403
1436
|
async #certificates() {
|
|
1437
|
+
const csrNonce = this.fabric.crypto.randomBytes(32);
|
|
1404
1438
|
const { nocsrElements, attestationSignature: csrSignature } = await this.#invokeCommand(
|
|
1405
1439
|
{
|
|
1406
1440
|
endpoint: RootEndpointNumber,
|
|
1407
1441
|
cluster: OperationalCredentials,
|
|
1408
1442
|
command: "csrRequest",
|
|
1409
|
-
fields: { csrNonce
|
|
1443
|
+
fields: { csrNonce },
|
|
1410
1444
|
},
|
|
1411
1445
|
{
|
|
1412
1446
|
useExtendedFailSafeMessageResponseTimeout: true,
|
|
1413
1447
|
},
|
|
1414
1448
|
);
|
|
1415
1449
|
|
|
1416
|
-
if (
|
|
1417
|
-
throw new
|
|
1450
|
+
if (this.#dacPublicKey === undefined) {
|
|
1451
|
+
throw new InternalError("CSRResponse received before the device attestation step set the DAC public key");
|
|
1418
1452
|
}
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
} catch {
|
|
1429
|
-
throw new CommissioningError("CSR signature verification failed against DAC public key");
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
|
|
1433
|
-
const { certSigningRequest } = TlvCertSigningRequest.decode(nocsrElements);
|
|
1434
|
-
const operationalPublicKey = await Certificate.getPublicKeyFromCsr(this.ca.crypto, certSigningRequest);
|
|
1453
|
+
const operationalPublicKey = await NocsrValidator.validate(
|
|
1454
|
+
{
|
|
1455
|
+
crypto: this.fabric.crypto,
|
|
1456
|
+
attestationChallenge: this.commissioningOptions.attestation.challengeKey,
|
|
1457
|
+
csrNonce,
|
|
1458
|
+
dacPublicKey: this.#dacPublicKey,
|
|
1459
|
+
},
|
|
1460
|
+
{ nocsrElements, attestationSignature: csrSignature },
|
|
1461
|
+
);
|
|
1435
1462
|
|
|
1436
1463
|
await this.#invokeCommand(
|
|
1437
1464
|
{
|
|
@@ -2154,3 +2181,26 @@ export class ControllerCommissioningFlow {
|
|
|
2154
2181
|
this.#armFailsafeInterval?.stop();
|
|
2155
2182
|
}
|
|
2156
2183
|
}
|
|
2184
|
+
|
|
2185
|
+
/**
|
|
2186
|
+
* The fields of {@link options} that hold no secret, for logging. The options the caller passes may carry more, such as
|
|
2187
|
+
* the fabric with its identity protection key or the passcode.
|
|
2188
|
+
*/
|
|
2189
|
+
function loggedOptionsOf(options: ControllerCommissioningFlowOptions) {
|
|
2190
|
+
const {
|
|
2191
|
+
regulatoryLocation,
|
|
2192
|
+
regulatoryCountryCode,
|
|
2193
|
+
adminVendorId,
|
|
2194
|
+
wifiNetwork,
|
|
2195
|
+
threadNetwork,
|
|
2196
|
+
otaUpdateProviderLocation,
|
|
2197
|
+
} = options;
|
|
2198
|
+
return {
|
|
2199
|
+
regulatoryLocation,
|
|
2200
|
+
regulatoryCountryCode,
|
|
2201
|
+
adminVendorId,
|
|
2202
|
+
wifiSsid: wifiNetwork?.wifiSsid,
|
|
2203
|
+
threadNetwork: threadNetwork && (threadNetwork.networkName ?? "(dataset only)"),
|
|
2204
|
+
otaUpdateProviderLocation,
|
|
2205
|
+
};
|
|
2206
|
+
}
|