@matter/protocol 0.18.0 → 0.18.1-alpha.0-20261111-b89790712
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 +19 -20
- 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/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/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 +53 -7
- package/dist/cjs/certificate/DeviceAttestationValidator.d.ts.map +1 -1
- package/dist/cjs/certificate/DeviceAttestationValidator.js +114 -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/index.d.ts +1 -0
- package/dist/cjs/certificate/index.d.ts.map +1 -1
- package/dist/cjs/certificate/index.js +1 -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/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/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/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.map +1 -1
- package/dist/cjs/peer/ControllerCommissioner.js +48 -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 +109 -32
- package/dist/cjs/peer/ControllerCommissioningFlow.js.map +1 -1
- 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 +1 -0
- package/dist/cjs/peer/index.d.ts.map +1 -1
- package/dist/cjs/peer/index.js +1 -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 +16 -6
- 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 +19 -20
- 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/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/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 +53 -7
- package/dist/esm/certificate/DeviceAttestationValidator.d.ts.map +1 -1
- package/dist/esm/certificate/DeviceAttestationValidator.js +115 -43
- 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/index.d.ts +1 -0
- package/dist/esm/certificate/index.d.ts.map +1 -1
- package/dist/esm/certificate/index.js +1 -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/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/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/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.map +1 -1
- package/dist/esm/peer/ControllerCommissioner.js +48 -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 +109 -32
- package/dist/esm/peer/ControllerCommissioningFlow.js.map +1 -1
- 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 +1 -0
- package/dist/esm/peer/index.d.ts.map +1 -1
- package/dist/esm/peer/index.js +1 -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 +16 -6
- 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 +19 -21
- package/src/action/client/ClientRequest.ts +15 -0
- package/src/action/client/InputChunk.ts +57 -2
- 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/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 +202 -54
- package/src/certificate/DeviceCertification.ts +6 -2
- package/src/certificate/index.ts +1 -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/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/mdns/InterfaceResponder.ts +1031 -0
- package/src/mdns/MdnsServer.ts +400 -360
- package/src/peer/CommissioningConnection.ts +5 -1
- package/src/peer/ControllerCommissioner.ts +57 -19
- package/src/peer/ControllerCommissioningFlow.ts +132 -56
- 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 +1 -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 +22 -6
- 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
|
@@ -19,11 +19,16 @@ import { MATTER_EPOCH_OFFSET_S, VendorId } from "@matter/types";
|
|
|
19
19
|
import { TlvAttestation } from "../common/OperationalCredentialsTypes.js";
|
|
20
20
|
import { DclCertificateService } from "../dcl/DclCertificateService.js";
|
|
21
21
|
import { CommissioningError } from "../peer/CommissioningError.js";
|
|
22
|
+
import { CdSigners } from "./CdSigners.js";
|
|
22
23
|
import { Dac, Paa, Pai } from "./kinds/AttestationCertificates.js";
|
|
24
|
+
import { CertificateProfileError } from "./kinds/Certificate.js";
|
|
23
25
|
import { mayIssue } from "./kinds/CertificateSignature.js";
|
|
24
|
-
import { CertificationDeclaration } from "./kinds/CertificationDeclaration.js";
|
|
26
|
+
import { CertificationDeclaration, CertificationDeclarationFormatError } from "./kinds/CertificationDeclaration.js";
|
|
25
27
|
import { CertificationType } from "./kinds/definitions/certification-declaration.js";
|
|
26
28
|
|
|
29
|
+
/** @see {@link MatterSpecification.v161.Core} § 6.3.1 */
|
|
30
|
+
const CD_FORMAT_VERSION = 1;
|
|
31
|
+
|
|
27
32
|
/** Reasons a device attestation validation can fail or produce warnings. */
|
|
28
33
|
export enum DeviceAttestationCheck {
|
|
29
34
|
PaaNotTrusted = "PaaNotTrusted",
|
|
@@ -33,6 +38,13 @@ export enum DeviceAttestationCheck {
|
|
|
33
38
|
AttestationSignatureInvalid = "AttestationSignatureInvalid",
|
|
34
39
|
AttestationNonceMismatch = "AttestationNonceMismatch",
|
|
35
40
|
CertificationDeclarationSignatureInvalid = "CertificationDeclarationSignatureInvalid",
|
|
41
|
+
/**
|
|
42
|
+
* A Certification Declaration field does not match the device. Collected as a recoverable error for the
|
|
43
|
+
* BasicInformation VendorID and ProductID, which the device reports about itself, also when it did not report them;
|
|
44
|
+
* thrown for a mismatch with the DAC or PAI.
|
|
45
|
+
*
|
|
46
|
+
* @see {@link MatterSpecification.v161.Core} § 6.2.3.1
|
|
47
|
+
*/
|
|
36
48
|
CertificationDeclarationFieldMismatch = "CertificationDeclarationFieldMismatch",
|
|
37
49
|
CertificateRevoked = "CertificateRevoked",
|
|
38
50
|
FirmwareInfoMismatch = "FirmwareInfoMismatch",
|
|
@@ -40,11 +52,47 @@ export enum DeviceAttestationCheck {
|
|
|
40
52
|
CertificationTypeTest = "CertificationTypeTest",
|
|
41
53
|
CertificateIdNotVerified = "CertificateIdNotVerified",
|
|
42
54
|
CertificateUnparseable = "CertificateUnparseable",
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The DAC parses but violates the DAC certificate profile.
|
|
58
|
+
*
|
|
59
|
+
* @see {@link MatterSpecification.v161.Core} § 6.2.2.3
|
|
60
|
+
*/
|
|
61
|
+
DacFormatInvalid = "DacFormatInvalid",
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The PAI parses but violates the PAI certificate profile.
|
|
65
|
+
*
|
|
66
|
+
* @see {@link MatterSpecification.v161.Core} § 6.2.2.4
|
|
67
|
+
*/
|
|
68
|
+
PaiFormatInvalid = "PaiFormatInvalid",
|
|
69
|
+
|
|
43
70
|
AttestationElementsUnparseable = "AttestationElementsUnparseable",
|
|
44
71
|
CertificationDeclarationUnparseable = "CertificationDeclarationUnparseable",
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The CD breaks an encoding rule of § 6.3.1, such as its CMS envelope or `format_version`, or has a reserved
|
|
75
|
+
* `certification_type`, which CHIP refuses.
|
|
76
|
+
*/
|
|
77
|
+
CertificationDeclarationFormatInvalid = "CertificationDeclarationFormatInvalid",
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The CD's signer is not known to be a CD signer: neither a built-in CSA key, the Matter test CD signer, nor a
|
|
81
|
+
* CSA-issued certificate from the DCL, the store or a seed. See {@link DclCertificateService.lookupCdSigner}.
|
|
82
|
+
*/
|
|
83
|
+
CdSignerUnknown = "CdSignerUnknown",
|
|
84
|
+
|
|
85
|
+
/** A CD of certification_type official is signed by the Matter test CD signer. */
|
|
86
|
+
OfficialCdSignedByTestSigner = "OfficialCdSignedByTestSigner",
|
|
87
|
+
|
|
88
|
+
/** @deprecated The CD signature is always verified; a CD from an unknown signer fails with {@link CdSignerUnknown}. */
|
|
45
89
|
CdSignerVerificationSkipped = "CdSignerVerificationSkipped",
|
|
46
90
|
PaaTrustStoreTimeMismatch = "PaaTrustStoreTimeMismatch",
|
|
47
91
|
DclServiceUnavailable = "DclServiceUnavailable",
|
|
92
|
+
/**
|
|
93
|
+
* A test PAA or the Matter test CD signer while the trust policy does not accept test certificates. Collected as a
|
|
94
|
+
* recoverable error so the policy decides.
|
|
95
|
+
*/
|
|
48
96
|
TrustedAsTestCertificate = "TrustedAsTestCertificate",
|
|
49
97
|
|
|
50
98
|
/** An unexpected error during validation (e.g. an unrecoverably corrupt trust-store certificate). */
|
|
@@ -65,6 +113,12 @@ export interface AttestationFinding {
|
|
|
65
113
|
|
|
66
114
|
/** Error thrown when device attestation validation encounters a hard failure. */
|
|
67
115
|
export class DeviceAttestationError extends CommissioningError {
|
|
116
|
+
/**
|
|
117
|
+
* Findings {@link DeviceAttestationValidator.validate} collected before this failure stopped validation, so a
|
|
118
|
+
* policy can see them next to the failure.
|
|
119
|
+
*/
|
|
120
|
+
readonly precedingFindings = new Array<AttestationFinding>();
|
|
121
|
+
|
|
68
122
|
constructor(
|
|
69
123
|
readonly failure: DeviceAttestationCheck,
|
|
70
124
|
message: string,
|
|
@@ -82,16 +136,48 @@ function parsePeerValue<T>(check: DeviceAttestationCheck, description: string, p
|
|
|
82
136
|
try {
|
|
83
137
|
return parse();
|
|
84
138
|
} catch (cause) {
|
|
85
|
-
// A defect of ours is not the peer's malformed data and
|
|
86
|
-
if (
|
|
139
|
+
// A defect of ours is not the peer's malformed data, and a classified failure keeps its check
|
|
140
|
+
if (
|
|
141
|
+
cause instanceof InternalError ||
|
|
142
|
+
cause instanceof ImplementationError ||
|
|
143
|
+
cause instanceof DeviceAttestationError
|
|
144
|
+
) {
|
|
87
145
|
throw cause;
|
|
88
146
|
}
|
|
89
147
|
throw new DeviceAttestationError(check, `${description}: ${asError(cause).message}`, { cause });
|
|
90
148
|
}
|
|
91
149
|
}
|
|
92
150
|
|
|
93
|
-
/** Parse
|
|
94
|
-
function
|
|
151
|
+
/** Parse the CD the peer supplied, reporting a broken encoding rule apart from a CD that cannot be decoded. */
|
|
152
|
+
function parsePeerCertificationDeclaration(declaration: Bytes) {
|
|
153
|
+
return parsePeerValue(
|
|
154
|
+
DeviceAttestationCheck.CertificationDeclarationUnparseable,
|
|
155
|
+
"Device returned a Certification Declaration that cannot be parsed",
|
|
156
|
+
() => {
|
|
157
|
+
try {
|
|
158
|
+
return CertificationDeclaration.parse(declaration);
|
|
159
|
+
} catch (cause) {
|
|
160
|
+
if (cause instanceof CertificationDeclarationFormatError) {
|
|
161
|
+
throw new DeviceAttestationError(
|
|
162
|
+
DeviceAttestationCheck.CertificationDeclarationFormatInvalid,
|
|
163
|
+
`Certification Declaration breaks an encoding rule: ${cause.message}`,
|
|
164
|
+
{ cause },
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
throw cause;
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Parse an attestation certificate the peer supplied, rejecting a missing certificate before the decoder sees it.
|
|
175
|
+
*
|
|
176
|
+
* A certificate that parses but violates its profile is reported as {@link DeviceAttestationCheck.DacFormatInvalid} or
|
|
177
|
+
* {@link DeviceAttestationCheck.PaiFormatInvalid}, anything else that fails as
|
|
178
|
+
* {@link DeviceAttestationCheck.CertificateUnparseable}.
|
|
179
|
+
*/
|
|
180
|
+
function parsePeerCertificate<T>(kind: "DAC" | "PAI", der: Bytes, parse: (der: Bytes) => T): T {
|
|
95
181
|
if (Bytes.of(der).byteLength === 0) {
|
|
96
182
|
throw new DeviceAttestationError(
|
|
97
183
|
DeviceAttestationCheck.CertificateUnparseable,
|
|
@@ -101,7 +187,22 @@ function parsePeerCertificate<T>(kind: string, der: Bytes, parse: (der: Bytes) =
|
|
|
101
187
|
return parsePeerValue(
|
|
102
188
|
DeviceAttestationCheck.CertificateUnparseable,
|
|
103
189
|
`Device returned a ${kind} certificate that cannot be parsed`,
|
|
104
|
-
() =>
|
|
190
|
+
() => {
|
|
191
|
+
try {
|
|
192
|
+
return parse(der);
|
|
193
|
+
} catch (cause) {
|
|
194
|
+
if (cause instanceof CertificateProfileError) {
|
|
195
|
+
throw new DeviceAttestationError(
|
|
196
|
+
kind === "DAC"
|
|
197
|
+
? DeviceAttestationCheck.DacFormatInvalid
|
|
198
|
+
: DeviceAttestationCheck.PaiFormatInvalid,
|
|
199
|
+
`Device returned a ${kind} certificate that violates the ${kind} profile: ${cause.message}`,
|
|
200
|
+
{ cause },
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
throw cause;
|
|
204
|
+
}
|
|
205
|
+
},
|
|
105
206
|
);
|
|
106
207
|
}
|
|
107
208
|
|
|
@@ -109,6 +210,10 @@ function idHex(id?: number) {
|
|
|
109
210
|
return id === undefined ? "undefined" : `0x${Diagnostic.hex(id, 4).toUpperCase()}`;
|
|
110
211
|
}
|
|
111
212
|
|
|
213
|
+
function basicInformationValue(id?: number) {
|
|
214
|
+
return id === undefined ? "(not reported by the device)" : idHex(id);
|
|
215
|
+
}
|
|
216
|
+
|
|
112
217
|
export namespace DeviceAttestationValidator {
|
|
113
218
|
export interface Context {
|
|
114
219
|
crypto: Crypto;
|
|
@@ -117,8 +222,8 @@ export namespace DeviceAttestationValidator {
|
|
|
117
222
|
/**
|
|
118
223
|
* DclCertificateService for PAA trust store, chain validation, revocation checks, and
|
|
119
224
|
* CD signer lookup. When absent, DCL-dependent checks are skipped (PAA lookup, chain
|
|
120
|
-
* verification, revocation
|
|
121
|
-
*
|
|
225
|
+
* verification, revocation) but local checks still run (nonce, signature, VendorID, CD fields),
|
|
226
|
+
* and the CD signature is verified with the built-in CSA keys and the Matter test CD signer only.
|
|
122
227
|
*/
|
|
123
228
|
dclCertificateService?: DclCertificateService;
|
|
124
229
|
}
|
|
@@ -129,8 +234,11 @@ export namespace DeviceAttestationValidator {
|
|
|
129
234
|
attestationElements: Bytes;
|
|
130
235
|
attestationSignature: Bytes;
|
|
131
236
|
attestationNonce: Bytes;
|
|
132
|
-
|
|
133
|
-
|
|
237
|
+
/** BasicInformation VendorID; undefined when the device did not report it. */
|
|
238
|
+
vendorId?: VendorId;
|
|
239
|
+
|
|
240
|
+
/** BasicInformation ProductID; undefined when the device did not report it. */
|
|
241
|
+
productId?: number;
|
|
134
242
|
}
|
|
135
243
|
|
|
136
244
|
/** Result of a successful validation, including any non-fatal findings. */
|
|
@@ -163,17 +271,35 @@ export namespace DeviceAttestationValidator {
|
|
|
163
271
|
* is provided.
|
|
164
272
|
*
|
|
165
273
|
* Most error-level failures throw immediately via {@link DeviceAttestationError}. A small
|
|
166
|
-
* set of recoverable error cases
|
|
167
|
-
*
|
|
168
|
-
*
|
|
274
|
+
* set of recoverable error cases are collected in `findings` so the caller can decide via
|
|
275
|
+
* `onFailure` whether to proceed: {@link DeviceAttestationCheck.TrustedAsTestCertificate}, and
|
|
276
|
+
* {@link DeviceAttestationCheck.CertificationDeclarationFieldMismatch} when the CD does not match the
|
|
277
|
+
* BasicInformation VendorID or ProductID the device reported, or the device did not report them.
|
|
278
|
+
* Warning and info findings are always collected. When a hard failure stops validation, the findings collected
|
|
279
|
+
* until then are in {@link DeviceAttestationError.precedingFindings}.
|
|
169
280
|
*/
|
|
170
281
|
export async function validate(context: Context, data: DeviceAttestationData): Promise<ValidationResult> {
|
|
171
|
-
const { crypto, dclCertificateService } = context;
|
|
172
282
|
const findings = new Array<AttestationFinding>();
|
|
283
|
+
try {
|
|
284
|
+
return { dacPublicKey: await validateCollecting(context, data, findings), findings };
|
|
285
|
+
} catch (error) {
|
|
286
|
+
if (error instanceof DeviceAttestationError) {
|
|
287
|
+
error.precedingFindings.push(...findings);
|
|
288
|
+
}
|
|
289
|
+
throw error;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
173
292
|
|
|
174
|
-
|
|
175
|
-
|
|
293
|
+
async function validateCollecting(
|
|
294
|
+
context: Context,
|
|
295
|
+
data: DeviceAttestationData,
|
|
296
|
+
findings: AttestationFinding[],
|
|
297
|
+
): Promise<ReturnType<typeof PublicKey>> {
|
|
298
|
+
const { crypto, dclCertificateService } = context;
|
|
299
|
+
|
|
300
|
+
// Step 1: Parse PAI and DAC from DER; the PAI goes first, as the CHIP SDK checks the PAI format first
|
|
176
301
|
const pai = parsePeerCertificate("PAI", data.pai, der => Pai.fromAsn1(der));
|
|
302
|
+
const dac = parsePeerCertificate("DAC", data.dac, der => Dac.fromAsn1(der));
|
|
177
303
|
|
|
178
304
|
// === Local checks (always run, no DCL needed) ===
|
|
179
305
|
|
|
@@ -366,44 +492,64 @@ export namespace DeviceAttestationValidator {
|
|
|
366
492
|
// === Remaining local checks (CD validation) ===
|
|
367
493
|
|
|
368
494
|
// Step 8: Certification Declaration signature verification
|
|
369
|
-
const cd =
|
|
370
|
-
DeviceAttestationCheck.CertificationDeclarationUnparseable,
|
|
371
|
-
"Device returned a Certification Declaration that cannot be parsed",
|
|
372
|
-
() => CertificationDeclaration.parse(attestationInfo.declaration),
|
|
373
|
-
);
|
|
495
|
+
const cd = parsePeerCertificationDeclaration(attestationInfo.declaration);
|
|
374
496
|
const cdSignerSkidHex = Bytes.toHex(cd.signerSubjectKeyId);
|
|
375
497
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
498
|
+
const cdSigner =
|
|
499
|
+
dclCertificateService === undefined
|
|
500
|
+
? CdSigners.known(cd.signerSubjectKeyId)
|
|
501
|
+
: await dclCertificateService.lookupCdSigner(cd.signerSubjectKeyId);
|
|
502
|
+
if (cdSigner === undefined) {
|
|
503
|
+
throw new DeviceAttestationError(
|
|
504
|
+
DeviceAttestationCheck.CdSignerUnknown,
|
|
505
|
+
`CD signer SKID ${cdSignerSkidHex} is not known to be a CD signer`,
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
try {
|
|
509
|
+
await crypto.verifyEcdsa(PublicKey(cdSigner.publicKey), cd.signedData, cd.signature);
|
|
510
|
+
} catch {
|
|
511
|
+
throw new DeviceAttestationError(
|
|
512
|
+
DeviceAttestationCheck.CertificationDeclarationSignatureInvalid,
|
|
513
|
+
"Certification Declaration signature verification failed",
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
if (cdSigner.isTestSigner && dclCertificateService?.acceptsTestCertificates === false) {
|
|
395
517
|
findings.push({
|
|
396
|
-
level: "
|
|
397
|
-
type: DeviceAttestationCheck.
|
|
398
|
-
message:
|
|
518
|
+
level: "error",
|
|
519
|
+
type: DeviceAttestationCheck.TrustedAsTestCertificate,
|
|
520
|
+
message:
|
|
521
|
+
`CD is signed by the Matter test CD signer ${cdSignerSkidHex}; ` +
|
|
522
|
+
"the device presented a valid test attestation but production trust policy is in effect",
|
|
399
523
|
});
|
|
400
524
|
}
|
|
401
525
|
|
|
402
526
|
// Step 9: Certification Declaration field validation (Matter spec Section 6.2.3.1)
|
|
403
527
|
const cdContent = cd.content;
|
|
404
528
|
|
|
405
|
-
|
|
529
|
+
if (cdContent.formatVersion !== CD_FORMAT_VERSION) {
|
|
530
|
+
throw new DeviceAttestationError(
|
|
531
|
+
DeviceAttestationCheck.CertificationDeclarationFormatInvalid,
|
|
532
|
+
`CD format_version ${cdContent.formatVersion} is not ${CD_FORMAT_VERSION}`,
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// Reserved certification_type values are refused like CHIP does; the specification only marks them reserved
|
|
406
537
|
const certType = cdContent.certificationType;
|
|
538
|
+
if (certType > CertificationType.Official) {
|
|
539
|
+
throw new DeviceAttestationError(
|
|
540
|
+
DeviceAttestationCheck.CertificationDeclarationFormatInvalid,
|
|
541
|
+
`CD certification_type ${certType} is a reserved value`,
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// § 6.3.1 allows a test-signed CD with certification_type 0; CHIP also accepts provisional, so only official fails
|
|
546
|
+
if (certType === CertificationType.Official && cdSigner.isTestSigner) {
|
|
547
|
+
throw new DeviceAttestationError(
|
|
548
|
+
DeviceAttestationCheck.OfficialCdSignedByTestSigner,
|
|
549
|
+
"CD with certification_type=2 (official) is signed by the Matter test CD signer",
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
|
|
407
553
|
if (certType === CertificationType.Provisional) {
|
|
408
554
|
findings.push({
|
|
409
555
|
level: "warning",
|
|
@@ -423,18 +569,20 @@ export namespace DeviceAttestationValidator {
|
|
|
423
569
|
|
|
424
570
|
// vendor_id SHALL match BasicInformation VendorID
|
|
425
571
|
if (cdContent.vendorId !== data.vendorId) {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
572
|
+
findings.push({
|
|
573
|
+
level: "error",
|
|
574
|
+
type: DeviceAttestationCheck.CertificationDeclarationFieldMismatch,
|
|
575
|
+
message: `CD vendor_id ${idHex(cdContent.vendorId)} does not match BasicInformation VendorID ${basicInformationValue(data.vendorId)}`,
|
|
576
|
+
});
|
|
430
577
|
}
|
|
431
578
|
|
|
432
579
|
// product_id_array SHALL contain BasicInformation ProductID
|
|
433
|
-
if (
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
580
|
+
if (cdContent.produceIdArray.every(id => id !== data.productId)) {
|
|
581
|
+
findings.push({
|
|
582
|
+
level: "error",
|
|
583
|
+
type: DeviceAttestationCheck.CertificationDeclarationFieldMismatch,
|
|
584
|
+
message: `CD product_id_array [${cdContent.produceIdArray.map(idHex).join(", ")}] does not contain BasicInformation ProductID ${basicInformationValue(data.productId)}`,
|
|
585
|
+
});
|
|
438
586
|
}
|
|
439
587
|
|
|
440
588
|
// CD SHALL contain both or neither of dac_origin_vendor_id and dac_origin_product_id
|
|
@@ -533,6 +681,6 @@ export namespace DeviceAttestationValidator {
|
|
|
533
681
|
// compare attestationInfo.firmwareInfo bytes against expected value and emit a
|
|
534
682
|
// FirmwareInfoMismatch warning finding on mismatch. Validation is MAY per spec.
|
|
535
683
|
|
|
536
|
-
return
|
|
684
|
+
return dacPublicKey;
|
|
537
685
|
}
|
|
538
686
|
}
|
|
@@ -112,8 +112,12 @@ export class DeviceCertification {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
// Parse DAC and PAI
|
|
115
|
-
|
|
116
|
-
const
|
|
115
|
+
// The commissioner judges the profile; a device only needs VendorID and ProductID to match its product
|
|
116
|
+
const dac = Dac.fromAsn1(certificate, { acceptProfileViolation: true, acceptMalformedVidPid: true });
|
|
117
|
+
const pai = Pai.fromAsn1(intermediateCertificate, {
|
|
118
|
+
acceptProfileViolation: true,
|
|
119
|
+
acceptMalformedVidPid: true,
|
|
120
|
+
});
|
|
117
121
|
|
|
118
122
|
// Validate vendorId from DAC matches product
|
|
119
123
|
const dacVendorId = dac.cert.subject.vendorId;
|
package/src/certificate/index.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Bytes, CertificateError } from "@matter/general";
|
|
7
|
+
import { Bytes, CertificateError, InternalError } from "@matter/general";
|
|
8
8
|
import { Specification } from "@matter/model";
|
|
9
|
-
import { Certificate } from "./Certificate.js";
|
|
9
|
+
import { Certificate, CertificateProfileError } from "./Certificate.js";
|
|
10
10
|
import { Unsigned } from "./common.js";
|
|
11
11
|
import { AttestationCertificate } from "./definitions/attestation.js";
|
|
12
12
|
import { MatterCertificate } from "./definitions/base.js";
|
|
@@ -26,9 +26,33 @@ export abstract class AttestationBaseCertificate<CT extends MatterCertificate> e
|
|
|
26
26
|
*/
|
|
27
27
|
export class MlDsaAttestationDisabledError extends CertificateError {}
|
|
28
28
|
|
|
29
|
+
export interface AttestationParseOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Accept a certificate that violates the X.509 profile of its kind, and read an absent basic constraints extension
|
|
32
|
+
* as not a CA. Only for a caller that does not judge the profile: a commissioner that already decided to proceed
|
|
33
|
+
* despite a failed device attestation, a device reading its own certificates, or a parser of a certificate in
|
|
34
|
+
* another role, such as a CRL signer.
|
|
35
|
+
*
|
|
36
|
+
* The PAA profile is not checked either way; for a PAA this option lets the basic constraints extension be
|
|
37
|
+
* absent. A malformed or repeated VendorID or ProductID is not covered; see {@link acceptMalformedVidPid}.
|
|
38
|
+
*/
|
|
39
|
+
acceptProfileViolation?: boolean;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Read a VendorID or ProductID that is malformed or repeated as absent instead of throwing
|
|
43
|
+
* {@link CertificateProfileError}. Only for a caller that needs no more than the VendorID and ProductID the
|
|
44
|
+
* certificate states, such as a device reading its own certificates. A caller that matches the VendorID against
|
|
45
|
+
* another source must not set it: an unreadable VendorID would read as "none stated".
|
|
46
|
+
*/
|
|
47
|
+
acceptMalformedVidPid?: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
29
50
|
/** @throws MlDsaAttestationDisabledError for an ML-DSA certificate while PQC Phase 1 is not enabled */
|
|
30
|
-
function parseAttestationCertificate(asn1: Bytes, requiredExtensions: string[]) {
|
|
31
|
-
const cert = Certificate.parseAsn1Certificate(asn1, requiredExtensions, {
|
|
51
|
+
function parseAttestationCertificate(asn1: Bytes, requiredExtensions: string[], options: AttestationParseOptions) {
|
|
52
|
+
const cert = Certificate.parseAsn1Certificate(asn1, requiredExtensions, {
|
|
53
|
+
postQuantum: true,
|
|
54
|
+
acceptMalformedVidPid: options.acceptMalformedVidPid,
|
|
55
|
+
});
|
|
32
56
|
const mlDsa = cert.mlDsaSignature ?? cert.mlDsaPublicKey?.parameterSet;
|
|
33
57
|
if (mlDsa !== undefined && !Specification.isForwardFeatureEnabled("pqc-phase-1")) {
|
|
34
58
|
throw new MlDsaAttestationDisabledError(
|
|
@@ -38,30 +62,174 @@ function parseAttestationCertificate(asn1: Bytes, requiredExtensions: string[])
|
|
|
38
62
|
return cert;
|
|
39
63
|
}
|
|
40
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Leave out basic constraints, whose absence is a profile violation. A certificate without key usage or a key
|
|
67
|
+
* identifier is unusable, so those stay required even for a caller that accepts a profile violation.
|
|
68
|
+
*/
|
|
69
|
+
function withoutBasicConstraints(required: string[]) {
|
|
70
|
+
return required.filter(name => name !== "basicConstraints");
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const DAC_PAI_REQUIRED_EXTENSIONS = withoutBasicConstraints(Certificate.REQUIRED_EXTENSIONS);
|
|
74
|
+
|
|
41
75
|
/** PAA (Product Attestation Authority) Certificate. */
|
|
42
76
|
export class Paa extends AttestationBaseCertificate<AttestationCertificate.Paa> {
|
|
43
|
-
/**
|
|
44
|
-
|
|
45
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Construct the class from an ASN.1/DER encoded certificate.
|
|
79
|
+
*
|
|
80
|
+
* @throws CertificateError if the certificate cannot be parsed
|
|
81
|
+
* @throws MlDsaAttestationDisabledError for an ML-DSA certificate while PQC Phase 1 is not enabled
|
|
82
|
+
*/
|
|
83
|
+
static fromAsn1(asn1: Bytes, options: AttestationParseOptions = {}): Paa {
|
|
84
|
+
const required = options.acceptProfileViolation
|
|
85
|
+
? withoutBasicConstraints(Certificate.REQUIRED_PAA_EXTENSIONS)
|
|
86
|
+
: Certificate.REQUIRED_PAA_EXTENSIONS;
|
|
87
|
+
const cert = parseAttestationCertificate(asn1, required, options);
|
|
46
88
|
return new Paa(cert as AttestationCertificate.Paa);
|
|
47
89
|
}
|
|
48
90
|
}
|
|
49
91
|
|
|
92
|
+
/** The extensions a DAC or PAI must carry at most once, as the CHIP SDK checks. */
|
|
93
|
+
const DAC_PAI_SINGLE_EXTENSIONS: MatterCertificate.ExtensionName[] = [
|
|
94
|
+
"basicConstraints",
|
|
95
|
+
"keyUsage",
|
|
96
|
+
"subjectKeyIdentifier",
|
|
97
|
+
"authorityKeyIdentifier",
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
function encodingOf(cert: MatterCertificate) {
|
|
101
|
+
if (cert.encoding === undefined) {
|
|
102
|
+
throw new InternalError("A certificate parsed from DER lacks its encoding details");
|
|
103
|
+
}
|
|
104
|
+
return cert.encoding;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* DAC and PAI share these rules:
|
|
109
|
+
*
|
|
110
|
+
* - "The `version` field SHALL be set to `2` to indicate v3 certificate."
|
|
111
|
+
* - "The certificate SHALL carry the following Extensions", among them basic constraints
|
|
112
|
+
* - "Basic Constraint extension SHALL be marked `critical`"
|
|
113
|
+
* - "Key Usage extension SHALL be marked `critical`"
|
|
114
|
+
* - RFC 5280 § 4.2: "A certificate MUST NOT include more than one instance of a particular extension."
|
|
115
|
+
*
|
|
116
|
+
* @see {@link MatterSpecification.v161.Core} § 6.2.2.3
|
|
117
|
+
* @see {@link MatterSpecification.v161.Core} § 6.2.2.4
|
|
118
|
+
* @throws CertificateProfileError naming the violated rule
|
|
119
|
+
*/
|
|
120
|
+
function assertCommonProfile(kind: "DAC" | "PAI", cert: MatterCertificate) {
|
|
121
|
+
const { version, extensions } = encodingOf(cert);
|
|
122
|
+
if (version !== 2) {
|
|
123
|
+
throw new CertificateProfileError(`${kind} version field must be 2 (v3), not ${version}`);
|
|
124
|
+
}
|
|
125
|
+
for (const name of DAC_PAI_SINGLE_EXTENSIONS) {
|
|
126
|
+
if (extensions.filter(extension => extension.name === name).length > 1) {
|
|
127
|
+
throw new CertificateProfileError(`${kind} carries more than one ${name} extension`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const basicConstraints = extensions.find(({ name }) => name === "basicConstraints");
|
|
131
|
+
if (basicConstraints === undefined) {
|
|
132
|
+
throw new CertificateProfileError(`${kind} must carry the basic constraints extension`);
|
|
133
|
+
}
|
|
134
|
+
if (!basicConstraints.critical) {
|
|
135
|
+
throw new CertificateProfileError(`${kind} basic constraints extension must be marked critical`);
|
|
136
|
+
}
|
|
137
|
+
if (!extensions.find(({ name }) => name === "keyUsage")?.critical) {
|
|
138
|
+
throw new CertificateProfileError(`${kind} key usage extension must be marked critical`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Enforce the PAI profile:
|
|
144
|
+
*
|
|
145
|
+
* - "Basic Constraint extension SHALL be marked `critical` and have the `cA` field set to TRUE and `pathLen` field set
|
|
146
|
+
* to 0."
|
|
147
|
+
* - "Both the `keyCertSign` and `cRLSign` bits SHALL be set in the `KeyUsage` bitstring", "The `digitalSignature` bit
|
|
148
|
+
* MAY be set", "Other bits SHALL NOT be set"
|
|
149
|
+
*
|
|
150
|
+
* @see {@link MatterSpecification.v161.Core} § 6.2.2.4
|
|
151
|
+
* @throws CertificateProfileError naming the violated rule
|
|
152
|
+
*/
|
|
153
|
+
function assertPaiProfile(cert: MatterCertificate) {
|
|
154
|
+
assertCommonProfile("PAI", cert);
|
|
155
|
+
const { basicConstraints } = cert.extensions;
|
|
156
|
+
if (!basicConstraints.isCa) {
|
|
157
|
+
throw new CertificateProfileError("PAI basic constraints must have cA set to TRUE");
|
|
158
|
+
}
|
|
159
|
+
if (basicConstraints.pathLen !== 0) {
|
|
160
|
+
throw new CertificateProfileError(`PAI basic constraints must have pathLen 0, not ${basicConstraints.pathLen}`);
|
|
161
|
+
}
|
|
162
|
+
const { keyUsage } = encodingOf(cert);
|
|
163
|
+
if (keyUsage !== 0x0060 && keyUsage !== 0x0061) {
|
|
164
|
+
throw new CertificateProfileError(
|
|
165
|
+
"PAI key usage must have keyCertSign and cRLSign set, may have digitalSignature set, and no other bit",
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Enforce the DAC profile:
|
|
172
|
+
*
|
|
173
|
+
* - "Basic Constraint extension SHALL be marked `critical` and have the `cA` field set to FALSE."
|
|
174
|
+
* - "The `KeyUsage` bitstring SHALL only have the `digitalSignature` bit set."
|
|
175
|
+
*
|
|
176
|
+
* RFC 5280 § 4.2.1.9 does not allow `pathLenConstraint` without `cA`; like the CHIP SDK, a DAC with a pathLen is
|
|
177
|
+
* refused.
|
|
178
|
+
*
|
|
179
|
+
* @see {@link MatterSpecification.v161.Core} § 6.2.2.3
|
|
180
|
+
* @throws CertificateProfileError naming the violated rule
|
|
181
|
+
*/
|
|
182
|
+
function assertDacProfile(cert: MatterCertificate) {
|
|
183
|
+
assertCommonProfile("DAC", cert);
|
|
184
|
+
const { basicConstraints } = cert.extensions;
|
|
185
|
+
if (basicConstraints.isCa) {
|
|
186
|
+
throw new CertificateProfileError("DAC basic constraints must have cA set to FALSE");
|
|
187
|
+
}
|
|
188
|
+
if (basicConstraints.pathLen !== undefined) {
|
|
189
|
+
throw new CertificateProfileError(
|
|
190
|
+
`DAC basic constraints must not have a pathLen, found ${basicConstraints.pathLen}`,
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
if (encodingOf(cert).keyUsage !== 0x0001) {
|
|
194
|
+
throw new CertificateProfileError("DAC key usage must have only digitalSignature set");
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
50
198
|
/** PAI (Product Attestation Intermediate) Certificate. */
|
|
51
199
|
export class Pai extends AttestationBaseCertificate<AttestationCertificate.Pai> {
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
200
|
+
/**
|
|
201
|
+
* Construct the class from an ASN.1/DER encoded certificate.
|
|
202
|
+
*
|
|
203
|
+
* @throws CertificateProfileError if the certificate violates the PAI profile
|
|
204
|
+
* @throws CertificateError if the certificate cannot be parsed
|
|
205
|
+
* @throws MlDsaAttestationDisabledError for an ML-DSA certificate while PQC Phase 1 is not enabled
|
|
206
|
+
*/
|
|
207
|
+
static fromAsn1(asn1: Bytes, options: AttestationParseOptions = {}): Pai {
|
|
208
|
+
const cert = parseAttestationCertificate(asn1, DAC_PAI_REQUIRED_EXTENSIONS, options);
|
|
209
|
+
const pai = new Pai(cert as AttestationCertificate.Pai);
|
|
210
|
+
if (!options.acceptProfileViolation) {
|
|
211
|
+
assertPaiProfile(cert);
|
|
212
|
+
}
|
|
213
|
+
return pai;
|
|
56
214
|
}
|
|
57
215
|
}
|
|
58
216
|
|
|
59
217
|
/** DAC (Device Attestation Certificate) Certificate. */
|
|
60
218
|
export class Dac extends AttestationBaseCertificate<AttestationCertificate.Dac> {
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
219
|
+
/**
|
|
220
|
+
* Construct the class from an ASN.1/DER encoded certificate.
|
|
221
|
+
*
|
|
222
|
+
* @throws CertificateProfileError if the certificate violates the DAC profile
|
|
223
|
+
* @throws CertificateError if the certificate cannot be parsed or has no EC P-256 key
|
|
224
|
+
* @throws MlDsaAttestationDisabledError for an ML-DSA certificate while PQC Phase 1 is not enabled
|
|
225
|
+
*/
|
|
226
|
+
static fromAsn1(asn1: Bytes, options: AttestationParseOptions = {}): Dac {
|
|
227
|
+
const cert = parseAttestationCertificate(asn1, DAC_PAI_REQUIRED_EXTENSIONS, options);
|
|
228
|
+
const dac = new Dac(cert as AttestationCertificate.Dac);
|
|
229
|
+
if (!options.acceptProfileViolation) {
|
|
230
|
+
assertDacProfile(cert);
|
|
231
|
+
}
|
|
232
|
+
return dac;
|
|
65
233
|
}
|
|
66
234
|
|
|
67
235
|
/**
|