@zwave-js/cc 14.0.0-beta.1 → 14.0.0-beta.5
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/build/cjs/cc/AlarmSensorCC.d.ts +194 -0
- package/build/cjs/cc/AlarmSensorCC.js +510 -0
- package/build/cjs/cc/AlarmSensorCC.js.map +7 -0
- package/build/cjs/cc/AssociationCC.d.ts +253 -0
- package/build/cjs/cc/AssociationCC.js +877 -0
- package/build/cjs/cc/AssociationCC.js.map +7 -0
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +230 -0
- package/build/cjs/cc/AssociationGroupInfoCC.js +887 -0
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +7 -0
- package/build/cjs/cc/BarrierOperatorCC.d.ts +243 -0
- package/build/cjs/cc/BarrierOperatorCC.js +748 -0
- package/build/cjs/cc/BarrierOperatorCC.js.map +7 -0
- package/build/cjs/cc/BasicCC.d.ts +191 -0
- package/build/cjs/cc/BasicCC.js +478 -0
- package/build/cjs/cc/BasicCC.js.map +7 -0
- package/build/cjs/cc/BatteryCC.d.ts +406 -0
- package/build/cjs/cc/BatteryCC.js +590 -0
- package/build/cjs/cc/BatteryCC.js.map +7 -0
- package/build/cjs/cc/BinarySensorCC.d.ts +122 -0
- package/build/cjs/cc/BinarySensorCC.js +546 -0
- package/build/cjs/cc/BinarySensorCC.js.map +7 -0
- package/build/cjs/cc/BinarySwitchCC.d.ts +139 -0
- package/build/cjs/cc/BinarySwitchCC.js +472 -0
- package/build/cjs/cc/BinarySwitchCC.js.map +7 -0
- package/build/cjs/cc/CRC16CC.d.ts +29 -0
- package/build/cjs/cc/CRC16CC.js +208 -0
- package/build/cjs/cc/CRC16CC.js.map +7 -0
- package/build/cjs/cc/CentralSceneCC.d.ts +210 -0
- package/build/cjs/cc/CentralSceneCC.js +584 -0
- package/build/cjs/cc/CentralSceneCC.js.map +7 -0
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +177 -0
- package/build/cjs/cc/ClimateControlScheduleCC.js +646 -0
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +7 -0
- package/build/cjs/cc/ClockCC.d.ts +47 -0
- package/build/cjs/cc/ClockCC.js +330 -0
- package/build/cjs/cc/ClockCC.js.map +7 -0
- package/build/cjs/cc/ColorSwitchCC.d.ts +339 -0
- package/build/cjs/cc/ColorSwitchCC.js +1265 -0
- package/build/cjs/cc/ColorSwitchCC.js.map +7 -0
- package/build/cjs/cc/ConfigurationCC.d.ts +396 -0
- package/build/cjs/cc/ConfigurationCC.js +2477 -0
- package/build/cjs/cc/ConfigurationCC.js.map +7 -0
- package/build/cjs/cc/DeviceResetLocallyCC.d.ts +17 -0
- package/build/cjs/cc/DeviceResetLocallyCC.js +168 -0
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +7 -0
- package/build/cjs/cc/DoorLockCC.d.ts +837 -0
- package/build/cjs/cc/DoorLockCC.js +1366 -0
- package/build/cjs/cc/DoorLockCC.js.map +7 -0
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +77 -0
- package/build/cjs/cc/DoorLockLoggingCC.js +458 -0
- package/build/cjs/cc/DoorLockLoggingCC.js.map +7 -0
- package/build/cjs/cc/EnergyProductionCC.d.ts +77 -0
- package/build/cjs/cc/EnergyProductionCC.js +329 -0
- package/build/cjs/cc/EnergyProductionCC.js.map +7 -0
- package/build/cjs/cc/EntryControlCC.d.ts +231 -0
- package/build/cjs/cc/EntryControlCC.js +754 -0
- package/build/cjs/cc/EntryControlCC.js.map +7 -0
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +359 -0
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +1322 -0
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +7 -0
- package/build/cjs/cc/HailCC.d.ts +6 -0
- package/build/cjs/cc/HailCC.js +91 -0
- package/build/cjs/cc/HailCC.js.map +7 -0
- package/build/cjs/cc/HumidityControlModeCC.d.ts +111 -0
- package/build/cjs/cc/HumidityControlModeCC.js +449 -0
- package/build/cjs/cc/HumidityControlModeCC.js.map +7 -0
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +60 -0
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +250 -0
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +7 -0
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +209 -0
- package/build/cjs/cc/HumidityControlSetpointCC.js +821 -0
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +7 -0
- package/build/cjs/cc/InclusionControllerCC.d.ts +42 -0
- package/build/cjs/cc/InclusionControllerCC.js +251 -0
- package/build/cjs/cc/InclusionControllerCC.js.map +7 -0
- package/build/cjs/cc/IndicatorCC.d.ts +338 -0
- package/build/cjs/cc/IndicatorCC.js +1395 -0
- package/build/cjs/cc/IndicatorCC.js.map +7 -0
- package/build/cjs/cc/IrrigationCC.d.ts +1496 -0
- package/build/cjs/cc/IrrigationCC.js +2224 -0
- package/build/cjs/cc/IrrigationCC.js.map +7 -0
- package/build/cjs/cc/LanguageCC.d.ts +101 -0
- package/build/cjs/cc/LanguageCC.js +364 -0
- package/build/cjs/cc/LanguageCC.js.map +7 -0
- package/build/cjs/cc/LockCC.d.ts +73 -0
- package/build/cjs/cc/LockCC.js +322 -0
- package/build/cjs/cc/LockCC.js.map +7 -0
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +32 -0
- package/build/cjs/cc/ManufacturerProprietaryCC.js +269 -0
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +7 -0
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +171 -0
- package/build/cjs/cc/ManufacturerSpecificCC.js +440 -0
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +7 -0
- package/build/cjs/cc/MeterCC.d.ts +318 -0
- package/build/cjs/cc/MeterCC.js +1355 -0
- package/build/cjs/cc/MeterCC.js.map +7 -0
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +241 -0
- package/build/cjs/cc/MultiChannelAssociationCC.js +1090 -0
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +7 -0
- package/build/cjs/cc/MultiChannelCC.d.ts +394 -0
- package/build/cjs/cc/MultiChannelCC.js +1268 -0
- package/build/cjs/cc/MultiChannelCC.js.map +7 -0
- package/build/cjs/cc/MultiCommandCC.d.ts +27 -0
- package/build/cjs/cc/MultiCommandCC.js +234 -0
- package/build/cjs/cc/MultiCommandCC.js.map +7 -0
- package/build/cjs/cc/MultilevelSensorCC.d.ts +185 -0
- package/build/cjs/cc/MultilevelSensorCC.js +856 -0
- package/build/cjs/cc/MultilevelSensorCC.js.map +7 -0
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +357 -0
- package/build/cjs/cc/MultilevelSwitchCC.js +928 -0
- package/build/cjs/cc/MultilevelSwitchCC.js.map +7 -0
- package/build/cjs/cc/NoOperationCC.d.ts +9 -0
- package/build/cjs/cc/NoOperationCC.js +126 -0
- package/build/cjs/cc/NoOperationCC.js.map +7 -0
- package/build/cjs/cc/NodeNamingCC.d.ts +118 -0
- package/build/cjs/cc/NodeNamingCC.js +504 -0
- package/build/cjs/cc/NodeNamingCC.js.map +7 -0
- package/build/cjs/cc/NotificationCC.d.ts +479 -0
- package/build/cjs/cc/NotificationCC.js +1399 -0
- package/build/cjs/cc/NotificationCC.js.map +7 -0
- package/build/cjs/cc/PowerlevelCC.d.ts +82 -0
- package/build/cjs/cc/PowerlevelCC.js +657 -0
- package/build/cjs/cc/PowerlevelCC.js.map +7 -0
- package/build/cjs/cc/ProtectionCC.d.ts +325 -0
- package/build/cjs/cc/ProtectionCC.js +859 -0
- package/build/cjs/cc/ProtectionCC.js.map +7 -0
- package/build/cjs/cc/SceneActivationCC.d.ts +89 -0
- package/build/cjs/cc/SceneActivationCC.js +261 -0
- package/build/cjs/cc/SceneActivationCC.js.map +7 -0
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +120 -0
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +473 -0
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +7 -0
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +129 -0
- package/build/cjs/cc/SceneControllerConfigurationCC.js +526 -0
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +7 -0
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +434 -0
- package/build/cjs/cc/ScheduleEntryLockCC.js +2043 -0
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +7 -0
- package/build/cjs/cc/Security2CC.d.ts +251 -0
- package/build/cjs/cc/Security2CC.js +1853 -0
- package/build/cjs/cc/Security2CC.js.map +7 -0
- package/build/cjs/cc/SecurityCC.d.ts +128 -0
- package/build/cjs/cc/SecurityCC.js +977 -0
- package/build/cjs/cc/SecurityCC.js.map +7 -0
- package/build/cjs/cc/SoundSwitchCC.d.ts +232 -0
- package/build/cjs/cc/SoundSwitchCC.js +853 -0
- package/build/cjs/cc/SoundSwitchCC.js.map +7 -0
- package/build/cjs/cc/SupervisionCC.d.ts +104 -0
- package/build/cjs/cc/SupervisionCC.js +398 -0
- package/build/cjs/cc/SupervisionCC.js.map +7 -0
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +141 -0
- package/build/cjs/cc/ThermostatFanModeCC.js +495 -0
- package/build/cjs/cc/ThermostatFanModeCC.js.map +7 -0
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +60 -0
- package/build/cjs/cc/ThermostatFanStateCC.js +252 -0
- package/build/cjs/cc/ThermostatFanStateCC.js.map +7 -0
- package/build/cjs/cc/ThermostatModeCC.d.ts +150 -0
- package/build/cjs/cc/ThermostatModeCC.js +559 -0
- package/build/cjs/cc/ThermostatModeCC.js.map +7 -0
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +61 -0
- package/build/cjs/cc/ThermostatOperatingStateCC.js +248 -0
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +7 -0
- package/build/cjs/cc/ThermostatSetbackCC.d.ts +46 -0
- package/build/cjs/cc/ThermostatSetbackCC.js +366 -0
- package/build/cjs/cc/ThermostatSetbackCC.js.map +7 -0
- package/build/cjs/cc/ThermostatSetpointCC.d.ts +197 -0
- package/build/cjs/cc/ThermostatSetpointCC.js +792 -0
- package/build/cjs/cc/ThermostatSetpointCC.js.map +7 -0
- package/build/cjs/cc/TimeCC.d.ts +88 -0
- package/build/cjs/cc/TimeCC.js +635 -0
- package/build/cjs/cc/TimeCC.js.map +7 -0
- package/build/cjs/cc/TimeParametersCC.d.ts +72 -0
- package/build/cjs/cc/TimeParametersCC.js +413 -0
- package/build/cjs/cc/TimeParametersCC.js.map +7 -0
- package/build/cjs/cc/TransportServiceCC.d.ts +107 -0
- package/build/cjs/cc/TransportServiceCC.js +522 -0
- package/build/cjs/cc/TransportServiceCC.js.map +7 -0
- package/build/cjs/cc/UserCodeCC.d.ts +683 -0
- package/build/cjs/cc/UserCodeCC.js +1903 -0
- package/build/cjs/cc/UserCodeCC.js.map +7 -0
- package/build/cjs/cc/VersionCC.d.ts +469 -0
- package/build/cjs/cc/VersionCC.js +962 -0
- package/build/cjs/cc/VersionCC.js.map +7 -0
- package/build/cjs/cc/WakeUpCC.d.ts +150 -0
- package/build/cjs/cc/WakeUpCC.js +609 -0
- package/build/cjs/cc/WakeUpCC.js.map +7 -0
- package/build/cjs/cc/WindowCoveringCC.d.ts +315 -0
- package/build/cjs/cc/WindowCoveringCC.js +924 -0
- package/build/cjs/cc/WindowCoveringCC.js.map +7 -0
- package/build/cjs/cc/ZWaveLongRangeCC.d.ts +4 -0
- package/build/cjs/cc/ZWaveLongRangeCC.js +90 -0
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +7 -0
- package/build/cjs/cc/ZWavePlusCC.d.ts +163 -0
- package/build/cjs/cc/ZWavePlusCC.js +362 -0
- package/build/cjs/cc/ZWavePlusCC.js.map +7 -0
- package/build/cjs/cc/ZWaveProtocolCC.d.ts +344 -0
- package/build/cjs/cc/ZWaveProtocolCC.js +1638 -0
- package/build/cjs/cc/ZWaveProtocolCC.js.map +7 -0
- package/build/cjs/cc/index.d.ts +132 -0
- package/build/cjs/cc/index.js +1180 -0
- package/build/cjs/cc/index.js.map +7 -0
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +64 -0
- package/build/cjs/cc/manufacturerProprietary/Decorators.js +76 -0
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +7 -0
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +79 -0
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +533 -0
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +7 -0
- package/build/cjs/index.d.ts +15 -0
- package/build/cjs/index.js +77 -0
- package/build/cjs/index.js.map +7 -0
- package/build/cjs/index_safe.d.ts +3 -0
- package/build/cjs/index_safe.js +25 -0
- package/build/cjs/index_safe.js.map +7 -0
- package/build/cjs/lib/API.d.ts +271 -0
- package/build/cjs/lib/API.js +413 -0
- package/build/cjs/lib/API.js.map +7 -0
- package/build/cjs/lib/CommandClass.d.ts +234 -0
- package/build/cjs/lib/CommandClass.js +692 -0
- package/build/cjs/lib/CommandClass.js.map +7 -0
- package/build/cjs/lib/CommandClassDecorators.d.ts +108 -0
- package/build/cjs/lib/CommandClassDecorators.js +181 -0
- package/build/cjs/lib/CommandClassDecorators.js.map +7 -0
- package/build/cjs/lib/EncapsulatingCommandClass.d.ts +22 -0
- package/build/cjs/lib/EncapsulatingCommandClass.js +71 -0
- package/build/cjs/lib/EncapsulatingCommandClass.js.map +7 -0
- package/build/cjs/lib/ICommandClassContainer.js +17 -0
- package/build/cjs/lib/ICommandClassContainer.js.map +7 -0
- package/build/cjs/lib/NotificationEventPayload.d.ts +10 -0
- package/build/cjs/lib/NotificationEventPayload.js +31 -0
- package/build/cjs/lib/NotificationEventPayload.js.map +7 -0
- package/build/cjs/lib/Security2/Extension.d.ts +106 -0
- package/build/cjs/lib/Security2/Extension.js +424 -0
- package/build/cjs/lib/Security2/Extension.js.map +7 -0
- package/build/cjs/lib/Security2/shared.js +69 -0
- package/build/cjs/lib/Security2/shared.js.map +7 -0
- package/build/cjs/lib/SetValueResult.js +65 -0
- package/build/cjs/lib/SetValueResult.js.map +7 -0
- package/build/cjs/lib/Values.d.ts +223 -0
- package/build/cjs/lib/Values.js +191 -0
- package/build/cjs/lib/Values.js.map +7 -0
- package/build/cjs/lib/_Types.js +1676 -0
- package/build/cjs/lib/_Types.js.map +7 -0
- package/build/cjs/lib/serializers.d.ts +34 -0
- package/build/cjs/lib/serializers.js +110 -0
- package/build/cjs/lib/serializers.js.map +7 -0
- package/build/cjs/lib/utils.d.ts +17 -0
- package/build/cjs/lib/utils.js +678 -0
- package/build/cjs/lib/utils.js.map +7 -0
- package/build/cjs/package.json +3 -0
- package/build/esm/cc/AlarmSensorCC.d.ts +194 -0
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -0
- package/build/esm/cc/AlarmSensorCC.js +490 -0
- package/build/esm/cc/AlarmSensorCC.js.map +1 -0
- package/build/esm/cc/AssociationCC.d.ts +253 -0
- package/build/esm/cc/AssociationCC.d.ts.map +1 -0
- package/build/esm/cc/AssociationCC.js +847 -0
- package/build/esm/cc/AssociationCC.js.map +1 -0
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +230 -0
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -0
- package/build/esm/cc/AssociationGroupInfoCC.js +889 -0
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -0
- package/build/esm/cc/BarrierOperatorCC.d.ts +243 -0
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -0
- package/build/esm/cc/BarrierOperatorCC.js +751 -0
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -0
- package/build/esm/cc/BasicCC.d.ts +191 -0
- package/build/esm/cc/BasicCC.d.ts.map +1 -0
- package/build/esm/cc/BasicCC.js +468 -0
- package/build/esm/cc/BasicCC.js.map +1 -0
- package/build/esm/cc/BatteryCC.d.ts +406 -0
- package/build/esm/cc/BatteryCC.d.ts.map +1 -0
- package/build/esm/cc/BatteryCC.js +578 -0
- package/build/esm/cc/BatteryCC.js.map +1 -0
- package/build/esm/cc/BinarySensorCC.d.ts +122 -0
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -0
- package/build/esm/cc/BinarySensorCC.js +515 -0
- package/build/esm/cc/BinarySensorCC.js.map +1 -0
- package/build/esm/cc/BinarySwitchCC.d.ts +139 -0
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -0
- package/build/esm/cc/BinarySwitchCC.js +441 -0
- package/build/esm/cc/BinarySwitchCC.js.map +1 -0
- package/build/esm/cc/CRC16CC.d.ts +29 -0
- package/build/esm/cc/CRC16CC.d.ts.map +1 -0
- package/build/esm/cc/CRC16CC.js +187 -0
- package/build/esm/cc/CRC16CC.js.map +1 -0
- package/build/esm/cc/CentralSceneCC.d.ts +210 -0
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -0
- package/build/esm/cc/CentralSceneCC.js +541 -0
- package/build/esm/cc/CentralSceneCC.js.map +1 -0
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +177 -0
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -0
- package/build/esm/cc/ClimateControlScheduleCC.js +607 -0
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -0
- package/build/esm/cc/ClockCC.d.ts +47 -0
- package/build/esm/cc/ClockCC.d.ts.map +1 -0
- package/build/esm/cc/ClockCC.js +294 -0
- package/build/esm/cc/ClockCC.js.map +1 -0
- package/build/esm/cc/ColorSwitchCC.d.ts +339 -0
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -0
- package/build/esm/cc/ColorSwitchCC.js +1274 -0
- package/build/esm/cc/ColorSwitchCC.js.map +1 -0
- package/build/esm/cc/ConfigurationCC.d.ts +396 -0
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -0
- package/build/esm/cc/ConfigurationCC.js +2666 -0
- package/build/esm/cc/ConfigurationCC.js.map +1 -0
- package/build/esm/cc/DeviceResetLocallyCC.d.ts +17 -0
- package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -0
- package/build/esm/cc/DeviceResetLocallyCC.js +138 -0
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -0
- package/build/esm/cc/DoorLockCC.d.ts +837 -0
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -0
- package/build/esm/cc/DoorLockCC.js +1372 -0
- package/build/esm/cc/DoorLockCC.js.map +1 -0
- package/build/esm/cc/DoorLockLoggingCC.d.ts +77 -0
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -0
- package/build/esm/cc/DoorLockLoggingCC.js +414 -0
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -0
- package/build/esm/cc/EnergyProductionCC.d.ts +77 -0
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -0
- package/build/esm/cc/EnergyProductionCC.js +289 -0
- package/build/esm/cc/EnergyProductionCC.js.map +1 -0
- package/build/esm/cc/EntryControlCC.d.ts +231 -0
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -0
- package/build/esm/cc/EntryControlCC.js +717 -0
- package/build/esm/cc/EntryControlCC.js.map +1 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +359 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +1311 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -0
- package/build/esm/cc/HailCC.d.ts +6 -0
- package/build/esm/cc/HailCC.d.ts.map +1 -0
- package/build/esm/cc/HailCC.js +60 -0
- package/build/esm/cc/HailCC.js.map +1 -0
- package/build/esm/cc/HumidityControlModeCC.d.ts +111 -0
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -0
- package/build/esm/cc/HumidityControlModeCC.js +412 -0
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -0
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +60 -0
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -0
- package/build/esm/cc/HumidityControlOperatingStateCC.js +210 -0
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -0
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +209 -0
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -0
- package/build/esm/cc/HumidityControlSetpointCC.js +805 -0
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -0
- package/build/esm/cc/InclusionControllerCC.d.ts +42 -0
- package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -0
- package/build/esm/cc/InclusionControllerCC.js +211 -0
- package/build/esm/cc/InclusionControllerCC.js.map +1 -0
- package/build/esm/cc/IndicatorCC.d.ts +338 -0
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -0
- package/build/esm/cc/IndicatorCC.js +1455 -0
- package/build/esm/cc/IndicatorCC.js.map +1 -0
- package/build/esm/cc/IrrigationCC.d.ts +1496 -0
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -0
- package/build/esm/cc/IrrigationCC.js +2239 -0
- package/build/esm/cc/IrrigationCC.js.map +1 -0
- package/build/esm/cc/LanguageCC.d.ts +101 -0
- package/build/esm/cc/LanguageCC.d.ts.map +1 -0
- package/build/esm/cc/LanguageCC.js +325 -0
- package/build/esm/cc/LanguageCC.js.map +1 -0
- package/build/esm/cc/LockCC.d.ts +73 -0
- package/build/esm/cc/LockCC.d.ts.map +1 -0
- package/build/esm/cc/LockCC.js +282 -0
- package/build/esm/cc/LockCC.js.map +1 -0
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +32 -0
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -0
- package/build/esm/cc/ManufacturerProprietaryCC.js +252 -0
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -0
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +171 -0
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -0
- package/build/esm/cc/ManufacturerSpecificCC.js +404 -0
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -0
- package/build/esm/cc/MeterCC.d.ts +318 -0
- package/build/esm/cc/MeterCC.d.ts.map +1 -0
- package/build/esm/cc/MeterCC.js +1409 -0
- package/build/esm/cc/MeterCC.js.map +1 -0
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +241 -0
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -0
- package/build/esm/cc/MultiChannelAssociationCC.js +1094 -0
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -0
- package/build/esm/cc/MultiChannelCC.d.ts +394 -0
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -0
- package/build/esm/cc/MultiChannelCC.js +1312 -0
- package/build/esm/cc/MultiChannelCC.js.map +1 -0
- package/build/esm/cc/MultiCommandCC.d.ts +27 -0
- package/build/esm/cc/MultiCommandCC.d.ts.map +1 -0
- package/build/esm/cc/MultiCommandCC.js +206 -0
- package/build/esm/cc/MultiCommandCC.js.map +1 -0
- package/build/esm/cc/MultilevelSensorCC.d.ts +185 -0
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -0
- package/build/esm/cc/MultilevelSensorCC.js +872 -0
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -0
- package/build/esm/cc/MultilevelSwitchCC.d.ts +357 -0
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -0
- package/build/esm/cc/MultilevelSwitchCC.js +935 -0
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -0
- package/build/esm/cc/NoOperationCC.d.ts +9 -0
- package/build/esm/cc/NoOperationCC.d.ts.map +1 -0
- package/build/esm/cc/NoOperationCC.js +92 -0
- package/build/esm/cc/NoOperationCC.js.map +1 -0
- package/build/esm/cc/NodeNamingCC.d.ts +118 -0
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -0
- package/build/esm/cc/NodeNamingCC.js +464 -0
- package/build/esm/cc/NodeNamingCC.js.map +1 -0
- package/build/esm/cc/NotificationCC.d.ts +479 -0
- package/build/esm/cc/NotificationCC.d.ts.map +1 -0
- package/build/esm/cc/NotificationCC.js +1481 -0
- package/build/esm/cc/NotificationCC.js.map +1 -0
- package/build/esm/cc/PowerlevelCC.d.ts +82 -0
- package/build/esm/cc/PowerlevelCC.d.ts.map +1 -0
- package/build/esm/cc/PowerlevelCC.js +611 -0
- package/build/esm/cc/PowerlevelCC.js.map +1 -0
- package/build/esm/cc/ProtectionCC.d.ts +325 -0
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -0
- package/build/esm/cc/ProtectionCC.js +830 -0
- package/build/esm/cc/ProtectionCC.js.map +1 -0
- package/build/esm/cc/SceneActivationCC.d.ts +89 -0
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -0
- package/build/esm/cc/SceneActivationCC.js +223 -0
- package/build/esm/cc/SceneActivationCC.js.map +1 -0
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +120 -0
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -0
- package/build/esm/cc/SceneActuatorConfigurationCC.js +462 -0
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -0
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +129 -0
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -0
- package/build/esm/cc/SceneControllerConfigurationCC.js +534 -0
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -0
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +434 -0
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -0
- package/build/esm/cc/ScheduleEntryLockCC.js +2065 -0
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -0
- package/build/esm/cc/Security2CC.d.ts +251 -0
- package/build/esm/cc/Security2CC.d.ts.map +1 -0
- package/build/esm/cc/Security2CC.js +2041 -0
- package/build/esm/cc/Security2CC.js.map +1 -0
- package/build/esm/cc/SecurityCC.d.ts +128 -0
- package/build/esm/cc/SecurityCC.d.ts.map +1 -0
- package/build/esm/cc/SecurityCC.js +989 -0
- package/build/esm/cc/SecurityCC.js.map +1 -0
- package/build/esm/cc/SoundSwitchCC.d.ts +232 -0
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -0
- package/build/esm/cc/SoundSwitchCC.js +796 -0
- package/build/esm/cc/SoundSwitchCC.js.map +1 -0
- package/build/esm/cc/SupervisionCC.d.ts +104 -0
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -0
- package/build/esm/cc/SupervisionCC.js +396 -0
- package/build/esm/cc/SupervisionCC.js.map +1 -0
- package/build/esm/cc/ThermostatFanModeCC.d.ts +141 -0
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatFanModeCC.js +463 -0
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -0
- package/build/esm/cc/ThermostatFanStateCC.d.ts +60 -0
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatFanStateCC.js +212 -0
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -0
- package/build/esm/cc/ThermostatModeCC.d.ts +150 -0
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatModeCC.js +530 -0
- package/build/esm/cc/ThermostatModeCC.js.map +1 -0
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +61 -0
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatOperatingStateCC.js +208 -0
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -0
- package/build/esm/cc/ThermostatSetbackCC.d.ts +46 -0
- package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatSetbackCC.js +333 -0
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -0
- package/build/esm/cc/ThermostatSetpointCC.d.ts +197 -0
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatSetpointCC.js +786 -0
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -0
- package/build/esm/cc/TimeCC.d.ts +88 -0
- package/build/esm/cc/TimeCC.d.ts.map +1 -0
- package/build/esm/cc/TimeCC.js +590 -0
- package/build/esm/cc/TimeCC.js.map +1 -0
- package/build/esm/cc/TimeParametersCC.d.ts +72 -0
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -0
- package/build/esm/cc/TimeParametersCC.js +385 -0
- package/build/esm/cc/TimeParametersCC.js.map +1 -0
- package/build/esm/cc/TransportServiceCC.d.ts +107 -0
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -0
- package/build/esm/cc/TransportServiceCC.js +523 -0
- package/build/esm/cc/TransportServiceCC.js.map +1 -0
- package/build/esm/cc/UserCodeCC.d.ts +683 -0
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -0
- package/build/esm/cc/UserCodeCC.js +1933 -0
- package/build/esm/cc/UserCodeCC.js.map +1 -0
- package/build/esm/cc/VersionCC.d.ts +469 -0
- package/build/esm/cc/VersionCC.d.ts.map +1 -0
- package/build/esm/cc/VersionCC.js +971 -0
- package/build/esm/cc/VersionCC.js.map +1 -0
- package/build/esm/cc/WakeUpCC.d.ts +150 -0
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -0
- package/build/esm/cc/WakeUpCC.js +568 -0
- package/build/esm/cc/WakeUpCC.js.map +1 -0
- package/build/esm/cc/WindowCoveringCC.d.ts +315 -0
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -0
- package/build/esm/cc/WindowCoveringCC.js +905 -0
- package/build/esm/cc/WindowCoveringCC.js.map +1 -0
- package/build/esm/cc/ZWaveLongRangeCC.d.ts +4 -0
- package/build/esm/cc/ZWaveLongRangeCC.d.ts.map +1 -0
- package/build/esm/cc/ZWaveLongRangeCC.js +57 -0
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -0
- package/build/esm/cc/ZWavePlusCC.d.ts +163 -0
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -0
- package/build/esm/cc/ZWavePlusCC.js +328 -0
- package/build/esm/cc/ZWavePlusCC.js.map +1 -0
- package/build/esm/cc/ZWaveProtocolCC.d.ts +344 -0
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -0
- package/build/esm/cc/ZWaveProtocolCC.js +1520 -0
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -0
- package/build/esm/cc/index.d.ts +132 -0
- package/build/esm/cc/index.d.ts.map +1 -0
- package/build/esm/cc/index.js +71 -0
- package/build/esm/cc/index.js.map +1 -0
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +64 -0
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -0
- package/build/esm/cc/manufacturerProprietary/Decorators.js +79 -0
- package/build/esm/cc/manufacturerProprietary/Decorators.js.map +1 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +79 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +489 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -0
- package/build/esm/index.d.ts +15 -0
- package/build/esm/index.d.ts.map +1 -0
- package/build/esm/index.js +14 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/index_safe.d.ts +3 -0
- package/build/esm/index_safe.d.ts.map +1 -0
- package/build/esm/index_safe.js +4 -0
- package/build/esm/index_safe.js.map +1 -0
- package/build/esm/lib/API.d.ts +271 -0
- package/build/esm/lib/API.d.ts.map +1 -0
- package/build/esm/lib/API.js +448 -0
- package/build/esm/lib/API.js.map +1 -0
- package/build/esm/lib/CommandClass.d.ts +234 -0
- package/build/esm/lib/CommandClass.d.ts.map +1 -0
- package/build/esm/lib/CommandClass.js +781 -0
- package/build/esm/lib/CommandClass.js.map +1 -0
- package/build/esm/lib/CommandClassDecorators.d.ts +108 -0
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -0
- package/build/esm/lib/CommandClassDecorators.js +229 -0
- package/build/esm/lib/CommandClassDecorators.js.map +1 -0
- package/build/esm/lib/EncapsulatingCommandClass.d.ts +22 -0
- package/build/esm/lib/EncapsulatingCommandClass.d.ts.map +1 -0
- package/build/esm/lib/EncapsulatingCommandClass.js +56 -0
- package/build/esm/lib/EncapsulatingCommandClass.js.map +1 -0
- package/build/esm/lib/ICommandClassContainer.d.ts +2 -0
- package/build/esm/lib/ICommandClassContainer.d.ts.map +1 -0
- package/build/esm/lib/ICommandClassContainer.js +2 -0
- package/build/esm/lib/ICommandClassContainer.js.map +1 -0
- package/build/esm/lib/NotificationEventPayload.d.ts +10 -0
- package/build/esm/lib/NotificationEventPayload.d.ts.map +1 -0
- package/build/esm/lib/NotificationEventPayload.js +7 -0
- package/build/esm/lib/NotificationEventPayload.js.map +1 -0
- package/build/esm/lib/Security2/Extension.d.ts +106 -0
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -0
- package/build/esm/lib/Security2/Extension.js +380 -0
- package/build/esm/lib/Security2/Extension.js.map +1 -0
- package/build/esm/lib/Security2/shared.d.ts +37 -0
- package/build/esm/lib/Security2/shared.d.ts.map +1 -0
- package/build/esm/lib/Security2/shared.js +40 -0
- package/build/esm/lib/Security2/shared.js.map +1 -0
- package/build/esm/lib/SetValueResult.d.ts +55 -0
- package/build/esm/lib/SetValueResult.d.ts.map +1 -0
- package/build/esm/lib/SetValueResult.js +53 -0
- package/build/esm/lib/SetValueResult.js.map +1 -0
- package/build/esm/lib/Values.d.ts +223 -0
- package/build/esm/lib/Values.d.ts.map +1 -0
- package/build/esm/lib/Values.js +169 -0
- package/build/esm/lib/Values.js.map +1 -0
- package/build/esm/lib/_Types.d.ts +1461 -0
- package/build/esm/lib/_Types.d.ts.map +1 -0
- package/build/esm/lib/_Types.js +1432 -0
- package/build/esm/lib/_Types.js.map +1 -0
- package/build/esm/lib/serializers.d.ts +34 -0
- package/build/esm/lib/serializers.d.ts.map +1 -0
- package/build/esm/lib/serializers.js +98 -0
- package/build/esm/lib/serializers.js.map +1 -0
- package/build/esm/lib/utils.d.ts +17 -0
- package/build/esm/lib/utils.d.ts.map +1 -0
- package/build/esm/lib/utils.js +847 -0
- package/build/esm/lib/utils.js.map +1 -0
- package/build/esm/package.json +3 -0
- package/package.json +28 -23
- package/build/cc/AlarmSensorCC.d.ts +0 -194
- package/build/cc/AlarmSensorCC.d.ts.map +0 -1
- package/build/cc/AlarmSensorCC.js +0 -395
- package/build/cc/AlarmSensorCC.js.map +0 -1
- package/build/cc/AssociationCC.d.ts +0 -253
- package/build/cc/AssociationCC.d.ts.map +0 -1
- package/build/cc/AssociationCC.js +0 -732
- package/build/cc/AssociationCC.js.map +0 -1
- package/build/cc/AssociationGroupInfoCC.d.ts +0 -230
- package/build/cc/AssociationGroupInfoCC.d.ts.map +0 -1
- package/build/cc/AssociationGroupInfoCC.js +0 -772
- package/build/cc/AssociationGroupInfoCC.js.map +0 -1
- package/build/cc/BarrierOperatorCC.d.ts +0 -243
- package/build/cc/BarrierOperatorCC.d.ts.map +0 -1
- package/build/cc/BarrierOperatorCC.js +0 -613
- package/build/cc/BarrierOperatorCC.js.map +0 -1
- package/build/cc/BasicCC.d.ts +0 -191
- package/build/cc/BasicCC.d.ts.map +0 -1
- package/build/cc/BasicCC.js +0 -393
- package/build/cc/BasicCC.js.map +0 -1
- package/build/cc/BatteryCC.d.ts +0 -406
- package/build/cc/BatteryCC.d.ts.map +0 -1
- package/build/cc/BatteryCC.js +0 -516
- package/build/cc/BatteryCC.js.map +0 -1
- package/build/cc/BinarySensorCC.d.ts +0 -122
- package/build/cc/BinarySensorCC.d.ts.map +0 -1
- package/build/cc/BinarySensorCC.js +0 -420
- package/build/cc/BinarySensorCC.js.map +0 -1
- package/build/cc/BinarySwitchCC.d.ts +0 -139
- package/build/cc/BinarySwitchCC.d.ts.map +0 -1
- package/build/cc/BinarySwitchCC.js +0 -365
- package/build/cc/BinarySwitchCC.js.map +0 -1
- package/build/cc/CRC16CC.d.ts +0 -29
- package/build/cc/CRC16CC.d.ts.map +0 -1
- package/build/cc/CRC16CC.js +0 -126
- package/build/cc/CRC16CC.js.map +0 -1
- package/build/cc/CentralSceneCC.d.ts +0 -210
- package/build/cc/CentralSceneCC.d.ts.map +0 -1
- package/build/cc/CentralSceneCC.js +0 -453
- package/build/cc/CentralSceneCC.js.map +0 -1
- package/build/cc/ClimateControlScheduleCC.d.ts +0 -177
- package/build/cc/ClimateControlScheduleCC.d.ts.map +0 -1
- package/build/cc/ClimateControlScheduleCC.js +0 -469
- package/build/cc/ClimateControlScheduleCC.js.map +0 -1
- package/build/cc/ClockCC.d.ts +0 -47
- package/build/cc/ClockCC.d.ts.map +0 -1
- package/build/cc/ClockCC.js +0 -208
- package/build/cc/ClockCC.js.map +0 -1
- package/build/cc/ColorSwitchCC.d.ts +0 -339
- package/build/cc/ColorSwitchCC.d.ts.map +0 -1
- package/build/cc/ColorSwitchCC.js +0 -1152
- package/build/cc/ColorSwitchCC.js.map +0 -1
- package/build/cc/ConfigurationCC.d.ts +0 -396
- package/build/cc/ConfigurationCC.d.ts.map +0 -1
- package/build/cc/ConfigurationCC.js +0 -2458
- package/build/cc/ConfigurationCC.js.map +0 -1
- package/build/cc/DeviceResetLocallyCC.d.ts +0 -17
- package/build/cc/DeviceResetLocallyCC.d.ts.map +0 -1
- package/build/cc/DeviceResetLocallyCC.js +0 -76
- package/build/cc/DeviceResetLocallyCC.js.map +0 -1
- package/build/cc/DoorLockCC.d.ts +0 -837
- package/build/cc/DoorLockCC.d.ts.map +0 -1
- package/build/cc/DoorLockCC.js +0 -1273
- package/build/cc/DoorLockCC.js.map +0 -1
- package/build/cc/DoorLockLoggingCC.d.ts +0 -77
- package/build/cc/DoorLockLoggingCC.d.ts.map +0 -1
- package/build/cc/DoorLockLoggingCC.js +0 -319
- package/build/cc/DoorLockLoggingCC.js.map +0 -1
- package/build/cc/EnergyProductionCC.d.ts +0 -77
- package/build/cc/EnergyProductionCC.d.ts.map +0 -1
- package/build/cc/EnergyProductionCC.js +0 -216
- package/build/cc/EnergyProductionCC.js.map +0 -1
- package/build/cc/EntryControlCC.d.ts +0 -231
- package/build/cc/EntryControlCC.d.ts.map +0 -1
- package/build/cc/EntryControlCC.js +0 -607
- package/build/cc/EntryControlCC.js.map +0 -1
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts +0 -359
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts.map +0 -1
- package/build/cc/FirmwareUpdateMetaDataCC.js +0 -1145
- package/build/cc/FirmwareUpdateMetaDataCC.js.map +0 -1
- package/build/cc/HailCC.d.ts +0 -6
- package/build/cc/HailCC.d.ts.map +0 -1
- package/build/cc/HailCC.js +0 -24
- package/build/cc/HailCC.js.map +0 -1
- package/build/cc/HumidityControlModeCC.d.ts +0 -111
- package/build/cc/HumidityControlModeCC.d.ts.map +0 -1
- package/build/cc/HumidityControlModeCC.js +0 -308
- package/build/cc/HumidityControlModeCC.js.map +0 -1
- package/build/cc/HumidityControlOperatingStateCC.d.ts +0 -60
- package/build/cc/HumidityControlOperatingStateCC.d.ts.map +0 -1
- package/build/cc/HumidityControlOperatingStateCC.js +0 -140
- package/build/cc/HumidityControlOperatingStateCC.js.map +0 -1
- package/build/cc/HumidityControlSetpointCC.d.ts +0 -209
- package/build/cc/HumidityControlSetpointCC.d.ts.map +0 -1
- package/build/cc/HumidityControlSetpointCC.js +0 -648
- package/build/cc/HumidityControlSetpointCC.js.map +0 -1
- package/build/cc/InclusionControllerCC.d.ts +0 -42
- package/build/cc/InclusionControllerCC.d.ts.map +0 -1
- package/build/cc/InclusionControllerCC.js +0 -136
- package/build/cc/InclusionControllerCC.js.map +0 -1
- package/build/cc/IndicatorCC.d.ts +0 -338
- package/build/cc/IndicatorCC.d.ts.map +0 -1
- package/build/cc/IndicatorCC.js +0 -1320
- package/build/cc/IndicatorCC.js.map +0 -1
- package/build/cc/IrrigationCC.d.ts +0 -1496
- package/build/cc/IrrigationCC.d.ts.map +0 -1
- package/build/cc/IrrigationCC.js +0 -2041
- package/build/cc/IrrigationCC.js.map +0 -1
- package/build/cc/LanguageCC.d.ts +0 -101
- package/build/cc/LanguageCC.d.ts.map +0 -1
- package/build/cc/LanguageCC.js +0 -246
- package/build/cc/LanguageCC.js.map +0 -1
- package/build/cc/LockCC.d.ts +0 -73
- package/build/cc/LockCC.d.ts.map +0 -1
- package/build/cc/LockCC.js +0 -200
- package/build/cc/LockCC.js.map +0 -1
- package/build/cc/ManufacturerProprietaryCC.d.ts +0 -32
- package/build/cc/ManufacturerProprietaryCC.d.ts.map +0 -1
- package/build/cc/ManufacturerProprietaryCC.js +0 -204
- package/build/cc/ManufacturerProprietaryCC.js.map +0 -1
- package/build/cc/ManufacturerSpecificCC.d.ts +0 -171
- package/build/cc/ManufacturerSpecificCC.d.ts.map +0 -1
- package/build/cc/ManufacturerSpecificCC.js +0 -318
- package/build/cc/ManufacturerSpecificCC.js.map +0 -1
- package/build/cc/MeterCC.d.ts +0 -318
- package/build/cc/MeterCC.d.ts.map +0 -1
- package/build/cc/MeterCC.js +0 -1312
- package/build/cc/MeterCC.js.map +0 -1
- package/build/cc/MultiChannelAssociationCC.d.ts +0 -241
- package/build/cc/MultiChannelAssociationCC.d.ts.map +0 -1
- package/build/cc/MultiChannelAssociationCC.js +0 -1007
- package/build/cc/MultiChannelAssociationCC.js.map +0 -1
- package/build/cc/MultiChannelCC.d.ts +0 -394
- package/build/cc/MultiChannelCC.d.ts.map +0 -1
- package/build/cc/MultiChannelCC.js +0 -1130
- package/build/cc/MultiChannelCC.js.map +0 -1
- package/build/cc/MultiCommandCC.d.ts +0 -27
- package/build/cc/MultiCommandCC.d.ts.map +0 -1
- package/build/cc/MultiCommandCC.js +0 -145
- package/build/cc/MultiCommandCC.js.map +0 -1
- package/build/cc/MultilevelSensorCC.d.ts +0 -185
- package/build/cc/MultilevelSensorCC.d.ts.map +0 -1
- package/build/cc/MultilevelSensorCC.js +0 -756
- package/build/cc/MultilevelSensorCC.js.map +0 -1
- package/build/cc/MultilevelSwitchCC.d.ts +0 -357
- package/build/cc/MultilevelSwitchCC.d.ts.map +0 -1
- package/build/cc/MultilevelSwitchCC.js +0 -813
- package/build/cc/MultilevelSwitchCC.js.map +0 -1
- package/build/cc/NoOperationCC.d.ts +0 -9
- package/build/cc/NoOperationCC.d.ts.map +0 -1
- package/build/cc/NoOperationCC.js +0 -42
- package/build/cc/NoOperationCC.js.map +0 -1
- package/build/cc/NodeNamingCC.d.ts +0 -118
- package/build/cc/NodeNamingCC.d.ts.map +0 -1
- package/build/cc/NodeNamingCC.js +0 -348
- package/build/cc/NodeNamingCC.js.map +0 -1
- package/build/cc/NotificationCC.d.ts +0 -479
- package/build/cc/NotificationCC.d.ts.map +0 -1
- package/build/cc/NotificationCC.js +0 -1379
- package/build/cc/NotificationCC.js.map +0 -1
- package/build/cc/PowerlevelCC.d.ts +0 -82
- package/build/cc/PowerlevelCC.d.ts.map +0 -1
- package/build/cc/PowerlevelCC.js +0 -488
- package/build/cc/PowerlevelCC.js.map +0 -1
- package/build/cc/ProtectionCC.d.ts +0 -325
- package/build/cc/ProtectionCC.d.ts.map +0 -1
- package/build/cc/ProtectionCC.js +0 -672
- package/build/cc/ProtectionCC.js.map +0 -1
- package/build/cc/SceneActivationCC.d.ts +0 -89
- package/build/cc/SceneActivationCC.d.ts.map +0 -1
- package/build/cc/SceneActivationCC.js +0 -169
- package/build/cc/SceneActivationCC.js.map +0 -1
- package/build/cc/SceneActuatorConfigurationCC.d.ts +0 -120
- package/build/cc/SceneActuatorConfigurationCC.d.ts.map +0 -1
- package/build/cc/SceneActuatorConfigurationCC.js +0 -377
- package/build/cc/SceneActuatorConfigurationCC.js.map +0 -1
- package/build/cc/SceneControllerConfigurationCC.d.ts +0 -129
- package/build/cc/SceneControllerConfigurationCC.d.ts.map +0 -1
- package/build/cc/SceneControllerConfigurationCC.js +0 -449
- package/build/cc/SceneControllerConfigurationCC.js.map +0 -1
- package/build/cc/ScheduleEntryLockCC.d.ts +0 -434
- package/build/cc/ScheduleEntryLockCC.d.ts.map +0 -1
- package/build/cc/ScheduleEntryLockCC.js +0 -1829
- package/build/cc/ScheduleEntryLockCC.js.map +0 -1
- package/build/cc/Security2CC.d.ts +0 -251
- package/build/cc/Security2CC.d.ts.map +0 -1
- package/build/cc/Security2CC.js +0 -1817
- package/build/cc/Security2CC.js.map +0 -1
- package/build/cc/SecurityCC.d.ts +0 -128
- package/build/cc/SecurityCC.d.ts.map +0 -1
- package/build/cc/SecurityCC.js +0 -803
- package/build/cc/SecurityCC.js.map +0 -1
- package/build/cc/SoundSwitchCC.d.ts +0 -232
- package/build/cc/SoundSwitchCC.d.ts.map +0 -1
- package/build/cc/SoundSwitchCC.js +0 -636
- package/build/cc/SoundSwitchCC.js.map +0 -1
- package/build/cc/SupervisionCC.d.ts +0 -104
- package/build/cc/SupervisionCC.d.ts.map +0 -1
- package/build/cc/SupervisionCC.js +0 -322
- package/build/cc/SupervisionCC.js.map +0 -1
- package/build/cc/ThermostatFanModeCC.d.ts +0 -141
- package/build/cc/ThermostatFanModeCC.d.ts.map +0 -1
- package/build/cc/ThermostatFanModeCC.js +0 -362
- package/build/cc/ThermostatFanModeCC.js.map +0 -1
- package/build/cc/ThermostatFanStateCC.d.ts +0 -60
- package/build/cc/ThermostatFanStateCC.d.ts.map +0 -1
- package/build/cc/ThermostatFanStateCC.js +0 -142
- package/build/cc/ThermostatFanStateCC.js.map +0 -1
- package/build/cc/ThermostatModeCC.d.ts +0 -150
- package/build/cc/ThermostatModeCC.d.ts.map +0 -1
- package/build/cc/ThermostatModeCC.js +0 -429
- package/build/cc/ThermostatModeCC.js.map +0 -1
- package/build/cc/ThermostatOperatingStateCC.d.ts +0 -61
- package/build/cc/ThermostatOperatingStateCC.d.ts.map +0 -1
- package/build/cc/ThermostatOperatingStateCC.js +0 -138
- package/build/cc/ThermostatOperatingStateCC.js.map +0 -1
- package/build/cc/ThermostatSetbackCC.d.ts +0 -46
- package/build/cc/ThermostatSetbackCC.d.ts.map +0 -1
- package/build/cc/ThermostatSetbackCC.js +0 -247
- package/build/cc/ThermostatSetbackCC.js.map +0 -1
- package/build/cc/ThermostatSetpointCC.d.ts +0 -197
- package/build/cc/ThermostatSetpointCC.d.ts.map +0 -1
- package/build/cc/ThermostatSetpointCC.js +0 -658
- package/build/cc/ThermostatSetpointCC.js.map +0 -1
- package/build/cc/TimeCC.d.ts +0 -88
- package/build/cc/TimeCC.d.ts.map +0 -1
- package/build/cc/TimeCC.js +0 -454
- package/build/cc/TimeCC.js.map +0 -1
- package/build/cc/TimeParametersCC.d.ts +0 -72
- package/build/cc/TimeParametersCC.d.ts.map +0 -1
- package/build/cc/TimeParametersCC.js +0 -303
- package/build/cc/TimeParametersCC.js.map +0 -1
- package/build/cc/TransportServiceCC.d.ts +0 -107
- package/build/cc/TransportServiceCC.d.ts.map +0 -1
- package/build/cc/TransportServiceCC.js +0 -426
- package/build/cc/TransportServiceCC.js.map +0 -1
- package/build/cc/UserCodeCC.d.ts +0 -683
- package/build/cc/UserCodeCC.d.ts.map +0 -1
- package/build/cc/UserCodeCC.js +0 -1699
- package/build/cc/UserCodeCC.js.map +0 -1
- package/build/cc/VersionCC.d.ts +0 -469
- package/build/cc/VersionCC.d.ts.map +0 -1
- package/build/cc/VersionCC.js +0 -865
- package/build/cc/VersionCC.js.map +0 -1
- package/build/cc/WakeUpCC.d.ts +0 -150
- package/build/cc/WakeUpCC.d.ts.map +0 -1
- package/build/cc/WakeUpCC.js +0 -441
- package/build/cc/WakeUpCC.js.map +0 -1
- package/build/cc/WindowCoveringCC.d.ts +0 -315
- package/build/cc/WindowCoveringCC.d.ts.map +0 -1
- package/build/cc/WindowCoveringCC.js +0 -783
- package/build/cc/WindowCoveringCC.js.map +0 -1
- package/build/cc/ZWaveLongRangeCC.d.ts +0 -4
- package/build/cc/ZWaveLongRangeCC.d.ts.map +0 -1
- package/build/cc/ZWaveLongRangeCC.js +0 -20
- package/build/cc/ZWaveLongRangeCC.js.map +0 -1
- package/build/cc/ZWavePlusCC.d.ts +0 -163
- package/build/cc/ZWavePlusCC.d.ts.map +0 -1
- package/build/cc/ZWavePlusCC.js +0 -270
- package/build/cc/ZWavePlusCC.js.map +0 -1
- package/build/cc/ZWaveProtocolCC.d.ts +0 -344
- package/build/cc/ZWaveProtocolCC.d.ts.map +0 -1
- package/build/cc/ZWaveProtocolCC.js +0 -1033
- package/build/cc/ZWaveProtocolCC.js.map +0 -1
- package/build/cc/index.d.ts +0 -132
- package/build/cc/index.d.ts.map +0 -1
- package/build/cc/index.js +0 -627
- package/build/cc/index.js.map +0 -1
- package/build/cc/manufacturerProprietary/Decorators.d.ts +0 -64
- package/build/cc/manufacturerProprietary/Decorators.d.ts.map +0 -1
- package/build/cc/manufacturerProprietary/Decorators.js +0 -83
- package/build/cc/manufacturerProprietary/Decorators.js.map +0 -1
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts +0 -79
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts.map +0 -1
- package/build/cc/manufacturerProprietary/FibaroCC.js +0 -392
- package/build/cc/manufacturerProprietary/FibaroCC.js.map +0 -1
- package/build/index.d.ts +0 -15
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -52
- package/build/index.js.map +0 -1
- package/build/index_safe.d.ts +0 -3
- package/build/index_safe.d.ts.map +0 -1
- package/build/index_safe.js +0 -20
- package/build/index_safe.js.map +0 -1
- package/build/lib/API.d.ts +0 -271
- package/build/lib/API.d.ts.map +0 -1
- package/build/lib/API.js +0 -458
- package/build/lib/API.js.map +0 -1
- package/build/lib/CommandClass.d.ts +0 -234
- package/build/lib/CommandClass.d.ts.map +0 -1
- package/build/lib/CommandClass.js +0 -788
- package/build/lib/CommandClass.js.map +0 -1
- package/build/lib/CommandClassDecorators.d.ts +0 -112
- package/build/lib/CommandClassDecorators.d.ts.map +0 -1
- package/build/lib/CommandClassDecorators.js +0 -243
- package/build/lib/CommandClassDecorators.js.map +0 -1
- package/build/lib/EncapsulatingCommandClass.d.ts +0 -22
- package/build/lib/EncapsulatingCommandClass.d.ts.map +0 -1
- package/build/lib/EncapsulatingCommandClass.js +0 -61
- package/build/lib/EncapsulatingCommandClass.js.map +0 -1
- package/build/lib/ICommandClassContainer.d.ts.map +0 -1
- package/build/lib/ICommandClassContainer.js +0 -3
- package/build/lib/ICommandClassContainer.js.map +0 -1
- package/build/lib/NotificationEventPayload.d.ts +0 -10
- package/build/lib/NotificationEventPayload.d.ts.map +0 -1
- package/build/lib/NotificationEventPayload.js +0 -10
- package/build/lib/NotificationEventPayload.js.map +0 -1
- package/build/lib/Security2/Extension.d.ts +0 -106
- package/build/lib/Security2/Extension.d.ts.map +0 -1
- package/build/lib/Security2/Extension.js +0 -303
- package/build/lib/Security2/Extension.js.map +0 -1
- package/build/lib/Security2/shared.d.ts.map +0 -1
- package/build/lib/Security2/shared.js +0 -43
- package/build/lib/Security2/shared.js.map +0 -1
- package/build/lib/SetValueResult.d.ts.map +0 -1
- package/build/lib/SetValueResult.js +0 -60
- package/build/lib/SetValueResult.js.map +0 -1
- package/build/lib/Values.d.ts +0 -223
- package/build/lib/Values.d.ts.map +0 -1
- package/build/lib/Values.js +0 -172
- package/build/lib/Values.js.map +0 -1
- package/build/lib/_Types.d.ts.map +0 -1
- package/build/lib/_Types.js +0 -1443
- package/build/lib/_Types.js.map +0 -1
- package/build/lib/serializers.d.ts +0 -34
- package/build/lib/serializers.d.ts.map +0 -1
- package/build/lib/serializers.js +0 -107
- package/build/lib/serializers.js.map +0 -1
- package/build/lib/utils.d.ts +0 -17
- package/build/lib/utils.d.ts.map +0 -1
- package/build/lib/utils.js +0 -860
- package/build/lib/utils.js.map +0 -1
- /package/build/{lib → cjs/lib}/ICommandClassContainer.d.ts +0 -0
- /package/build/{lib → cjs/lib}/Security2/shared.d.ts +0 -0
- /package/build/{lib → cjs/lib}/SetValueResult.d.ts +0 -0
- /package/build/{lib → cjs/lib}/_Types.d.ts +0 -0
package/build/cc/Security2CC.js
DELETED
|
@@ -1,1817 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var Security2CC_1, Security2CCMessageEncapsulation_1, Security2CCNonceReport_1, Security2CCNonceGet_1, Security2CCKEXReport_1, Security2CCKEXSet_1, Security2CCKEXFail_1, Security2CCPublicKeyReport_1, Security2CCNetworkKeyReport_1, Security2CCNetworkKeyGet_1, Security2CCTransferEnd_1, Security2CCCommandsSupportedReport_1;
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.Security2CCCommandsSupportedGet = exports.Security2CCCommandsSupportedReport = exports.Security2CCTransferEnd = exports.Security2CCNetworkKeyVerify = exports.Security2CCNetworkKeyGet = exports.Security2CCNetworkKeyReport = exports.Security2CCPublicKeyReport = exports.Security2CCKEXFail = exports.Security2CCKEXSet = exports.Security2CCKEXGet = exports.Security2CCKEXReport = exports.Security2CCNonceGet = exports.Security2CCNonceReport = exports.Security2CCMessageEncapsulation = exports.Security2CC = exports.Security2CCAPI = void 0;
|
|
11
|
-
const core_1 = require("@zwave-js/core");
|
|
12
|
-
const safe_1 = require("@zwave-js/core/safe");
|
|
13
|
-
const safe_2 = require("@zwave-js/shared/safe");
|
|
14
|
-
const safe_3 = require("@zwave-js/shared/safe");
|
|
15
|
-
const async_1 = require("alcalzone-shared/async");
|
|
16
|
-
const typeguards_1 = require("alcalzone-shared/typeguards");
|
|
17
|
-
const API_1 = require("../lib/API");
|
|
18
|
-
const CommandClass_1 = require("../lib/CommandClass");
|
|
19
|
-
const CommandClassDecorators_1 = require("../lib/CommandClassDecorators");
|
|
20
|
-
const Extension_1 = require("../lib/Security2/Extension");
|
|
21
|
-
const shared_1 = require("../lib/Security2/shared");
|
|
22
|
-
const _Types_1 = require("../lib/_Types");
|
|
23
|
-
const CRC16CC_1 = require("./CRC16CC");
|
|
24
|
-
const MultiChannelCC_1 = require("./MultiChannelCC");
|
|
25
|
-
const SecurityCC_1 = require("./SecurityCC");
|
|
26
|
-
const TransportServiceCC_1 = require("./TransportServiceCC");
|
|
27
|
-
function securityClassToBitMask(key) {
|
|
28
|
-
return (0, core_1.encodeBitMask)([key], core_1.SecurityClass.S0_Legacy, core_1.SecurityClass.S2_Unauthenticated);
|
|
29
|
-
}
|
|
30
|
-
function bitMaskToSecurityClass(buffer, offset) {
|
|
31
|
-
const keys = (0, core_1.parseBitMask)(buffer.subarray(offset, offset + 1), core_1.SecurityClass.S2_Unauthenticated);
|
|
32
|
-
(0, core_1.validatePayload)(keys.length === 1);
|
|
33
|
-
return keys[0];
|
|
34
|
-
}
|
|
35
|
-
function getAuthenticationData(sendingNodeId, destination, homeId, commandLength, unencryptedPayload) {
|
|
36
|
-
const nodeIdSize = (0, core_1.isLongRangeNodeId)(sendingNodeId) || (0, core_1.isLongRangeNodeId)(destination)
|
|
37
|
-
? 2
|
|
38
|
-
: 1;
|
|
39
|
-
const ret = new safe_2.Bytes(2 * nodeIdSize + 6 + unencryptedPayload.length);
|
|
40
|
-
let offset = 0;
|
|
41
|
-
ret.writeUIntBE(sendingNodeId, offset, nodeIdSize);
|
|
42
|
-
offset += nodeIdSize;
|
|
43
|
-
ret.writeUIntBE(destination, offset, nodeIdSize);
|
|
44
|
-
offset += nodeIdSize;
|
|
45
|
-
ret.writeUInt32BE(homeId, offset);
|
|
46
|
-
offset += 4;
|
|
47
|
-
ret.writeUInt16BE(commandLength, offset);
|
|
48
|
-
offset += 2;
|
|
49
|
-
// This includes the sequence number and all unencrypted extensions
|
|
50
|
-
ret.set(unencryptedPayload, offset);
|
|
51
|
-
return ret;
|
|
52
|
-
}
|
|
53
|
-
function getSecurityManager(ownNodeId, securityManagers, otherNodeId) {
|
|
54
|
-
const longRange = (0, core_1.isLongRangeNodeId)(ownNodeId)
|
|
55
|
-
|| (0, core_1.isLongRangeNodeId)((0, typeguards_1.isArray)(otherNodeId) ? otherNodeId[0] : otherNodeId);
|
|
56
|
-
return longRange
|
|
57
|
-
? securityManagers.securityManagerLR
|
|
58
|
-
: securityManagers.securityManager2;
|
|
59
|
-
}
|
|
60
|
-
/** Validates that a sequence number is not a duplicate and updates the SPAN table if it is accepted. Returns the previous sequence number if there is one. */
|
|
61
|
-
function validateSequenceNumber(securityManager, sourceNodeId, sequenceNumber) {
|
|
62
|
-
core_1.validatePayload.withReason(`Duplicate command (sequence number ${sequenceNumber})`)(!securityManager.isDuplicateSinglecast(sourceNodeId, sequenceNumber));
|
|
63
|
-
// Not a duplicate, store it
|
|
64
|
-
return securityManager.storeSequenceNumber(sourceNodeId, sequenceNumber);
|
|
65
|
-
}
|
|
66
|
-
const MAX_DECRYPT_ATTEMPTS_SINGLECAST = 5;
|
|
67
|
-
const MAX_DECRYPT_ATTEMPTS_MULTICAST = 5;
|
|
68
|
-
const MAX_DECRYPT_ATTEMPTS_SC_FOLLOWUP = 1;
|
|
69
|
-
function assertSecurityRX(ctx) {
|
|
70
|
-
if (!ctx.ownNodeId) {
|
|
71
|
-
throw new core_1.ZWaveError(`Secure commands (S2) can only be decoded when the controller's node id is known!`, core_1.ZWaveErrorCodes.Driver_NotReady);
|
|
72
|
-
}
|
|
73
|
-
const ret = getSecurityManager(ctx.ownNodeId, ctx, ctx.sourceNodeId);
|
|
74
|
-
if (!ret) {
|
|
75
|
-
throw new core_1.ZWaveError(`Secure commands (S2) can only be decoded when the security manager is set up!`, core_1.ZWaveErrorCodes.Driver_NoSecurity);
|
|
76
|
-
}
|
|
77
|
-
return ret;
|
|
78
|
-
}
|
|
79
|
-
function assertSecurityTX(ctx, destination) {
|
|
80
|
-
if (!ctx.ownNodeId) {
|
|
81
|
-
throw new core_1.ZWaveError(`Secure commands (S2) can only be sent when the controller's node id is known!`, core_1.ZWaveErrorCodes.Driver_NotReady);
|
|
82
|
-
}
|
|
83
|
-
const ret = getSecurityManager(ctx.ownNodeId, ctx, destination);
|
|
84
|
-
if (!ret) {
|
|
85
|
-
throw new core_1.ZWaveError(`Secure commands (S2) can only be sent when the security manager is set up!`, core_1.ZWaveErrorCodes.Driver_NoSecurity);
|
|
86
|
-
}
|
|
87
|
-
return ret;
|
|
88
|
-
}
|
|
89
|
-
function decryptSinglecast(ctx, securityManager, sendingNodeId, curSequenceNumber, prevSequenceNumber, ciphertext, authData, authTag, spanState, extensions) {
|
|
90
|
-
const decryptWithNonce = (nonce) => {
|
|
91
|
-
const { keyCCM: key } = securityManager.getKeysForNode(sendingNodeId);
|
|
92
|
-
const iv = nonce;
|
|
93
|
-
return {
|
|
94
|
-
key,
|
|
95
|
-
iv,
|
|
96
|
-
...(0, core_1.decryptAES128CCM)(key, iv, ciphertext, authData, authTag),
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
const getNonceAndDecrypt = () => {
|
|
100
|
-
const iv = securityManager.nextNonce(sendingNodeId);
|
|
101
|
-
return decryptWithNonce(iv);
|
|
102
|
-
};
|
|
103
|
-
if (spanState.type === core_1.SPANState.SPAN) {
|
|
104
|
-
// There SHOULD be a shared SPAN between both parties. But experience has shown that both could have
|
|
105
|
-
// sent a command at roughly the same time, using the same SPAN for encryption.
|
|
106
|
-
// To avoid a nasty desync and both nodes trying to resync at the same time, causing message loss,
|
|
107
|
-
// we accept commands encrypted with the previous SPAN under very specific circumstances:
|
|
108
|
-
if (
|
|
109
|
-
// The previous SPAN is still known, i.e. the node didn't send another command that was successfully decrypted
|
|
110
|
-
!!spanState.currentSPAN
|
|
111
|
-
// it is still valid
|
|
112
|
-
&& spanState.currentSPAN.expires > (0, core_1.highResTimestamp)()
|
|
113
|
-
// The received command is exactly the next, expected one
|
|
114
|
-
&& prevSequenceNumber != undefined
|
|
115
|
-
&& curSequenceNumber === ((prevSequenceNumber + 1) & 0xff)
|
|
116
|
-
// And in case of a mock-based test, do this only on the controller
|
|
117
|
-
&& !ctx.__internalIsMockNode) {
|
|
118
|
-
const nonce = spanState.currentSPAN.nonce;
|
|
119
|
-
spanState.currentSPAN = undefined;
|
|
120
|
-
// If we could decrypt this way, we're done...
|
|
121
|
-
const result = decryptWithNonce(nonce);
|
|
122
|
-
if (result.authOK) {
|
|
123
|
-
return {
|
|
124
|
-
...result,
|
|
125
|
-
securityClass: spanState.securityClass,
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
// ...otherwise, we need to try the normal way
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
// forgetting the current SPAN shouldn't be necessary but better be safe than sorry
|
|
132
|
-
spanState.currentSPAN = undefined;
|
|
133
|
-
}
|
|
134
|
-
// This can only happen if the security class is known
|
|
135
|
-
return {
|
|
136
|
-
...getNonceAndDecrypt(),
|
|
137
|
-
securityClass: spanState.securityClass,
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
else if (spanState.type === core_1.SPANState.LocalEI) {
|
|
141
|
-
// We've sent the other our receiver's EI and received its sender's EI,
|
|
142
|
-
// meaning we can now establish an SPAN
|
|
143
|
-
const senderEI = getSenderEI(extensions);
|
|
144
|
-
if (!senderEI)
|
|
145
|
-
failNoSPAN();
|
|
146
|
-
const receiverEI = spanState.receiverEI;
|
|
147
|
-
// How we do this depends on whether we know the security class of the other node
|
|
148
|
-
const isBootstrappingNode = securityManager.tempKeys.has(sendingNodeId);
|
|
149
|
-
if (isBootstrappingNode) {
|
|
150
|
-
// We're currently bootstrapping the node, it might be using a temporary key
|
|
151
|
-
securityManager.initializeTempSPAN(sendingNodeId, senderEI, receiverEI);
|
|
152
|
-
const ret = getNonceAndDecrypt();
|
|
153
|
-
// Decryption with the temporary key worked
|
|
154
|
-
if (ret.authOK) {
|
|
155
|
-
return {
|
|
156
|
-
...ret,
|
|
157
|
-
securityClass: core_1.SecurityClass.Temporary,
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
// Reset the SPAN state and try with the recently granted security class
|
|
161
|
-
securityManager.setSPANState(sendingNodeId, spanState);
|
|
162
|
-
}
|
|
163
|
-
// When ending up here, one of two situations has occured:
|
|
164
|
-
// a) We've taken over an existing network and do not know the node's security class
|
|
165
|
-
// b) We know the security class, but we're about to establish a new SPAN. This may happen at a lower
|
|
166
|
-
// security class than the one the node normally uses, e.g. when we're being queried for securely
|
|
167
|
-
// supported CCs.
|
|
168
|
-
// In both cases, we should simply try decoding with multiple security classes, starting from the highest one.
|
|
169
|
-
// If this fails, we restore the previous (partial) SPAN state.
|
|
170
|
-
// Try all security classes where we do not definitely know that it was not granted
|
|
171
|
-
// While bootstrapping a node, we consider the key that is being exchanged (including S0) to be the highest. No need to look at others
|
|
172
|
-
const possibleSecurityClasses = isBootstrappingNode
|
|
173
|
-
? [ctx.getHighestSecurityClass(sendingNodeId)]
|
|
174
|
-
: core_1.securityClassOrder.filter((s) => ctx.hasSecurityClass(sendingNodeId, s)
|
|
175
|
-
!== false);
|
|
176
|
-
for (const secClass of possibleSecurityClasses) {
|
|
177
|
-
// Skip security classes we don't have keys for
|
|
178
|
-
if (!securityManager.hasKeysForSecurityClass(secClass)) {
|
|
179
|
-
continue;
|
|
180
|
-
}
|
|
181
|
-
// Initialize an SPAN with that security class
|
|
182
|
-
securityManager.initializeSPAN(sendingNodeId, secClass, senderEI, receiverEI);
|
|
183
|
-
const ret = getNonceAndDecrypt();
|
|
184
|
-
// It worked, return the result
|
|
185
|
-
if (ret.authOK) {
|
|
186
|
-
// Also if we weren't sure before, we now know that the security class is granted
|
|
187
|
-
if (ctx.hasSecurityClass(sendingNodeId, secClass)
|
|
188
|
-
=== undefined) {
|
|
189
|
-
ctx.setSecurityClass(sendingNodeId, secClass, true);
|
|
190
|
-
}
|
|
191
|
-
return {
|
|
192
|
-
...ret,
|
|
193
|
-
securityClass: secClass,
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
// Reset the SPAN state and try with the next security class
|
|
198
|
-
securityManager.setSPANState(sendingNodeId, spanState);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
// Nothing worked, fail the decryption
|
|
203
|
-
return {
|
|
204
|
-
plaintext: new Uint8Array(),
|
|
205
|
-
authOK: false,
|
|
206
|
-
securityClass: undefined,
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
function decryptMulticast(sendingNodeId, securityManager, groupId, ciphertext, authData, authTag) {
|
|
210
|
-
const iv = securityManager.nextPeerMPAN(sendingNodeId, groupId);
|
|
211
|
-
const { keyCCM: key } = securityManager.getKeysForNode(sendingNodeId);
|
|
212
|
-
return {
|
|
213
|
-
key,
|
|
214
|
-
iv,
|
|
215
|
-
...(0, core_1.decryptAES128CCM)(key, iv, ciphertext, authData, authTag),
|
|
216
|
-
// The security class is irrelevant when decrypting multicast commands
|
|
217
|
-
securityClass: undefined,
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
function getDestinationIDTX() {
|
|
221
|
-
if (this.isSinglecast())
|
|
222
|
-
return this.nodeId;
|
|
223
|
-
const ret = getMulticastGroupId(this.extensions);
|
|
224
|
-
if (ret == undefined) {
|
|
225
|
-
throw new core_1.ZWaveError("Multicast Security S2 encapsulation requires the MGRP extension", core_1.ZWaveErrorCodes.Security2CC_MissingExtension);
|
|
226
|
-
}
|
|
227
|
-
return ret;
|
|
228
|
-
}
|
|
229
|
-
function getDestinationIDRX(ctx, extensions) {
|
|
230
|
-
if (ctx.frameType === "singlecast") {
|
|
231
|
-
return ctx.ownNodeId;
|
|
232
|
-
}
|
|
233
|
-
const ret = getMulticastGroupId(extensions);
|
|
234
|
-
if (ret == undefined) {
|
|
235
|
-
throw new core_1.ZWaveError("Multicast Security S2 encapsulation requires the MGRP extension", core_1.ZWaveErrorCodes.Security2CC_MissingExtension);
|
|
236
|
-
}
|
|
237
|
-
return ret;
|
|
238
|
-
}
|
|
239
|
-
function getMulticastGroupId(extensions) {
|
|
240
|
-
const mgrpExtension = extensions.find((e) => e instanceof Extension_1.MGRPExtension);
|
|
241
|
-
return mgrpExtension?.groupId;
|
|
242
|
-
}
|
|
243
|
-
/** Returns the Sender's Entropy Input if this command contains an SPAN extension */
|
|
244
|
-
function getSenderEI(extensions) {
|
|
245
|
-
const spanExtension = extensions.find((e) => e instanceof Extension_1.SPANExtension);
|
|
246
|
-
return spanExtension?.senderEI;
|
|
247
|
-
}
|
|
248
|
-
// Encapsulation CCs are used internally and too frequently that we
|
|
249
|
-
// want to pay the cost of validating each call
|
|
250
|
-
/* eslint-disable @zwave-js/ccapi-validate-args */
|
|
251
|
-
let Security2CCAPI = class Security2CCAPI extends API_1.CCAPI {
|
|
252
|
-
supportsCommand(_cmd) {
|
|
253
|
-
// All commands are mandatory
|
|
254
|
-
return true;
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Sends a nonce to the node, either in response to a NonceGet request or a message that failed to decrypt. The message is sent without any retransmission etc.
|
|
258
|
-
* The return value indicates whether a nonce was successfully sent
|
|
259
|
-
*/
|
|
260
|
-
async sendNonce() {
|
|
261
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.NonceReport);
|
|
262
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
263
|
-
const securityManager = getSecurityManager(this.host.ownNodeId, this.host, this.endpoint.nodeId);
|
|
264
|
-
if (!securityManager) {
|
|
265
|
-
throw new core_1.ZWaveError(`Nonces can only be sent if secure communication is set up!`, core_1.ZWaveErrorCodes.Driver_NoSecurity);
|
|
266
|
-
}
|
|
267
|
-
const receiverEI = securityManager.generateNonce(this.endpoint.nodeId);
|
|
268
|
-
const cc = new Security2CCNonceReport({
|
|
269
|
-
nodeId: this.endpoint.nodeId,
|
|
270
|
-
endpointIndex: this.endpoint.index,
|
|
271
|
-
SOS: true,
|
|
272
|
-
MOS: false,
|
|
273
|
-
receiverEI,
|
|
274
|
-
});
|
|
275
|
-
try {
|
|
276
|
-
await this.host.sendCommand(cc, {
|
|
277
|
-
...this.commandOptions,
|
|
278
|
-
// Seems we need these options or some nodes won't accept the nonce
|
|
279
|
-
transmitOptions: core_1.TransmitOptions.ACK
|
|
280
|
-
| core_1.TransmitOptions.AutoRoute,
|
|
281
|
-
// Only try sending a nonce once
|
|
282
|
-
maxSendAttempts: 1,
|
|
283
|
-
// Nonce requests must be handled immediately
|
|
284
|
-
priority: core_1.MessagePriority.Immediate,
|
|
285
|
-
// We don't want failures causing us to treat the node as asleep or dead
|
|
286
|
-
changeNodeStatusOnMissingACK: false,
|
|
287
|
-
// And we need to react to
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
catch (e) {
|
|
291
|
-
if ((0, core_1.isTransmissionError)(e)) {
|
|
292
|
-
// The nonce could not be sent, invalidate it
|
|
293
|
-
securityManager.deleteNonce(this.endpoint.nodeId);
|
|
294
|
-
return false;
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
// Pass other errors through
|
|
298
|
-
throw e;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
return true;
|
|
302
|
-
}
|
|
303
|
-
/** Notifies the target node that the MPAN state is out of sync */
|
|
304
|
-
async sendMOS() {
|
|
305
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.NonceReport);
|
|
306
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
307
|
-
const cc = new Security2CCNonceReport({
|
|
308
|
-
nodeId: this.endpoint.nodeId,
|
|
309
|
-
endpointIndex: this.endpoint.index,
|
|
310
|
-
SOS: false,
|
|
311
|
-
MOS: true,
|
|
312
|
-
});
|
|
313
|
-
try {
|
|
314
|
-
await this.host.sendCommand(cc, {
|
|
315
|
-
...this.commandOptions,
|
|
316
|
-
// Seems we need these options or some nodes won't accept the nonce
|
|
317
|
-
transmitOptions: core_1.TransmitOptions.ACK
|
|
318
|
-
| core_1.TransmitOptions.AutoRoute,
|
|
319
|
-
// Only try sending a nonce once
|
|
320
|
-
maxSendAttempts: 1,
|
|
321
|
-
// Nonce requests must be handled immediately
|
|
322
|
-
priority: core_1.MessagePriority.Immediate,
|
|
323
|
-
// We don't want failures causing us to treat the node as asleep or dead
|
|
324
|
-
changeNodeStatusOnMissingACK: false,
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
catch (e) {
|
|
328
|
-
if ((0, core_1.isTransmissionError)(e)) {
|
|
329
|
-
return false;
|
|
330
|
-
}
|
|
331
|
-
else {
|
|
332
|
-
// Pass other errors through
|
|
333
|
-
throw e;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
return true;
|
|
337
|
-
}
|
|
338
|
-
/** Sends the given MPAN to the node */
|
|
339
|
-
async sendMPAN(groupId, innerMPANState) {
|
|
340
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.MessageEncapsulation);
|
|
341
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
342
|
-
const cc = new Security2CCMessageEncapsulation({
|
|
343
|
-
nodeId: this.endpoint.nodeId,
|
|
344
|
-
endpointIndex: this.endpoint.index,
|
|
345
|
-
extensions: [
|
|
346
|
-
new Extension_1.MPANExtension({
|
|
347
|
-
groupId,
|
|
348
|
-
innerMPANState,
|
|
349
|
-
}),
|
|
350
|
-
],
|
|
351
|
-
});
|
|
352
|
-
try {
|
|
353
|
-
await this.host.sendCommand(cc, {
|
|
354
|
-
...this.commandOptions,
|
|
355
|
-
// Seems we need these options or some nodes won't accept the nonce
|
|
356
|
-
transmitOptions: core_1.TransmitOptions.ACK
|
|
357
|
-
| core_1.TransmitOptions.AutoRoute,
|
|
358
|
-
// Only try sending a nonce once
|
|
359
|
-
maxSendAttempts: 1,
|
|
360
|
-
// Nonce requests must be handled immediately
|
|
361
|
-
priority: core_1.MessagePriority.Immediate,
|
|
362
|
-
// We don't want failures causing us to treat the node as asleep or dead
|
|
363
|
-
changeNodeStatusOnMissingACK: false,
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
catch (e) {
|
|
367
|
-
if ((0, core_1.isTransmissionError)(e)) {
|
|
368
|
-
return false;
|
|
369
|
-
}
|
|
370
|
-
else {
|
|
371
|
-
// Pass other errors through
|
|
372
|
-
throw e;
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
return true;
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* Queries the securely supported commands for the current security class
|
|
379
|
-
* @param securityClass Can be used to overwrite the security class to use. If this doesn't match the current one, new nonces will need to be exchanged.
|
|
380
|
-
*/
|
|
381
|
-
async getSupportedCommands(securityClass) {
|
|
382
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.CommandsSupportedGet);
|
|
383
|
-
let cc = new Security2CCCommandsSupportedGet({
|
|
384
|
-
nodeId: this.endpoint.nodeId,
|
|
385
|
-
endpointIndex: this.endpoint.index,
|
|
386
|
-
});
|
|
387
|
-
// Security2CCCommandsSupportedGet is special because we cannot reply on the applHost to do the automatic
|
|
388
|
-
// encapsulation because it would use a different security class. Therefore the entire possible stack
|
|
389
|
-
// of encapsulation needs to be done here
|
|
390
|
-
if (MultiChannelCC_1.MultiChannelCC.requiresEncapsulation(cc)) {
|
|
391
|
-
const multiChannelCCVersion = this.host.getSupportedCCVersion(core_1.CommandClasses["Multi Channel"], this.endpoint.nodeId);
|
|
392
|
-
cc = multiChannelCCVersion === 1
|
|
393
|
-
? MultiChannelCC_1.MultiChannelCC.encapsulateV1(cc)
|
|
394
|
-
: MultiChannelCC_1.MultiChannelCC.encapsulate(cc);
|
|
395
|
-
}
|
|
396
|
-
cc = Security2CC.encapsulate(cc, this.host.ownNodeId, this.host, { securityClass });
|
|
397
|
-
const response = await this.host.sendCommand(cc, {
|
|
398
|
-
...this.commandOptions,
|
|
399
|
-
autoEncapsulate: false,
|
|
400
|
-
});
|
|
401
|
-
return response?.supportedCCs;
|
|
402
|
-
}
|
|
403
|
-
async reportSupportedCommands(supportedCCs) {
|
|
404
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.CommandsSupportedReport);
|
|
405
|
-
const cc = new Security2CCCommandsSupportedReport({
|
|
406
|
-
nodeId: this.endpoint.nodeId,
|
|
407
|
-
endpointIndex: this.endpoint.index,
|
|
408
|
-
supportedCCs,
|
|
409
|
-
});
|
|
410
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
411
|
-
}
|
|
412
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
413
|
-
async getKeyExchangeParameters() {
|
|
414
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.KEXGet);
|
|
415
|
-
const cc = new Security2CCKEXGet({
|
|
416
|
-
nodeId: this.endpoint.nodeId,
|
|
417
|
-
endpointIndex: this.endpoint.index,
|
|
418
|
-
});
|
|
419
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
420
|
-
if (response) {
|
|
421
|
-
return (0, safe_3.pick)(response, [
|
|
422
|
-
"requestCSA",
|
|
423
|
-
"echo",
|
|
424
|
-
"supportedKEXSchemes",
|
|
425
|
-
"supportedECDHProfiles",
|
|
426
|
-
"requestedKeys",
|
|
427
|
-
"_reserved",
|
|
428
|
-
]);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
/** Requests the given keys from an including node */
|
|
432
|
-
async requestKeys(params) {
|
|
433
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.KEXReport);
|
|
434
|
-
const cc = new Security2CCKEXReport({
|
|
435
|
-
nodeId: this.endpoint.nodeId,
|
|
436
|
-
endpointIndex: this.endpoint.index,
|
|
437
|
-
...params,
|
|
438
|
-
echo: false,
|
|
439
|
-
});
|
|
440
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
441
|
-
}
|
|
442
|
-
/** Grants the joining node the given keys */
|
|
443
|
-
async grantKeys(params) {
|
|
444
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.KEXSet);
|
|
445
|
-
const cc = new Security2CCKEXSet({
|
|
446
|
-
nodeId: this.endpoint.nodeId,
|
|
447
|
-
endpointIndex: this.endpoint.index,
|
|
448
|
-
...params,
|
|
449
|
-
echo: false,
|
|
450
|
-
});
|
|
451
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
452
|
-
}
|
|
453
|
-
/** Confirms the keys that were requested by a node */
|
|
454
|
-
async confirmRequestedKeys(params) {
|
|
455
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.KEXReport);
|
|
456
|
-
const cc = new Security2CCKEXReport({
|
|
457
|
-
nodeId: this.endpoint.nodeId,
|
|
458
|
-
endpointIndex: this.endpoint.index,
|
|
459
|
-
...params,
|
|
460
|
-
echo: true,
|
|
461
|
-
});
|
|
462
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
463
|
-
}
|
|
464
|
-
/** Confirms the keys that were granted by the including node */
|
|
465
|
-
async confirmGrantedKeys(params) {
|
|
466
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.KEXSet);
|
|
467
|
-
const cc = new Security2CCKEXSet({
|
|
468
|
-
nodeId: this.endpoint.nodeId,
|
|
469
|
-
endpointIndex: this.endpoint.index,
|
|
470
|
-
...params,
|
|
471
|
-
echo: true,
|
|
472
|
-
});
|
|
473
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
474
|
-
}
|
|
475
|
-
/** Notifies the other node that the ongoing key exchange was aborted */
|
|
476
|
-
async abortKeyExchange(failType) {
|
|
477
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.KEXFail);
|
|
478
|
-
const cc = new Security2CCKEXFail({
|
|
479
|
-
nodeId: this.endpoint.nodeId,
|
|
480
|
-
endpointIndex: this.endpoint.index,
|
|
481
|
-
failType,
|
|
482
|
-
});
|
|
483
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
484
|
-
}
|
|
485
|
-
async sendPublicKey(publicKey, includingNode = true) {
|
|
486
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.PublicKeyReport);
|
|
487
|
-
const cc = new Security2CCPublicKeyReport({
|
|
488
|
-
nodeId: this.endpoint.nodeId,
|
|
489
|
-
endpointIndex: this.endpoint.index,
|
|
490
|
-
includingNode,
|
|
491
|
-
publicKey,
|
|
492
|
-
});
|
|
493
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
494
|
-
}
|
|
495
|
-
async requestNetworkKey(securityClass) {
|
|
496
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.NetworkKeyGet);
|
|
497
|
-
const cc = new Security2CCNetworkKeyGet({
|
|
498
|
-
nodeId: this.endpoint.nodeId,
|
|
499
|
-
endpointIndex: this.endpoint.index,
|
|
500
|
-
requestedKey: securityClass,
|
|
501
|
-
});
|
|
502
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
503
|
-
}
|
|
504
|
-
async sendNetworkKey(securityClass, networkKey) {
|
|
505
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.NetworkKeyReport);
|
|
506
|
-
const cc = new Security2CCNetworkKeyReport({
|
|
507
|
-
nodeId: this.endpoint.nodeId,
|
|
508
|
-
endpointIndex: this.endpoint.index,
|
|
509
|
-
grantedKey: securityClass,
|
|
510
|
-
networkKey,
|
|
511
|
-
});
|
|
512
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
513
|
-
}
|
|
514
|
-
async verifyNetworkKey() {
|
|
515
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.NetworkKeyVerify);
|
|
516
|
-
const cc = new Security2CCNetworkKeyVerify({
|
|
517
|
-
nodeId: this.endpoint.nodeId,
|
|
518
|
-
endpointIndex: this.endpoint.index,
|
|
519
|
-
});
|
|
520
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
521
|
-
}
|
|
522
|
-
async confirmKeyVerification() {
|
|
523
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.TransferEnd);
|
|
524
|
-
const cc = new Security2CCTransferEnd({
|
|
525
|
-
nodeId: this.endpoint.nodeId,
|
|
526
|
-
endpointIndex: this.endpoint.index,
|
|
527
|
-
keyVerified: true,
|
|
528
|
-
keyRequestComplete: false,
|
|
529
|
-
});
|
|
530
|
-
await this.host.sendCommand(cc, {
|
|
531
|
-
...this.commandOptions,
|
|
532
|
-
// Don't wait for an ACK from the node
|
|
533
|
-
transmitOptions: core_1.TransmitOptions.DEFAULT & ~core_1.TransmitOptions.ACK,
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
|
-
async endKeyExchange() {
|
|
537
|
-
this.assertSupportsCommand(_Types_1.Security2Command, _Types_1.Security2Command.TransferEnd);
|
|
538
|
-
const cc = new Security2CCTransferEnd({
|
|
539
|
-
nodeId: this.endpoint.nodeId,
|
|
540
|
-
endpointIndex: this.endpoint.index,
|
|
541
|
-
keyVerified: false,
|
|
542
|
-
keyRequestComplete: true,
|
|
543
|
-
});
|
|
544
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
|
-
exports.Security2CCAPI = Security2CCAPI;
|
|
548
|
-
exports.Security2CCAPI = Security2CCAPI = __decorate([
|
|
549
|
-
(0, CommandClassDecorators_1.API)(core_1.CommandClasses["Security 2"])
|
|
550
|
-
], Security2CCAPI);
|
|
551
|
-
let Security2CC = Security2CC_1 = class Security2CC extends CommandClass_1.CommandClass {
|
|
552
|
-
async interview(ctx) {
|
|
553
|
-
const securityManager = getSecurityManager(ctx.ownNodeId, ctx, this.nodeId);
|
|
554
|
-
const node = this.getNode(ctx);
|
|
555
|
-
const endpoint = this.getEndpoint(ctx);
|
|
556
|
-
const api = API_1.CCAPI.create(core_1.CommandClasses["Security 2"], ctx, endpoint).withOptions({
|
|
557
|
-
priority: core_1.MessagePriority.NodeQuery,
|
|
558
|
-
});
|
|
559
|
-
// Only on the highest security class the response includes the supported commands
|
|
560
|
-
const secClass = node.getHighestSecurityClass();
|
|
561
|
-
let hasReceivedSecureCommands = false;
|
|
562
|
-
let possibleSecurityClasses;
|
|
563
|
-
if ((0, core_1.securityClassIsS2)(secClass)) {
|
|
564
|
-
// The highest security class is known to be S2, only query that one
|
|
565
|
-
possibleSecurityClasses = [secClass];
|
|
566
|
-
}
|
|
567
|
-
else if (endpoint.index === 0) {
|
|
568
|
-
// If the highest security class isn't known, query all possible security classes
|
|
569
|
-
// but only on the root device
|
|
570
|
-
possibleSecurityClasses = [
|
|
571
|
-
core_1.SecurityClass.S2_Unauthenticated,
|
|
572
|
-
core_1.SecurityClass.S2_Authenticated,
|
|
573
|
-
core_1.SecurityClass.S2_AccessControl,
|
|
574
|
-
];
|
|
575
|
-
}
|
|
576
|
-
else {
|
|
577
|
-
// For endpoint interviews, the security class MUST be known
|
|
578
|
-
ctx.logNode(node.id, {
|
|
579
|
-
endpoint: endpoint.index,
|
|
580
|
-
message: `Cannot query securely supported commands for endpoint because the node's security class isn't known...`,
|
|
581
|
-
level: "error",
|
|
582
|
-
});
|
|
583
|
-
return;
|
|
584
|
-
}
|
|
585
|
-
for (const secClass of possibleSecurityClasses) {
|
|
586
|
-
// We might not know all assigned security classes yet, so we work our way up from low to high and try to request the supported commands.
|
|
587
|
-
// This way, each command is encrypted with the security class we're currently testing.
|
|
588
|
-
// If the node does not respond, it wasn't assigned the security class.
|
|
589
|
-
// If it responds with a non-empty list, we know this is the highest class it supports.
|
|
590
|
-
// If the list is empty, the security class is still supported.
|
|
591
|
-
// If we already know the class is not supported, skip it
|
|
592
|
-
if (node.hasSecurityClass(secClass) === false)
|
|
593
|
-
continue;
|
|
594
|
-
// If no key is configured for this security class, skip it
|
|
595
|
-
if (!securityManager?.hasKeysForSecurityClass(secClass)) {
|
|
596
|
-
ctx.logNode(node.id, {
|
|
597
|
-
endpoint: endpoint.index,
|
|
598
|
-
message: `Cannot query securely supported commands (${(0, safe_3.getEnumMemberName)(core_1.SecurityClass, secClass)}) - network key is not configured...`,
|
|
599
|
-
level: "warn",
|
|
600
|
-
});
|
|
601
|
-
continue;
|
|
602
|
-
}
|
|
603
|
-
ctx.logNode(node.id, {
|
|
604
|
-
endpoint: endpoint.index,
|
|
605
|
-
message: `Querying securely supported commands (${(0, safe_3.getEnumMemberName)(core_1.SecurityClass, secClass)})...`,
|
|
606
|
-
direction: "outbound",
|
|
607
|
-
});
|
|
608
|
-
// Query the supported commands but avoid remembering the wrong security class in case of a failure
|
|
609
|
-
let supportedCCs;
|
|
610
|
-
// Try up to 3 times on the root device. We REALLY don't want a spurious timeout or collision to cause us to discard a known good security class
|
|
611
|
-
const MAX_ATTEMPTS = this.endpointIndex === 0 ? 3 : 1;
|
|
612
|
-
for (let attempts = 1; attempts <= MAX_ATTEMPTS; attempts++) {
|
|
613
|
-
try {
|
|
614
|
-
supportedCCs = await api.getSupportedCommands(secClass);
|
|
615
|
-
}
|
|
616
|
-
catch (e) {
|
|
617
|
-
if ((0, core_1.isZWaveError)(e)
|
|
618
|
-
&& e.code === core_1.ZWaveErrorCodes.Security2CC_CannotDecode) {
|
|
619
|
-
// Either we were using a non-granted security class,
|
|
620
|
-
// or querying with the known highest security class had an issue
|
|
621
|
-
supportedCCs = undefined;
|
|
622
|
-
}
|
|
623
|
-
else {
|
|
624
|
-
throw e;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
if (supportedCCs == undefined
|
|
628
|
-
&& possibleSecurityClasses.length === 1) {
|
|
629
|
-
if (attempts < MAX_ATTEMPTS) {
|
|
630
|
-
// We definitely know the highest security class
|
|
631
|
-
ctx.logNode(node.id, {
|
|
632
|
-
endpoint: endpoint.index,
|
|
633
|
-
message: `Querying securely supported commands (${(0, safe_3.getEnumMemberName)(core_1.SecurityClass, secClass)}), attempt ${attempts}/${MAX_ATTEMPTS} failed. Retrying in 500ms...`,
|
|
634
|
-
level: "warn",
|
|
635
|
-
});
|
|
636
|
-
await (0, async_1.wait)(500);
|
|
637
|
-
continue;
|
|
638
|
-
}
|
|
639
|
-
else if (endpoint.index > 0) {
|
|
640
|
-
ctx.logNode(node.id, {
|
|
641
|
-
endpoint: endpoint.index,
|
|
642
|
-
message: `Querying securely supported commands (${(0, safe_3.getEnumMemberName)(core_1.SecurityClass, secClass)}) failed. Assuming the endpoint supports all its mandatory CCs securely...`,
|
|
643
|
-
level: "warn",
|
|
644
|
-
});
|
|
645
|
-
// Just mark all endpoint CCs as secure. Without this we would attempt
|
|
646
|
-
// unencrypted communication with the endpoint, which will likely fail.
|
|
647
|
-
for (const [ccId] of endpoint.getCCs()) {
|
|
648
|
-
endpoint.addCC(ccId, { secure: true });
|
|
649
|
-
}
|
|
650
|
-
break;
|
|
651
|
-
}
|
|
652
|
-
else {
|
|
653
|
-
ctx.logNode(node.id, {
|
|
654
|
-
endpoint: endpoint.index,
|
|
655
|
-
message: `Querying securely supported commands (${(0, safe_3.getEnumMemberName)(core_1.SecurityClass, secClass)}) failed. Let's hope for the best...`,
|
|
656
|
-
level: "warn",
|
|
657
|
-
});
|
|
658
|
-
break;
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
else {
|
|
662
|
-
// In any other case, we can stop trying
|
|
663
|
-
break;
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
if (supportedCCs == undefined) {
|
|
667
|
-
if (endpoint.index === 0
|
|
668
|
-
&& possibleSecurityClasses.length > 1) {
|
|
669
|
-
// No supported commands found, mark the security class as not granted
|
|
670
|
-
// unless we were sure about the security class
|
|
671
|
-
node.setSecurityClass(secClass, false);
|
|
672
|
-
ctx.logNode(node.id, {
|
|
673
|
-
message: `The node was NOT granted the security class ${(0, safe_3.getEnumMemberName)(core_1.SecurityClass, secClass)}`,
|
|
674
|
-
direction: "inbound",
|
|
675
|
-
});
|
|
676
|
-
}
|
|
677
|
-
continue;
|
|
678
|
-
}
|
|
679
|
-
if (endpoint.index === 0 && possibleSecurityClasses.length > 1) {
|
|
680
|
-
// Mark the security class as granted unless we were sure about the security class
|
|
681
|
-
node.setSecurityClass(secClass, true);
|
|
682
|
-
ctx.logNode(node.id, {
|
|
683
|
-
message: `The node was granted the security class ${(0, safe_3.getEnumMemberName)(core_1.SecurityClass, secClass)}`,
|
|
684
|
-
direction: "inbound",
|
|
685
|
-
});
|
|
686
|
-
}
|
|
687
|
-
if (!hasReceivedSecureCommands && supportedCCs.length > 0) {
|
|
688
|
-
hasReceivedSecureCommands = true;
|
|
689
|
-
const logLines = [
|
|
690
|
-
`received secure commands (${(0, safe_3.getEnumMemberName)(core_1.SecurityClass, secClass)})`,
|
|
691
|
-
"supported CCs:",
|
|
692
|
-
];
|
|
693
|
-
for (const cc of supportedCCs) {
|
|
694
|
-
logLines.push(`· ${(0, core_1.getCCName)(cc)}`);
|
|
695
|
-
}
|
|
696
|
-
ctx.logNode(node.id, {
|
|
697
|
-
endpoint: endpoint.index,
|
|
698
|
-
message: logLines.join("\n"),
|
|
699
|
-
direction: "inbound",
|
|
700
|
-
});
|
|
701
|
-
// Remember which commands are supported securely
|
|
702
|
-
for (const cc of supportedCCs) {
|
|
703
|
-
// Basic CC has special rules for when it is considered supported
|
|
704
|
-
// Therefore we mark all other CCs as supported, but not Basic CC,
|
|
705
|
-
// for which support is determined later.
|
|
706
|
-
if (cc === core_1.CommandClasses.Basic) {
|
|
707
|
-
endpoint.addCC(cc, { secure: true });
|
|
708
|
-
}
|
|
709
|
-
else {
|
|
710
|
-
endpoint.addCC(cc, {
|
|
711
|
-
isSupported: true,
|
|
712
|
-
secure: true,
|
|
713
|
-
});
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
// Remember that the interview is complete
|
|
719
|
-
this.setInterviewComplete(ctx, true);
|
|
720
|
-
}
|
|
721
|
-
/** Tests if a command should be sent secure and thus requires encapsulation */
|
|
722
|
-
static requiresEncapsulation(cc) {
|
|
723
|
-
// No security flag -> no encapsulation
|
|
724
|
-
if (!(cc.encapsulationFlags & safe_1.EncapsulationFlags.Security)) {
|
|
725
|
-
return false;
|
|
726
|
-
}
|
|
727
|
-
// S0, CRC16, Transport Service -> no S2 encapsulation
|
|
728
|
-
if (cc instanceof SecurityCC_1.SecurityCC
|
|
729
|
-
|| cc instanceof CRC16CC_1.CRC16CC
|
|
730
|
-
|| cc instanceof TransportServiceCC_1.TransportServiceCC) {
|
|
731
|
-
return false;
|
|
732
|
-
}
|
|
733
|
-
// S2: check command
|
|
734
|
-
if (cc instanceof Security2CC_1) {
|
|
735
|
-
// These S2 commands need additional encapsulation
|
|
736
|
-
switch (cc.ccCommand) {
|
|
737
|
-
case _Types_1.Security2Command.CommandsSupportedGet:
|
|
738
|
-
case _Types_1.Security2Command.CommandsSupportedReport:
|
|
739
|
-
case _Types_1.Security2Command.NetworkKeyGet:
|
|
740
|
-
case _Types_1.Security2Command.NetworkKeyReport:
|
|
741
|
-
case _Types_1.Security2Command.NetworkKeyVerify:
|
|
742
|
-
case _Types_1.Security2Command.TransferEnd:
|
|
743
|
-
return true;
|
|
744
|
-
case _Types_1.Security2Command.KEXSet:
|
|
745
|
-
case _Types_1.Security2Command.KEXReport:
|
|
746
|
-
// KEXSet/Report need to be encrypted for the confirmation only
|
|
747
|
-
return cc
|
|
748
|
-
.echo;
|
|
749
|
-
case _Types_1.Security2Command.KEXFail: {
|
|
750
|
-
switch (cc.failType) {
|
|
751
|
-
case shared_1.KEXFailType.Decrypt:
|
|
752
|
-
case shared_1.KEXFailType.WrongSecurityLevel:
|
|
753
|
-
case shared_1.KEXFailType.KeyNotGranted:
|
|
754
|
-
case shared_1.KEXFailType.NoVerify:
|
|
755
|
-
return true;
|
|
756
|
-
default:
|
|
757
|
-
return false;
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
return false;
|
|
762
|
-
}
|
|
763
|
-
// Everything else needs to be encapsulated if the CC is secure
|
|
764
|
-
return true;
|
|
765
|
-
}
|
|
766
|
-
/** Encapsulates a command that should be sent encrypted */
|
|
767
|
-
static encapsulate(cc, ownNodeId, securityManagers, options) {
|
|
768
|
-
// Determine which extensions must be used on the command
|
|
769
|
-
const extensions = [];
|
|
770
|
-
if (options?.multicastOutOfSync) {
|
|
771
|
-
extensions.push(new Extension_1.MOSExtension());
|
|
772
|
-
}
|
|
773
|
-
if (options?.multicastGroupId != undefined) {
|
|
774
|
-
extensions.push(new Extension_1.MGRPExtension({ groupId: options.multicastGroupId }));
|
|
775
|
-
}
|
|
776
|
-
// Make sure that S2 multicast uses broadcasts. While the specs mention that both multicast and broadcast
|
|
777
|
-
// are possible, it has been found that devices treat multicasts like singlecast followups and respond incorrectly.
|
|
778
|
-
let nodeId;
|
|
779
|
-
if (cc.isMulticast()) {
|
|
780
|
-
if (cc.nodeId.some((nodeId) => (0, core_1.isLongRangeNodeId)(nodeId))) {
|
|
781
|
-
nodeId = safe_1.NODE_ID_BROADCAST_LR;
|
|
782
|
-
}
|
|
783
|
-
else {
|
|
784
|
-
nodeId = safe_1.NODE_ID_BROADCAST;
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
else {
|
|
788
|
-
nodeId = cc.nodeId;
|
|
789
|
-
}
|
|
790
|
-
const ret = new Security2CCMessageEncapsulation({
|
|
791
|
-
nodeId,
|
|
792
|
-
encapsulated: cc,
|
|
793
|
-
securityClass: options?.securityClass,
|
|
794
|
-
extensions,
|
|
795
|
-
verifyDelivery: options?.verifyDelivery,
|
|
796
|
-
});
|
|
797
|
-
// Copy the encapsulation flags from the encapsulated command
|
|
798
|
-
// but omit Security, since we're doing that right now
|
|
799
|
-
ret.encapsulationFlags = cc.encapsulationFlags
|
|
800
|
-
& ~safe_1.EncapsulationFlags.Security;
|
|
801
|
-
return ret;
|
|
802
|
-
}
|
|
803
|
-
};
|
|
804
|
-
exports.Security2CC = Security2CC;
|
|
805
|
-
exports.Security2CC = Security2CC = Security2CC_1 = __decorate([
|
|
806
|
-
(0, CommandClassDecorators_1.commandClass)(core_1.CommandClasses["Security 2"]),
|
|
807
|
-
(0, CommandClassDecorators_1.implementedVersion)(1)
|
|
808
|
-
], Security2CC);
|
|
809
|
-
function failNoSPAN() {
|
|
810
|
-
core_1.validatePayload.fail(core_1.ZWaveErrorCodes.Security2CC_NoSPAN);
|
|
811
|
-
}
|
|
812
|
-
function failNoMPAN() {
|
|
813
|
-
core_1.validatePayload.fail(core_1.ZWaveErrorCodes.Security2CC_NoMPAN);
|
|
814
|
-
}
|
|
815
|
-
// An S2 encapsulated command may result in a NonceReport to be sent by the node if it couldn't decrypt the message
|
|
816
|
-
function getCCResponseForMessageEncapsulation(sent) {
|
|
817
|
-
if (sent.encapsulated?.expectsCCResponse()) {
|
|
818
|
-
const ret = [
|
|
819
|
-
Security2CCMessageEncapsulation,
|
|
820
|
-
Security2CCNonceReport,
|
|
821
|
-
];
|
|
822
|
-
if (sent.encapsulated instanceof Security2CCKEXSet
|
|
823
|
-
|| sent.encapsulated instanceof Security2CCKEXReport
|
|
824
|
-
|| sent.encapsulated instanceof Security2CCNetworkKeyGet
|
|
825
|
-
|| sent.encapsulated instanceof Security2CCNetworkKeyReport
|
|
826
|
-
|| sent.encapsulated instanceof Security2CCNetworkKeyVerify) {
|
|
827
|
-
ret.push(Security2CCKEXFail);
|
|
828
|
-
}
|
|
829
|
-
return ret;
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
function testCCResponseForMessageEncapsulation(sent, received) {
|
|
833
|
-
if (received instanceof Security2CCMessageEncapsulation) {
|
|
834
|
-
return "checkEncapsulated";
|
|
835
|
-
}
|
|
836
|
-
else if (received instanceof Security2CCKEXFail) {
|
|
837
|
-
return true;
|
|
838
|
-
}
|
|
839
|
-
else {
|
|
840
|
-
return received.SOS && !!received.receiverEI;
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
let Security2CCMessageEncapsulation = Security2CCMessageEncapsulation_1 = class Security2CCMessageEncapsulation extends Security2CC {
|
|
844
|
-
constructor(options) {
|
|
845
|
-
super(options);
|
|
846
|
-
if (!options.encapsulated && !options.extensions?.length) {
|
|
847
|
-
throw new core_1.ZWaveError("Security S2 encapsulation requires an encapsulated CC and/or extensions", core_1.ZWaveErrorCodes.Argument_Invalid);
|
|
848
|
-
}
|
|
849
|
-
this.sequenceNumber = options.sequenceNumber;
|
|
850
|
-
this.securityClass = options.securityClass;
|
|
851
|
-
if (options.encapsulated) {
|
|
852
|
-
this.encapsulated = options.encapsulated;
|
|
853
|
-
options.encapsulated.encapsulatingCC = this;
|
|
854
|
-
}
|
|
855
|
-
this.verifyDelivery = options.verifyDelivery !== false;
|
|
856
|
-
this.extensions = options.extensions ?? [];
|
|
857
|
-
if (typeof this.nodeId !== "number"
|
|
858
|
-
&& !this.extensions.some((e) => e instanceof Extension_1.MGRPExtension)) {
|
|
859
|
-
throw new core_1.ZWaveError("Multicast Security S2 encapsulation requires the MGRP extension", core_1.ZWaveErrorCodes.Security2CC_MissingExtension);
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
static from(raw, ctx) {
|
|
863
|
-
const securityManager = assertSecurityRX(ctx);
|
|
864
|
-
(0, core_1.validatePayload)(raw.payload.length >= 2);
|
|
865
|
-
// Check the sequence number to avoid duplicates
|
|
866
|
-
const sequenceNumber = raw.payload[0];
|
|
867
|
-
// Ensure the node has a security class
|
|
868
|
-
core_1.validatePayload.withReason("No security class granted")(ctx.getHighestSecurityClass(ctx.sourceNodeId) !== core_1.SecurityClass.None);
|
|
869
|
-
const hasExtensions = !!(raw.payload[1] & 0b1);
|
|
870
|
-
const hasEncryptedExtensions = !!(raw.payload[1] & 0b10);
|
|
871
|
-
let offset = 2;
|
|
872
|
-
const extensions = [];
|
|
873
|
-
let mustDiscardCommand = false;
|
|
874
|
-
const parseExtensions = (buffer, wasEncrypted) => {
|
|
875
|
-
while (true) {
|
|
876
|
-
if (buffer.length < offset + 2) {
|
|
877
|
-
// An S2 extension was expected, but the buffer is too short
|
|
878
|
-
mustDiscardCommand = true;
|
|
879
|
-
return;
|
|
880
|
-
}
|
|
881
|
-
// The length field could be too large, which would cause part of the actual ciphertext
|
|
882
|
-
// to be ignored. Try to avoid this for known extensions by checking the actual and expected length.
|
|
883
|
-
const { actual: actualLength, expected: expectedLength } = Extension_1.Security2Extension
|
|
884
|
-
.getExtensionLength(buffer.subarray(offset));
|
|
885
|
-
// Parse the extension using the expected length if possible
|
|
886
|
-
const extensionLength = expectedLength ?? actualLength;
|
|
887
|
-
if (extensionLength < 2) {
|
|
888
|
-
// An S2 extension was expected, but the length is too short
|
|
889
|
-
mustDiscardCommand = true;
|
|
890
|
-
return;
|
|
891
|
-
}
|
|
892
|
-
else if (extensionLength
|
|
893
|
-
> buffer.length
|
|
894
|
-
- offset
|
|
895
|
-
- (wasEncrypted
|
|
896
|
-
? 0
|
|
897
|
-
: core_1.SECURITY_S2_AUTH_TAG_LENGTH)) {
|
|
898
|
-
// The supposed length is longer than the space the extensions may occupy
|
|
899
|
-
mustDiscardCommand = true;
|
|
900
|
-
return;
|
|
901
|
-
}
|
|
902
|
-
const extensionData = buffer.subarray(offset, offset + extensionLength);
|
|
903
|
-
offset += extensionLength;
|
|
904
|
-
const ext = Extension_1.Security2Extension.parse(extensionData);
|
|
905
|
-
switch ((0, Extension_1.validateS2Extension)(ext, wasEncrypted)) {
|
|
906
|
-
case Extension_1.ValidateS2ExtensionResult.OK:
|
|
907
|
-
if (expectedLength != undefined
|
|
908
|
-
&& actualLength !== expectedLength) {
|
|
909
|
-
// The extension length field does not match, ignore the extension
|
|
910
|
-
}
|
|
911
|
-
else {
|
|
912
|
-
extensions.push(ext);
|
|
913
|
-
}
|
|
914
|
-
break;
|
|
915
|
-
case Extension_1.ValidateS2ExtensionResult.DiscardExtension:
|
|
916
|
-
// Do nothing
|
|
917
|
-
break;
|
|
918
|
-
case Extension_1.ValidateS2ExtensionResult.DiscardCommand:
|
|
919
|
-
mustDiscardCommand = true;
|
|
920
|
-
break;
|
|
921
|
-
}
|
|
922
|
-
// Check if that was the last extension
|
|
923
|
-
if (!ext.moreToFollow)
|
|
924
|
-
break;
|
|
925
|
-
}
|
|
926
|
-
};
|
|
927
|
-
if (hasExtensions)
|
|
928
|
-
parseExtensions(raw.payload, false);
|
|
929
|
-
const mcctx = (() => {
|
|
930
|
-
const multicastGroupId = getMulticastGroupId(extensions);
|
|
931
|
-
if (ctx.frameType === "multicast" || ctx.frameType === "broadcast") {
|
|
932
|
-
if (multicastGroupId == undefined) {
|
|
933
|
-
core_1.validatePayload.fail("Multicast frames without MGRP extension");
|
|
934
|
-
}
|
|
935
|
-
return {
|
|
936
|
-
isMulticast: true,
|
|
937
|
-
groupId: multicastGroupId,
|
|
938
|
-
};
|
|
939
|
-
}
|
|
940
|
-
else {
|
|
941
|
-
return { isMulticast: false, groupId: multicastGroupId };
|
|
942
|
-
}
|
|
943
|
-
})();
|
|
944
|
-
// If a command is to be discarded before decryption,
|
|
945
|
-
// we still need to increment the SPAN or MPAN state
|
|
946
|
-
if (mustDiscardCommand) {
|
|
947
|
-
if (mcctx.isMulticast) {
|
|
948
|
-
securityManager.nextPeerMPAN(ctx.sourceNodeId, mcctx.groupId);
|
|
949
|
-
}
|
|
950
|
-
else {
|
|
951
|
-
securityManager.nextNonce(ctx.sourceNodeId);
|
|
952
|
-
}
|
|
953
|
-
core_1.validatePayload.fail("Invalid S2 extension");
|
|
954
|
-
}
|
|
955
|
-
let prevSequenceNumber;
|
|
956
|
-
let mpanState;
|
|
957
|
-
if (mcctx.isMulticast) {
|
|
958
|
-
mpanState = securityManager.getPeerMPAN(ctx.sourceNodeId, mcctx.groupId);
|
|
959
|
-
}
|
|
960
|
-
else {
|
|
961
|
-
// Don't accept duplicate Singlecast commands
|
|
962
|
-
prevSequenceNumber = validateSequenceNumber(securityManager, ctx.sourceNodeId, sequenceNumber);
|
|
963
|
-
// When a node receives a singlecast message after a multicast group was marked out of sync,
|
|
964
|
-
// it must forget about the group.
|
|
965
|
-
if (mcctx.groupId == undefined) {
|
|
966
|
-
securityManager.resetOutOfSyncMPANs(ctx.sourceNodeId);
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
const unencryptedPayload = raw.payload.subarray(0, offset);
|
|
970
|
-
const ciphertext = raw.payload.subarray(offset, -core_1.SECURITY_S2_AUTH_TAG_LENGTH);
|
|
971
|
-
const authTag = raw.payload.subarray(-core_1.SECURITY_S2_AUTH_TAG_LENGTH);
|
|
972
|
-
const messageLength = 2 /* CommandClass.computeEncapsulationOverhead() */
|
|
973
|
-
+ raw.payload.length;
|
|
974
|
-
const authData = getAuthenticationData(ctx.sourceNodeId, getDestinationIDRX(ctx, extensions), ctx.homeId, messageLength, unencryptedPayload);
|
|
975
|
-
let decrypt;
|
|
976
|
-
if (mcctx.isMulticast) {
|
|
977
|
-
// For incoming multicast commands, make sure we have an MPAN
|
|
978
|
-
if (mpanState?.type !== core_1.MPANState.MPAN) {
|
|
979
|
-
// If we don't, mark the MPAN as out of sync, so we can respond accordingly on the singlecast followup
|
|
980
|
-
securityManager.storePeerMPAN(ctx.sourceNodeId, mcctx.groupId, { type: core_1.MPANState.OutOfSync });
|
|
981
|
-
failNoMPAN();
|
|
982
|
-
}
|
|
983
|
-
decrypt = () => decryptMulticast(ctx.sourceNodeId, securityManager, mcctx.groupId, ciphertext, authData, authTag);
|
|
984
|
-
}
|
|
985
|
-
else {
|
|
986
|
-
// Decrypt payload and verify integrity
|
|
987
|
-
const spanState = securityManager.getSPANState(ctx.sourceNodeId);
|
|
988
|
-
// If we are not able to establish an SPAN yet, fail the decryption
|
|
989
|
-
if (spanState.type === core_1.SPANState.None) {
|
|
990
|
-
failNoSPAN();
|
|
991
|
-
}
|
|
992
|
-
else if (spanState.type === core_1.SPANState.RemoteEI) {
|
|
993
|
-
// TODO: The specs are not clear how to handle this case
|
|
994
|
-
// For now, do the same as if we didn't have any EI
|
|
995
|
-
failNoSPAN();
|
|
996
|
-
}
|
|
997
|
-
decrypt = () => decryptSinglecast(ctx, securityManager, ctx.sourceNodeId, sequenceNumber, prevSequenceNumber, ciphertext, authData, authTag, spanState, extensions);
|
|
998
|
-
}
|
|
999
|
-
let plaintext;
|
|
1000
|
-
let authOK = false;
|
|
1001
|
-
let key;
|
|
1002
|
-
let iv;
|
|
1003
|
-
let decryptionSecurityClass;
|
|
1004
|
-
// If the Receiver is unable to authenticate the singlecast message with the current SPAN,
|
|
1005
|
-
// the Receiver SHOULD try decrypting the message with one or more of the following SPAN values,
|
|
1006
|
-
// stopping when decryption is successful or the maximum number of iterations is reached.
|
|
1007
|
-
// If the Receiver is unable to decrypt the S2 MC frame with the current MPAN, the Receiver MAY try
|
|
1008
|
-
// decrypting the frame with one or more of the subsequent MPAN values, stopping when decryption is
|
|
1009
|
-
// successful or the maximum number of iterations is reached.
|
|
1010
|
-
const decryptAttempts = mcctx.isMulticast
|
|
1011
|
-
? MAX_DECRYPT_ATTEMPTS_MULTICAST
|
|
1012
|
-
: mcctx.groupId != undefined
|
|
1013
|
-
? MAX_DECRYPT_ATTEMPTS_SC_FOLLOWUP
|
|
1014
|
-
: MAX_DECRYPT_ATTEMPTS_SINGLECAST;
|
|
1015
|
-
for (let i = 0; i < decryptAttempts; i++) {
|
|
1016
|
-
({
|
|
1017
|
-
plaintext,
|
|
1018
|
-
authOK,
|
|
1019
|
-
key,
|
|
1020
|
-
iv,
|
|
1021
|
-
securityClass: decryptionSecurityClass,
|
|
1022
|
-
} = decrypt());
|
|
1023
|
-
if (!!authOK && !!plaintext)
|
|
1024
|
-
break;
|
|
1025
|
-
// No need to try further SPANs if we just got the sender's EI
|
|
1026
|
-
if (!!getSenderEI(extensions))
|
|
1027
|
-
break;
|
|
1028
|
-
}
|
|
1029
|
-
// If authentication fails, do so with an error code that instructs the
|
|
1030
|
-
// applHost to tell the node we have no nonce
|
|
1031
|
-
if (!authOK || !plaintext) {
|
|
1032
|
-
if (mcctx.isMulticast) {
|
|
1033
|
-
// Mark the MPAN as out of sync
|
|
1034
|
-
securityManager.storePeerMPAN(ctx.sourceNodeId, mcctx.groupId, { type: core_1.MPANState.OutOfSync });
|
|
1035
|
-
core_1.validatePayload.fail(core_1.ZWaveErrorCodes.Security2CC_CannotDecodeMulticast);
|
|
1036
|
-
}
|
|
1037
|
-
else {
|
|
1038
|
-
core_1.validatePayload.fail(core_1.ZWaveErrorCodes.Security2CC_CannotDecode);
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
else if (!mcctx.isMulticast && mcctx.groupId != undefined) {
|
|
1042
|
-
// After reception of a singlecast followup, the MPAN state must be increased
|
|
1043
|
-
securityManager.tryIncrementPeerMPAN(ctx.sourceNodeId, mcctx.groupId);
|
|
1044
|
-
}
|
|
1045
|
-
// Remember which security class was used to decrypt this message, so we can discard it later
|
|
1046
|
-
const securityClass = decryptionSecurityClass;
|
|
1047
|
-
offset = 0;
|
|
1048
|
-
if (hasEncryptedExtensions)
|
|
1049
|
-
parseExtensions(plaintext, true);
|
|
1050
|
-
// Before we can continue, check if the command must be discarded
|
|
1051
|
-
if (mustDiscardCommand) {
|
|
1052
|
-
core_1.validatePayload.fail("Invalid extension");
|
|
1053
|
-
}
|
|
1054
|
-
// If the MPAN extension was received, store the MPAN
|
|
1055
|
-
if (!mcctx.isMulticast) {
|
|
1056
|
-
const mpanExtension = extensions.find((e) => e instanceof Extension_1.MPANExtension);
|
|
1057
|
-
if (mpanExtension) {
|
|
1058
|
-
securityManager.storePeerMPAN(ctx.sourceNodeId, mpanExtension.groupId, {
|
|
1059
|
-
type: core_1.MPANState.MPAN,
|
|
1060
|
-
currentMPAN: mpanExtension.innerMPANState,
|
|
1061
|
-
});
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
// Not every S2 message includes an encapsulated CC
|
|
1065
|
-
const decryptedCCBytes = plaintext.subarray(offset);
|
|
1066
|
-
let encapsulated;
|
|
1067
|
-
if (decryptedCCBytes.length > 0) {
|
|
1068
|
-
// make sure this contains a complete CC command that's worth splitting
|
|
1069
|
-
(0, core_1.validatePayload)(decryptedCCBytes.length >= 2);
|
|
1070
|
-
// and deserialize the CC
|
|
1071
|
-
encapsulated = CommandClass_1.CommandClass.parse(decryptedCCBytes, ctx);
|
|
1072
|
-
}
|
|
1073
|
-
const ret = new Security2CCMessageEncapsulation_1({
|
|
1074
|
-
nodeId: ctx.sourceNodeId,
|
|
1075
|
-
sequenceNumber,
|
|
1076
|
-
securityClass,
|
|
1077
|
-
extensions,
|
|
1078
|
-
encapsulated,
|
|
1079
|
-
});
|
|
1080
|
-
// Remember for debugging purposes
|
|
1081
|
-
ret.key = key;
|
|
1082
|
-
ret.iv = iv;
|
|
1083
|
-
ret.authData = authData;
|
|
1084
|
-
ret.authTag = authTag;
|
|
1085
|
-
ret.plaintext = decryptedCCBytes;
|
|
1086
|
-
return ret;
|
|
1087
|
-
}
|
|
1088
|
-
securityClass;
|
|
1089
|
-
// Only used for testing/debugging purposes
|
|
1090
|
-
key;
|
|
1091
|
-
iv;
|
|
1092
|
-
authData;
|
|
1093
|
-
authTag;
|
|
1094
|
-
ciphertext;
|
|
1095
|
-
plaintext;
|
|
1096
|
-
verifyDelivery = true;
|
|
1097
|
-
sequenceNumber;
|
|
1098
|
-
ensureSequenceNumber(securityManager) {
|
|
1099
|
-
if (this.sequenceNumber == undefined) {
|
|
1100
|
-
if (this.isSinglecast()) {
|
|
1101
|
-
this.sequenceNumber = securityManager.nextSequenceNumber(this.nodeId);
|
|
1102
|
-
}
|
|
1103
|
-
else {
|
|
1104
|
-
const groupId = getDestinationIDTX.call(this);
|
|
1105
|
-
this.sequenceNumber = securityManager
|
|
1106
|
-
.nextMulticastSequenceNumber(groupId);
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1110
|
-
encapsulated;
|
|
1111
|
-
extensions;
|
|
1112
|
-
prepareRetransmission() {
|
|
1113
|
-
super.prepareRetransmission();
|
|
1114
|
-
this.sequenceNumber = undefined;
|
|
1115
|
-
}
|
|
1116
|
-
hasMOSExtension() {
|
|
1117
|
-
return this.extensions.some((e) => e instanceof Extension_1.MOSExtension);
|
|
1118
|
-
}
|
|
1119
|
-
/** Returns the Sender's Entropy Input if this command contains an SPAN extension */
|
|
1120
|
-
getSenderEI() {
|
|
1121
|
-
return getSenderEI(this.extensions);
|
|
1122
|
-
}
|
|
1123
|
-
/** Returns the multicast group ID if this command contains an MGRP extension */
|
|
1124
|
-
getMulticastGroupId() {
|
|
1125
|
-
return getMulticastGroupId(this.extensions);
|
|
1126
|
-
}
|
|
1127
|
-
maybeAddSPANExtension(ctx, securityManager) {
|
|
1128
|
-
if (!this.isSinglecast())
|
|
1129
|
-
return;
|
|
1130
|
-
const receiverNodeId = this.nodeId;
|
|
1131
|
-
const spanState = securityManager.getSPANState(receiverNodeId);
|
|
1132
|
-
if (spanState.type === core_1.SPANState.None
|
|
1133
|
-
|| spanState.type === core_1.SPANState.LocalEI) {
|
|
1134
|
-
// Can't do anything here if we don't have the receiver's EI
|
|
1135
|
-
throw new core_1.ZWaveError(`Security S2 CC requires the receiver's nonce to be sent!`, core_1.ZWaveErrorCodes.Security2CC_NoSPAN);
|
|
1136
|
-
}
|
|
1137
|
-
else if (spanState.type === core_1.SPANState.RemoteEI) {
|
|
1138
|
-
// We have the receiver's EI, generate our input and send it over
|
|
1139
|
-
// With both, we can create an SPAN
|
|
1140
|
-
const senderEI = securityManager.generateNonce(undefined);
|
|
1141
|
-
const receiverEI = spanState.receiverEI;
|
|
1142
|
-
// While bootstrapping a node, prefer the temporary key, unless the
|
|
1143
|
-
// specific command specifies a security class
|
|
1144
|
-
if (this.securityClass == undefined
|
|
1145
|
-
&& securityManager.tempKeys.has(receiverNodeId)) {
|
|
1146
|
-
securityManager.initializeTempSPAN(receiverNodeId, senderEI, receiverEI);
|
|
1147
|
-
}
|
|
1148
|
-
else {
|
|
1149
|
-
const securityClass = this.securityClass
|
|
1150
|
-
?? ctx.getHighestSecurityClass(receiverNodeId);
|
|
1151
|
-
if (securityClass == undefined) {
|
|
1152
|
-
throw new core_1.ZWaveError("No security class defined for this command!", core_1.ZWaveErrorCodes.Security2CC_NoSPAN);
|
|
1153
|
-
}
|
|
1154
|
-
securityManager.initializeSPAN(receiverNodeId, securityClass, senderEI, receiverEI);
|
|
1155
|
-
}
|
|
1156
|
-
// Add or update the SPAN extension
|
|
1157
|
-
let spanExtension = this.extensions.find((e) => e instanceof Extension_1.SPANExtension);
|
|
1158
|
-
if (spanExtension) {
|
|
1159
|
-
spanExtension.senderEI = senderEI;
|
|
1160
|
-
}
|
|
1161
|
-
else {
|
|
1162
|
-
spanExtension = new Extension_1.SPANExtension({ senderEI });
|
|
1163
|
-
this.extensions.push(spanExtension);
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
serialize(ctx) {
|
|
1168
|
-
const securityManager = assertSecurityTX(ctx, this.nodeId);
|
|
1169
|
-
this.ensureSequenceNumber(securityManager);
|
|
1170
|
-
// Include Sender EI in the command if we only have the receiver's EI
|
|
1171
|
-
this.maybeAddSPANExtension(ctx, securityManager);
|
|
1172
|
-
const unencryptedExtensions = this.extensions.filter((e) => !e.isEncrypted());
|
|
1173
|
-
const encryptedExtensions = this.extensions.filter((e) => e.isEncrypted());
|
|
1174
|
-
const unencryptedPayload = safe_2.Bytes.concat([
|
|
1175
|
-
safe_2.Bytes.from([
|
|
1176
|
-
this.sequenceNumber,
|
|
1177
|
-
(encryptedExtensions.length > 0 ? 0b10 : 0)
|
|
1178
|
-
| (unencryptedExtensions.length > 0 ? 1 : 0),
|
|
1179
|
-
]),
|
|
1180
|
-
...unencryptedExtensions.map((e, index) => e.serialize(index < unencryptedExtensions.length - 1)),
|
|
1181
|
-
]);
|
|
1182
|
-
const serializedCC = this.encapsulated?.serialize(ctx)
|
|
1183
|
-
?? new safe_2.Bytes();
|
|
1184
|
-
const plaintextPayload = safe_2.Bytes.concat([
|
|
1185
|
-
...encryptedExtensions.map((e, index) => e.serialize(index < encryptedExtensions.length - 1)),
|
|
1186
|
-
serializedCC,
|
|
1187
|
-
]);
|
|
1188
|
-
// Generate the authentication data for CCM encryption
|
|
1189
|
-
const destinationTag = getDestinationIDTX.call(this);
|
|
1190
|
-
const messageLength = this.computeEncapsulationOverhead()
|
|
1191
|
-
+ serializedCC.length;
|
|
1192
|
-
const authData = getAuthenticationData(ctx.ownNodeId, destinationTag, ctx.homeId, messageLength, unencryptedPayload);
|
|
1193
|
-
let key;
|
|
1194
|
-
let iv;
|
|
1195
|
-
if (this.isSinglecast()) {
|
|
1196
|
-
// Singlecast:
|
|
1197
|
-
// Generate a nonce for encryption, and remember it to attempt decryption
|
|
1198
|
-
// of potential in-flight messages from the target node.
|
|
1199
|
-
iv = securityManager.nextNonce(this.nodeId, true);
|
|
1200
|
-
const { keyCCM } =
|
|
1201
|
-
// Prefer the overridden security class if it was given
|
|
1202
|
-
this.securityClass != undefined
|
|
1203
|
-
? securityManager.getKeysForSecurityClass(this.securityClass)
|
|
1204
|
-
: securityManager.getKeysForNode(this.nodeId);
|
|
1205
|
-
key = keyCCM;
|
|
1206
|
-
}
|
|
1207
|
-
else {
|
|
1208
|
-
// Multicast:
|
|
1209
|
-
const keyAndIV = securityManager.getMulticastKeyAndIV(destinationTag);
|
|
1210
|
-
key = keyAndIV.key;
|
|
1211
|
-
iv = keyAndIV.iv;
|
|
1212
|
-
}
|
|
1213
|
-
const { ciphertext: ciphertextPayload, authTag } = (0, core_1.encryptAES128CCM)(key, iv, plaintextPayload, authData, core_1.SECURITY_S2_AUTH_TAG_LENGTH);
|
|
1214
|
-
// Remember key and IV for debugging purposes
|
|
1215
|
-
this.key = key;
|
|
1216
|
-
this.iv = iv;
|
|
1217
|
-
this.authData = authData;
|
|
1218
|
-
this.authTag = authTag;
|
|
1219
|
-
this.ciphertext = ciphertextPayload;
|
|
1220
|
-
this.payload = safe_2.Bytes.concat([
|
|
1221
|
-
unencryptedPayload,
|
|
1222
|
-
ciphertextPayload,
|
|
1223
|
-
authTag,
|
|
1224
|
-
]);
|
|
1225
|
-
return super.serialize(ctx);
|
|
1226
|
-
}
|
|
1227
|
-
computeEncapsulationOverhead() {
|
|
1228
|
-
// Security S2 adds:
|
|
1229
|
-
// * 1 byte sequence number
|
|
1230
|
-
// * 1 byte control
|
|
1231
|
-
// * N bytes extensions
|
|
1232
|
-
// * SECURITY_S2_AUTH_TAG_LENGTH bytes auth tag
|
|
1233
|
-
const extensionBytes = this.extensions
|
|
1234
|
-
.map((e) => e.computeLength())
|
|
1235
|
-
.reduce((a, b) => a + b, 0);
|
|
1236
|
-
return (super.computeEncapsulationOverhead()
|
|
1237
|
-
+ 2
|
|
1238
|
-
+ core_1.SECURITY_S2_AUTH_TAG_LENGTH
|
|
1239
|
-
+ extensionBytes);
|
|
1240
|
-
}
|
|
1241
|
-
toLogEntry(ctx) {
|
|
1242
|
-
const message = {
|
|
1243
|
-
"sequence number": this.sequenceNumber ?? "(not set)",
|
|
1244
|
-
};
|
|
1245
|
-
if (this.extensions.length > 0) {
|
|
1246
|
-
message.extensions = this.extensions
|
|
1247
|
-
.map((e) => e.toLogEntry())
|
|
1248
|
-
.join("");
|
|
1249
|
-
}
|
|
1250
|
-
// Log the used keys in integration tests
|
|
1251
|
-
if (process.env.NODE_ENV === "test"
|
|
1252
|
-
|| process.env.NODE_ENV === "development") {
|
|
1253
|
-
if (this.key) {
|
|
1254
|
-
message.key = (0, safe_3.buffer2hex)(this.key);
|
|
1255
|
-
}
|
|
1256
|
-
if (this.iv) {
|
|
1257
|
-
message.IV = (0, safe_3.buffer2hex)(this.iv);
|
|
1258
|
-
}
|
|
1259
|
-
if (this.ciphertext) {
|
|
1260
|
-
message.ciphertext = (0, safe_3.buffer2hex)(this.ciphertext);
|
|
1261
|
-
}
|
|
1262
|
-
else if (this.plaintext) {
|
|
1263
|
-
message.plaintext = (0, safe_3.buffer2hex)(this.plaintext);
|
|
1264
|
-
}
|
|
1265
|
-
if (this.authData) {
|
|
1266
|
-
message["auth data"] = (0, safe_3.buffer2hex)(this.authData);
|
|
1267
|
-
}
|
|
1268
|
-
if (this.authTag) {
|
|
1269
|
-
message["auth tag"] = (0, safe_3.buffer2hex)(this.authTag);
|
|
1270
|
-
}
|
|
1271
|
-
}
|
|
1272
|
-
if (this.securityClass != undefined) {
|
|
1273
|
-
message["security class"] = (0, safe_3.getEnumMemberName)(core_1.SecurityClass, this.securityClass);
|
|
1274
|
-
}
|
|
1275
|
-
return {
|
|
1276
|
-
...super.toLogEntry(ctx),
|
|
1277
|
-
message,
|
|
1278
|
-
};
|
|
1279
|
-
}
|
|
1280
|
-
};
|
|
1281
|
-
exports.Security2CCMessageEncapsulation = Security2CCMessageEncapsulation;
|
|
1282
|
-
exports.Security2CCMessageEncapsulation = Security2CCMessageEncapsulation = Security2CCMessageEncapsulation_1 = __decorate([
|
|
1283
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.MessageEncapsulation),
|
|
1284
|
-
(0, CommandClassDecorators_1.expectedCCResponse)(getCCResponseForMessageEncapsulation, testCCResponseForMessageEncapsulation)
|
|
1285
|
-
], Security2CCMessageEncapsulation);
|
|
1286
|
-
let Security2CCNonceReport = Security2CCNonceReport_1 = class Security2CCNonceReport extends Security2CC {
|
|
1287
|
-
constructor(options) {
|
|
1288
|
-
super(options);
|
|
1289
|
-
this.SOS = options.SOS;
|
|
1290
|
-
this.MOS = options.MOS;
|
|
1291
|
-
this.sequenceNumber = options.sequenceNumber;
|
|
1292
|
-
if (options.SOS)
|
|
1293
|
-
this.receiverEI = options.receiverEI;
|
|
1294
|
-
}
|
|
1295
|
-
static from(raw, ctx) {
|
|
1296
|
-
// Make sure that we can send/receive secure commands
|
|
1297
|
-
const securityManager = assertSecurityRX(ctx);
|
|
1298
|
-
(0, core_1.validatePayload)(raw.payload.length >= 2);
|
|
1299
|
-
const sequenceNumber = raw.payload[0];
|
|
1300
|
-
// Don't accept duplicate commands
|
|
1301
|
-
validateSequenceNumber(securityManager, ctx.sourceNodeId, sequenceNumber);
|
|
1302
|
-
const MOS = !!(raw.payload[1] & 0b10);
|
|
1303
|
-
const SOS = !!(raw.payload[1] & 0b1);
|
|
1304
|
-
if (SOS) {
|
|
1305
|
-
// If the SOS flag is set, the REI field MUST be included in the command
|
|
1306
|
-
(0, core_1.validatePayload)(raw.payload.length >= 18);
|
|
1307
|
-
const receiverEI = raw.payload.subarray(2, 18);
|
|
1308
|
-
// In that case we also need to store it, so the next sent command
|
|
1309
|
-
// can use it for encryption
|
|
1310
|
-
securityManager.storeRemoteEI(ctx.sourceNodeId, receiverEI);
|
|
1311
|
-
return new Security2CCNonceReport_1({
|
|
1312
|
-
nodeId: ctx.sourceNodeId,
|
|
1313
|
-
sequenceNumber,
|
|
1314
|
-
MOS,
|
|
1315
|
-
SOS,
|
|
1316
|
-
receiverEI,
|
|
1317
|
-
});
|
|
1318
|
-
}
|
|
1319
|
-
else if (MOS) {
|
|
1320
|
-
return new Security2CCNonceReport_1({
|
|
1321
|
-
nodeId: ctx.sourceNodeId,
|
|
1322
|
-
sequenceNumber,
|
|
1323
|
-
MOS,
|
|
1324
|
-
SOS: false,
|
|
1325
|
-
});
|
|
1326
|
-
}
|
|
1327
|
-
else {
|
|
1328
|
-
core_1.validatePayload.fail("Either MOS or SOS must be set");
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
sequenceNumber;
|
|
1332
|
-
ensureSequenceNumber(securityManager) {
|
|
1333
|
-
if (this.sequenceNumber == undefined) {
|
|
1334
|
-
this.sequenceNumber = securityManager.nextSequenceNumber(this.nodeId);
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1337
|
-
SOS;
|
|
1338
|
-
MOS;
|
|
1339
|
-
receiverEI;
|
|
1340
|
-
serialize(ctx) {
|
|
1341
|
-
const securityManager = assertSecurityTX(ctx, this.nodeId);
|
|
1342
|
-
this.ensureSequenceNumber(securityManager);
|
|
1343
|
-
this.payload = safe_2.Bytes.from([
|
|
1344
|
-
this.sequenceNumber,
|
|
1345
|
-
(this.MOS ? 0b10 : 0) + (this.SOS ? 0b1 : 0),
|
|
1346
|
-
]);
|
|
1347
|
-
if (this.SOS) {
|
|
1348
|
-
this.payload = safe_2.Bytes.concat([this.payload, this.receiverEI]);
|
|
1349
|
-
}
|
|
1350
|
-
return super.serialize(ctx);
|
|
1351
|
-
}
|
|
1352
|
-
toLogEntry(ctx) {
|
|
1353
|
-
const message = {
|
|
1354
|
-
"sequence number": this.sequenceNumber ?? "(not set)",
|
|
1355
|
-
SOS: this.SOS,
|
|
1356
|
-
MOS: this.MOS,
|
|
1357
|
-
};
|
|
1358
|
-
if (this.receiverEI) {
|
|
1359
|
-
message["receiver entropy"] = (0, safe_3.buffer2hex)(this.receiverEI);
|
|
1360
|
-
}
|
|
1361
|
-
return {
|
|
1362
|
-
...super.toLogEntry(ctx),
|
|
1363
|
-
message,
|
|
1364
|
-
};
|
|
1365
|
-
}
|
|
1366
|
-
};
|
|
1367
|
-
exports.Security2CCNonceReport = Security2CCNonceReport;
|
|
1368
|
-
exports.Security2CCNonceReport = Security2CCNonceReport = Security2CCNonceReport_1 = __decorate([
|
|
1369
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.NonceReport)
|
|
1370
|
-
], Security2CCNonceReport);
|
|
1371
|
-
let Security2CCNonceGet = Security2CCNonceGet_1 = class Security2CCNonceGet extends Security2CC {
|
|
1372
|
-
// TODO: A node sending this command MUST accept a delay up to <Previous Round-trip-time to peer node> +
|
|
1373
|
-
// 250 ms before receiving the Security 2 Nonce Report Command.
|
|
1374
|
-
constructor(options) {
|
|
1375
|
-
super(options);
|
|
1376
|
-
this.sequenceNumber = options.sequenceNumber;
|
|
1377
|
-
}
|
|
1378
|
-
static from(raw, ctx) {
|
|
1379
|
-
const securityManager = assertSecurityRX(ctx);
|
|
1380
|
-
(0, core_1.validatePayload)(raw.payload.length >= 1);
|
|
1381
|
-
const sequenceNumber = raw.payload[0];
|
|
1382
|
-
// Don't accept duplicate commands
|
|
1383
|
-
validateSequenceNumber(securityManager, ctx.sourceNodeId, sequenceNumber);
|
|
1384
|
-
return new Security2CCNonceGet_1({
|
|
1385
|
-
nodeId: ctx.sourceNodeId,
|
|
1386
|
-
sequenceNumber,
|
|
1387
|
-
});
|
|
1388
|
-
}
|
|
1389
|
-
sequenceNumber;
|
|
1390
|
-
ensureSequenceNumber(securityManager) {
|
|
1391
|
-
if (this.sequenceNumber == undefined) {
|
|
1392
|
-
this.sequenceNumber = securityManager.nextSequenceNumber(this.nodeId);
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
serialize(ctx) {
|
|
1396
|
-
const securityManager = assertSecurityTX(ctx, this.nodeId);
|
|
1397
|
-
this.ensureSequenceNumber(securityManager);
|
|
1398
|
-
this.payload = safe_2.Bytes.from([this.sequenceNumber]);
|
|
1399
|
-
return super.serialize(ctx);
|
|
1400
|
-
}
|
|
1401
|
-
toLogEntry(ctx) {
|
|
1402
|
-
return {
|
|
1403
|
-
...super.toLogEntry(ctx),
|
|
1404
|
-
message: {
|
|
1405
|
-
"sequence number": this.sequenceNumber ?? "(not set)",
|
|
1406
|
-
},
|
|
1407
|
-
};
|
|
1408
|
-
}
|
|
1409
|
-
};
|
|
1410
|
-
exports.Security2CCNonceGet = Security2CCNonceGet;
|
|
1411
|
-
exports.Security2CCNonceGet = Security2CCNonceGet = Security2CCNonceGet_1 = __decorate([
|
|
1412
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.NonceGet),
|
|
1413
|
-
(0, CommandClassDecorators_1.expectedCCResponse)(Security2CCNonceReport)
|
|
1414
|
-
], Security2CCNonceGet);
|
|
1415
|
-
let Security2CCKEXReport = Security2CCKEXReport_1 = class Security2CCKEXReport extends Security2CC {
|
|
1416
|
-
constructor(options) {
|
|
1417
|
-
super(options);
|
|
1418
|
-
this.requestCSA = options.requestCSA;
|
|
1419
|
-
this.echo = options.echo;
|
|
1420
|
-
this._reserved = options._reserved ?? 0;
|
|
1421
|
-
this.supportedKEXSchemes = options.supportedKEXSchemes;
|
|
1422
|
-
this.supportedECDHProfiles = options.supportedECDHProfiles;
|
|
1423
|
-
this.requestedKeys = options.requestedKeys;
|
|
1424
|
-
}
|
|
1425
|
-
static from(raw, ctx) {
|
|
1426
|
-
(0, core_1.validatePayload)(raw.payload.length >= 4);
|
|
1427
|
-
const requestCSA = !!(raw.payload[0] & 0b10);
|
|
1428
|
-
const echo = !!(raw.payload[0] & 0b1);
|
|
1429
|
-
// Remember the reserved bits for the echo
|
|
1430
|
-
const _reserved = raw.payload[0] & 0b1111_1100;
|
|
1431
|
-
// The bit mask starts at 0, but bit 0 is not used
|
|
1432
|
-
const supportedKEXSchemes = (0, core_1.parseBitMask)(raw.payload.subarray(1, 2), 0).filter((s) => s !== 0);
|
|
1433
|
-
const supportedECDHProfiles = (0, core_1.parseBitMask)(raw.payload.subarray(2, 3), shared_1.ECDHProfiles.Curve25519);
|
|
1434
|
-
const requestedKeys = (0, core_1.parseBitMask)(raw.payload.subarray(3, 4), core_1.SecurityClass.S2_Unauthenticated);
|
|
1435
|
-
return new Security2CCKEXReport_1({
|
|
1436
|
-
nodeId: ctx.sourceNodeId,
|
|
1437
|
-
requestCSA,
|
|
1438
|
-
echo,
|
|
1439
|
-
_reserved,
|
|
1440
|
-
supportedKEXSchemes,
|
|
1441
|
-
supportedECDHProfiles,
|
|
1442
|
-
requestedKeys,
|
|
1443
|
-
});
|
|
1444
|
-
}
|
|
1445
|
-
_reserved;
|
|
1446
|
-
requestCSA;
|
|
1447
|
-
echo;
|
|
1448
|
-
supportedKEXSchemes;
|
|
1449
|
-
supportedECDHProfiles;
|
|
1450
|
-
requestedKeys;
|
|
1451
|
-
serialize(ctx) {
|
|
1452
|
-
this.payload = safe_2.Bytes.concat([
|
|
1453
|
-
safe_2.Bytes.from([
|
|
1454
|
-
this._reserved
|
|
1455
|
-
+ (this.requestCSA ? 0b10 : 0)
|
|
1456
|
-
+ (this.echo ? 0b1 : 0),
|
|
1457
|
-
]),
|
|
1458
|
-
// The bit mask starts at 0, but bit 0 is not used
|
|
1459
|
-
(0, core_1.encodeBitMask)(this.supportedKEXSchemes, 7, 0),
|
|
1460
|
-
(0, core_1.encodeBitMask)(this.supportedECDHProfiles, 7, shared_1.ECDHProfiles.Curve25519),
|
|
1461
|
-
(0, core_1.encodeBitMask)(this.requestedKeys, core_1.SecurityClass.S0_Legacy, core_1.SecurityClass.S2_Unauthenticated),
|
|
1462
|
-
]);
|
|
1463
|
-
return super.serialize(ctx);
|
|
1464
|
-
}
|
|
1465
|
-
toLogEntry(ctx) {
|
|
1466
|
-
return {
|
|
1467
|
-
...super.toLogEntry(ctx),
|
|
1468
|
-
message: {
|
|
1469
|
-
echo: this.echo,
|
|
1470
|
-
"supported schemes": this.supportedKEXSchemes
|
|
1471
|
-
.map((s) => `\n· ${(0, safe_3.getEnumMemberName)(shared_1.KEXSchemes, s)}`)
|
|
1472
|
-
.join(""),
|
|
1473
|
-
"supported ECDH profiles": this.supportedECDHProfiles
|
|
1474
|
-
.map((s) => `\n· ${(0, safe_3.getEnumMemberName)(shared_1.ECDHProfiles, s)}`)
|
|
1475
|
-
.join(""),
|
|
1476
|
-
"CSA requested": this.requestCSA,
|
|
1477
|
-
"requested security classes": this.requestedKeys
|
|
1478
|
-
.map((s) => `\n· ${(0, safe_3.getEnumMemberName)(core_1.SecurityClass, s)}`)
|
|
1479
|
-
.join(""),
|
|
1480
|
-
},
|
|
1481
|
-
};
|
|
1482
|
-
}
|
|
1483
|
-
};
|
|
1484
|
-
exports.Security2CCKEXReport = Security2CCKEXReport;
|
|
1485
|
-
exports.Security2CCKEXReport = Security2CCKEXReport = Security2CCKEXReport_1 = __decorate([
|
|
1486
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.KEXReport)
|
|
1487
|
-
], Security2CCKEXReport);
|
|
1488
|
-
let Security2CCKEXGet = class Security2CCKEXGet extends Security2CC {
|
|
1489
|
-
};
|
|
1490
|
-
exports.Security2CCKEXGet = Security2CCKEXGet;
|
|
1491
|
-
exports.Security2CCKEXGet = Security2CCKEXGet = __decorate([
|
|
1492
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.KEXGet),
|
|
1493
|
-
(0, CommandClassDecorators_1.expectedCCResponse)(Security2CCKEXReport)
|
|
1494
|
-
], Security2CCKEXGet);
|
|
1495
|
-
function getExpectedResponseForKEXSet(sent) {
|
|
1496
|
-
if (sent.echo) {
|
|
1497
|
-
return [Security2CCKEXReport, Security2CCKEXFail];
|
|
1498
|
-
}
|
|
1499
|
-
else {
|
|
1500
|
-
return undefined;
|
|
1501
|
-
}
|
|
1502
|
-
}
|
|
1503
|
-
function testExpectedResponseForKEXSet(sent, received) {
|
|
1504
|
-
if (sent.echo) {
|
|
1505
|
-
if (received instanceof Security2CCKEXReport) {
|
|
1506
|
-
return received.echo;
|
|
1507
|
-
}
|
|
1508
|
-
else if (received instanceof Security2CCKEXFail) {
|
|
1509
|
-
return true;
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
return false;
|
|
1513
|
-
}
|
|
1514
|
-
let Security2CCKEXSet = Security2CCKEXSet_1 = class Security2CCKEXSet extends Security2CC {
|
|
1515
|
-
constructor(options) {
|
|
1516
|
-
super(options);
|
|
1517
|
-
this.permitCSA = options.permitCSA;
|
|
1518
|
-
this.echo = options.echo;
|
|
1519
|
-
this._reserved = options._reserved ?? 0;
|
|
1520
|
-
this.selectedKEXScheme = options.selectedKEXScheme;
|
|
1521
|
-
this.selectedECDHProfile = options.selectedECDHProfile;
|
|
1522
|
-
this.grantedKeys = options.grantedKeys;
|
|
1523
|
-
}
|
|
1524
|
-
static from(raw, ctx) {
|
|
1525
|
-
(0, core_1.validatePayload)(raw.payload.length >= 4);
|
|
1526
|
-
const _reserved = raw.payload[0] & 0b1111_1100;
|
|
1527
|
-
const permitCSA = !!(raw.payload[0] & 0b10);
|
|
1528
|
-
const echo = !!(raw.payload[0] & 0b1);
|
|
1529
|
-
// The bit mask starts at 0, but bit 0 is not used
|
|
1530
|
-
const selectedKEXSchemes = (0, core_1.parseBitMask)(raw.payload.subarray(1, 2), 0).filter((s) => s !== 0);
|
|
1531
|
-
(0, core_1.validatePayload)(selectedKEXSchemes.length === 1);
|
|
1532
|
-
const selectedKEXScheme = selectedKEXSchemes[0];
|
|
1533
|
-
const selectedECDHProfiles = (0, core_1.parseBitMask)(raw.payload.subarray(2, 3), shared_1.ECDHProfiles.Curve25519);
|
|
1534
|
-
(0, core_1.validatePayload)(selectedECDHProfiles.length === 1);
|
|
1535
|
-
const selectedECDHProfile = selectedECDHProfiles[0];
|
|
1536
|
-
const grantedKeys = (0, core_1.parseBitMask)(raw.payload.subarray(3, 4), core_1.SecurityClass.S2_Unauthenticated);
|
|
1537
|
-
return new Security2CCKEXSet_1({
|
|
1538
|
-
nodeId: ctx.sourceNodeId,
|
|
1539
|
-
_reserved,
|
|
1540
|
-
permitCSA,
|
|
1541
|
-
echo,
|
|
1542
|
-
selectedKEXScheme,
|
|
1543
|
-
selectedECDHProfile,
|
|
1544
|
-
grantedKeys,
|
|
1545
|
-
});
|
|
1546
|
-
}
|
|
1547
|
-
_reserved;
|
|
1548
|
-
permitCSA;
|
|
1549
|
-
echo;
|
|
1550
|
-
selectedKEXScheme;
|
|
1551
|
-
selectedECDHProfile;
|
|
1552
|
-
grantedKeys;
|
|
1553
|
-
serialize(ctx) {
|
|
1554
|
-
this.payload = safe_2.Bytes.concat([
|
|
1555
|
-
safe_2.Bytes.from([
|
|
1556
|
-
this._reserved
|
|
1557
|
-
+ (this.permitCSA ? 0b10 : 0)
|
|
1558
|
-
+ (this.echo ? 0b1 : 0),
|
|
1559
|
-
]),
|
|
1560
|
-
// The bit mask starts at 0, but bit 0 is not used
|
|
1561
|
-
(0, core_1.encodeBitMask)([this.selectedKEXScheme], 7, 0),
|
|
1562
|
-
(0, core_1.encodeBitMask)([this.selectedECDHProfile], 7, shared_1.ECDHProfiles.Curve25519),
|
|
1563
|
-
(0, core_1.encodeBitMask)(this.grantedKeys, core_1.SecurityClass.S0_Legacy, core_1.SecurityClass.S2_Unauthenticated),
|
|
1564
|
-
]);
|
|
1565
|
-
return super.serialize(ctx);
|
|
1566
|
-
}
|
|
1567
|
-
toLogEntry(ctx) {
|
|
1568
|
-
return {
|
|
1569
|
-
...super.toLogEntry(ctx),
|
|
1570
|
-
message: {
|
|
1571
|
-
echo: this.echo,
|
|
1572
|
-
"selected scheme": (0, safe_3.getEnumMemberName)(shared_1.KEXSchemes, this.selectedKEXScheme),
|
|
1573
|
-
"selected ECDH profile": (0, safe_3.getEnumMemberName)(shared_1.ECDHProfiles, this.selectedECDHProfile),
|
|
1574
|
-
"CSA permitted": this.permitCSA,
|
|
1575
|
-
"granted security classes": this.grantedKeys
|
|
1576
|
-
.map((s) => `\n· ${(0, safe_3.getEnumMemberName)(core_1.SecurityClass, s)}`)
|
|
1577
|
-
.join(""),
|
|
1578
|
-
},
|
|
1579
|
-
};
|
|
1580
|
-
}
|
|
1581
|
-
};
|
|
1582
|
-
exports.Security2CCKEXSet = Security2CCKEXSet;
|
|
1583
|
-
exports.Security2CCKEXSet = Security2CCKEXSet = Security2CCKEXSet_1 = __decorate([
|
|
1584
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.KEXSet),
|
|
1585
|
-
(0, CommandClassDecorators_1.expectedCCResponse)(getExpectedResponseForKEXSet, testExpectedResponseForKEXSet)
|
|
1586
|
-
], Security2CCKEXSet);
|
|
1587
|
-
let Security2CCKEXFail = Security2CCKEXFail_1 = class Security2CCKEXFail extends Security2CC {
|
|
1588
|
-
constructor(options) {
|
|
1589
|
-
super(options);
|
|
1590
|
-
this.failType = options.failType;
|
|
1591
|
-
}
|
|
1592
|
-
static from(raw, ctx) {
|
|
1593
|
-
(0, core_1.validatePayload)(raw.payload.length >= 1);
|
|
1594
|
-
const failType = raw.payload[0];
|
|
1595
|
-
return new Security2CCKEXFail_1({
|
|
1596
|
-
nodeId: ctx.sourceNodeId,
|
|
1597
|
-
failType,
|
|
1598
|
-
});
|
|
1599
|
-
}
|
|
1600
|
-
failType;
|
|
1601
|
-
serialize(ctx) {
|
|
1602
|
-
this.payload = safe_2.Bytes.from([this.failType]);
|
|
1603
|
-
return super.serialize(ctx);
|
|
1604
|
-
}
|
|
1605
|
-
toLogEntry(ctx) {
|
|
1606
|
-
return {
|
|
1607
|
-
...super.toLogEntry(ctx),
|
|
1608
|
-
message: { reason: (0, safe_3.getEnumMemberName)(shared_1.KEXFailType, this.failType) },
|
|
1609
|
-
};
|
|
1610
|
-
}
|
|
1611
|
-
};
|
|
1612
|
-
exports.Security2CCKEXFail = Security2CCKEXFail;
|
|
1613
|
-
exports.Security2CCKEXFail = Security2CCKEXFail = Security2CCKEXFail_1 = __decorate([
|
|
1614
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.KEXFail)
|
|
1615
|
-
], Security2CCKEXFail);
|
|
1616
|
-
let Security2CCPublicKeyReport = Security2CCPublicKeyReport_1 = class Security2CCPublicKeyReport extends Security2CC {
|
|
1617
|
-
constructor(options) {
|
|
1618
|
-
super(options);
|
|
1619
|
-
this.includingNode = options.includingNode;
|
|
1620
|
-
this.publicKey = options.publicKey;
|
|
1621
|
-
}
|
|
1622
|
-
static from(raw, ctx) {
|
|
1623
|
-
(0, core_1.validatePayload)(raw.payload.length >= 17);
|
|
1624
|
-
const includingNode = !!(raw.payload[0] & 0b1);
|
|
1625
|
-
const publicKey = raw.payload.subarray(1);
|
|
1626
|
-
return new Security2CCPublicKeyReport_1({
|
|
1627
|
-
nodeId: ctx.sourceNodeId,
|
|
1628
|
-
includingNode,
|
|
1629
|
-
publicKey,
|
|
1630
|
-
});
|
|
1631
|
-
}
|
|
1632
|
-
includingNode;
|
|
1633
|
-
publicKey;
|
|
1634
|
-
serialize(ctx) {
|
|
1635
|
-
this.payload = safe_2.Bytes.concat([
|
|
1636
|
-
safe_2.Bytes.from([this.includingNode ? 1 : 0]),
|
|
1637
|
-
this.publicKey,
|
|
1638
|
-
]);
|
|
1639
|
-
return super.serialize(ctx);
|
|
1640
|
-
}
|
|
1641
|
-
toLogEntry(ctx) {
|
|
1642
|
-
return {
|
|
1643
|
-
...super.toLogEntry(ctx),
|
|
1644
|
-
message: {
|
|
1645
|
-
"is including node": this.includingNode,
|
|
1646
|
-
"public key": (0, safe_3.buffer2hex)(this.publicKey),
|
|
1647
|
-
},
|
|
1648
|
-
};
|
|
1649
|
-
}
|
|
1650
|
-
};
|
|
1651
|
-
exports.Security2CCPublicKeyReport = Security2CCPublicKeyReport;
|
|
1652
|
-
exports.Security2CCPublicKeyReport = Security2CCPublicKeyReport = Security2CCPublicKeyReport_1 = __decorate([
|
|
1653
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.PublicKeyReport)
|
|
1654
|
-
], Security2CCPublicKeyReport);
|
|
1655
|
-
let Security2CCNetworkKeyReport = Security2CCNetworkKeyReport_1 = class Security2CCNetworkKeyReport extends Security2CC {
|
|
1656
|
-
constructor(options) {
|
|
1657
|
-
super(options);
|
|
1658
|
-
this.grantedKey = options.grantedKey;
|
|
1659
|
-
this.networkKey = options.networkKey;
|
|
1660
|
-
}
|
|
1661
|
-
static from(raw, ctx) {
|
|
1662
|
-
(0, core_1.validatePayload)(raw.payload.length >= 17);
|
|
1663
|
-
const grantedKey = bitMaskToSecurityClass(raw.payload, 0);
|
|
1664
|
-
const networkKey = raw.payload.subarray(1, 17);
|
|
1665
|
-
return new Security2CCNetworkKeyReport_1({
|
|
1666
|
-
nodeId: ctx.sourceNodeId,
|
|
1667
|
-
grantedKey,
|
|
1668
|
-
networkKey,
|
|
1669
|
-
});
|
|
1670
|
-
}
|
|
1671
|
-
grantedKey;
|
|
1672
|
-
networkKey;
|
|
1673
|
-
serialize(ctx) {
|
|
1674
|
-
this.payload = safe_2.Bytes.concat([
|
|
1675
|
-
securityClassToBitMask(this.grantedKey),
|
|
1676
|
-
this.networkKey,
|
|
1677
|
-
]);
|
|
1678
|
-
return super.serialize(ctx);
|
|
1679
|
-
}
|
|
1680
|
-
toLogEntry(ctx) {
|
|
1681
|
-
return {
|
|
1682
|
-
...super.toLogEntry(ctx),
|
|
1683
|
-
message: {
|
|
1684
|
-
"security class": (0, safe_3.getEnumMemberName)(core_1.SecurityClass, this.grantedKey),
|
|
1685
|
-
// This shouldn't be logged, so users can safely post their logs online
|
|
1686
|
-
// "network key": buffer2hex(this.networkKey),
|
|
1687
|
-
},
|
|
1688
|
-
};
|
|
1689
|
-
}
|
|
1690
|
-
};
|
|
1691
|
-
exports.Security2CCNetworkKeyReport = Security2CCNetworkKeyReport;
|
|
1692
|
-
exports.Security2CCNetworkKeyReport = Security2CCNetworkKeyReport = Security2CCNetworkKeyReport_1 = __decorate([
|
|
1693
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.NetworkKeyReport)
|
|
1694
|
-
], Security2CCNetworkKeyReport);
|
|
1695
|
-
let Security2CCNetworkKeyGet = Security2CCNetworkKeyGet_1 = class Security2CCNetworkKeyGet extends Security2CC {
|
|
1696
|
-
constructor(options) {
|
|
1697
|
-
super(options);
|
|
1698
|
-
this.requestedKey = options.requestedKey;
|
|
1699
|
-
}
|
|
1700
|
-
static from(raw, ctx) {
|
|
1701
|
-
(0, core_1.validatePayload)(raw.payload.length >= 1);
|
|
1702
|
-
const requestedKey = bitMaskToSecurityClass(raw.payload, 0);
|
|
1703
|
-
return new Security2CCNetworkKeyGet_1({
|
|
1704
|
-
nodeId: ctx.sourceNodeId,
|
|
1705
|
-
requestedKey,
|
|
1706
|
-
});
|
|
1707
|
-
}
|
|
1708
|
-
requestedKey;
|
|
1709
|
-
serialize(ctx) {
|
|
1710
|
-
this.payload = securityClassToBitMask(this.requestedKey);
|
|
1711
|
-
return super.serialize(ctx);
|
|
1712
|
-
}
|
|
1713
|
-
toLogEntry(ctx) {
|
|
1714
|
-
return {
|
|
1715
|
-
...super.toLogEntry(ctx),
|
|
1716
|
-
message: {
|
|
1717
|
-
"security class": (0, safe_3.getEnumMemberName)(core_1.SecurityClass, this.requestedKey),
|
|
1718
|
-
},
|
|
1719
|
-
};
|
|
1720
|
-
}
|
|
1721
|
-
};
|
|
1722
|
-
exports.Security2CCNetworkKeyGet = Security2CCNetworkKeyGet;
|
|
1723
|
-
exports.Security2CCNetworkKeyGet = Security2CCNetworkKeyGet = Security2CCNetworkKeyGet_1 = __decorate([
|
|
1724
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.NetworkKeyGet)
|
|
1725
|
-
// Don't expect a response - we need to distinguish between Report and Fail
|
|
1726
|
-
// FIXME: maybe use the dynamic @expectedCCResponse instead?
|
|
1727
|
-
], Security2CCNetworkKeyGet);
|
|
1728
|
-
let Security2CCNetworkKeyVerify = class Security2CCNetworkKeyVerify extends Security2CC {
|
|
1729
|
-
};
|
|
1730
|
-
exports.Security2CCNetworkKeyVerify = Security2CCNetworkKeyVerify;
|
|
1731
|
-
exports.Security2CCNetworkKeyVerify = Security2CCNetworkKeyVerify = __decorate([
|
|
1732
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.NetworkKeyVerify)
|
|
1733
|
-
], Security2CCNetworkKeyVerify);
|
|
1734
|
-
let Security2CCTransferEnd = Security2CCTransferEnd_1 = class Security2CCTransferEnd extends Security2CC {
|
|
1735
|
-
constructor(options) {
|
|
1736
|
-
super(options);
|
|
1737
|
-
this.keyVerified = options.keyVerified;
|
|
1738
|
-
this.keyRequestComplete = options.keyRequestComplete;
|
|
1739
|
-
}
|
|
1740
|
-
static from(raw, ctx) {
|
|
1741
|
-
(0, core_1.validatePayload)(raw.payload.length >= 1);
|
|
1742
|
-
const keyVerified = !!(raw.payload[0] & 0b10);
|
|
1743
|
-
const keyRequestComplete = !!(raw.payload[0] & 0b1);
|
|
1744
|
-
return new Security2CCTransferEnd_1({
|
|
1745
|
-
nodeId: ctx.sourceNodeId,
|
|
1746
|
-
keyVerified,
|
|
1747
|
-
keyRequestComplete,
|
|
1748
|
-
});
|
|
1749
|
-
}
|
|
1750
|
-
keyVerified;
|
|
1751
|
-
keyRequestComplete;
|
|
1752
|
-
serialize(ctx) {
|
|
1753
|
-
this.payload = safe_2.Bytes.from([
|
|
1754
|
-
(this.keyVerified ? 0b10 : 0) + (this.keyRequestComplete ? 0b1 : 0),
|
|
1755
|
-
]);
|
|
1756
|
-
return super.serialize(ctx);
|
|
1757
|
-
}
|
|
1758
|
-
toLogEntry(ctx) {
|
|
1759
|
-
return {
|
|
1760
|
-
...super.toLogEntry(ctx),
|
|
1761
|
-
message: {
|
|
1762
|
-
"key verified": this.keyVerified,
|
|
1763
|
-
"request complete": this.keyRequestComplete,
|
|
1764
|
-
},
|
|
1765
|
-
};
|
|
1766
|
-
}
|
|
1767
|
-
};
|
|
1768
|
-
exports.Security2CCTransferEnd = Security2CCTransferEnd;
|
|
1769
|
-
exports.Security2CCTransferEnd = Security2CCTransferEnd = Security2CCTransferEnd_1 = __decorate([
|
|
1770
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.TransferEnd)
|
|
1771
|
-
], Security2CCTransferEnd);
|
|
1772
|
-
let Security2CCCommandsSupportedReport = Security2CCCommandsSupportedReport_1 = class Security2CCCommandsSupportedReport extends Security2CC {
|
|
1773
|
-
constructor(options) {
|
|
1774
|
-
super(options);
|
|
1775
|
-
this.supportedCCs = options.supportedCCs;
|
|
1776
|
-
}
|
|
1777
|
-
static from(raw, ctx) {
|
|
1778
|
-
const CCs = (0, core_1.parseCCList)(raw.payload);
|
|
1779
|
-
// SDS13783: A sending node MAY terminate the list of supported command classes with the
|
|
1780
|
-
// COMMAND_CLASS_MARK command class identifier.
|
|
1781
|
-
// A receiving node MUST stop parsing the list of supported command classes if it detects the
|
|
1782
|
-
// COMMAND_CLASS_MARK command class identifier in the Security 2 Commands Supported Report
|
|
1783
|
-
const supportedCCs = CCs.supportedCCs;
|
|
1784
|
-
return new Security2CCCommandsSupportedReport_1({
|
|
1785
|
-
nodeId: ctx.sourceNodeId,
|
|
1786
|
-
supportedCCs,
|
|
1787
|
-
});
|
|
1788
|
-
}
|
|
1789
|
-
supportedCCs;
|
|
1790
|
-
serialize(ctx) {
|
|
1791
|
-
this.payload = (0, safe_1.encodeCCList)(this.supportedCCs, []);
|
|
1792
|
-
return super.serialize(ctx);
|
|
1793
|
-
}
|
|
1794
|
-
toLogEntry(ctx) {
|
|
1795
|
-
return {
|
|
1796
|
-
...super.toLogEntry(ctx),
|
|
1797
|
-
message: {
|
|
1798
|
-
"supported CCs": this.supportedCCs
|
|
1799
|
-
.map((cc) => (0, core_1.getCCName)(cc))
|
|
1800
|
-
.map((cc) => `\n· ${cc}`)
|
|
1801
|
-
.join(""),
|
|
1802
|
-
},
|
|
1803
|
-
};
|
|
1804
|
-
}
|
|
1805
|
-
};
|
|
1806
|
-
exports.Security2CCCommandsSupportedReport = Security2CCCommandsSupportedReport;
|
|
1807
|
-
exports.Security2CCCommandsSupportedReport = Security2CCCommandsSupportedReport = Security2CCCommandsSupportedReport_1 = __decorate([
|
|
1808
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.CommandsSupportedReport)
|
|
1809
|
-
], Security2CCCommandsSupportedReport);
|
|
1810
|
-
let Security2CCCommandsSupportedGet = class Security2CCCommandsSupportedGet extends Security2CC {
|
|
1811
|
-
};
|
|
1812
|
-
exports.Security2CCCommandsSupportedGet = Security2CCCommandsSupportedGet;
|
|
1813
|
-
exports.Security2CCCommandsSupportedGet = Security2CCCommandsSupportedGet = __decorate([
|
|
1814
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.Security2Command.CommandsSupportedGet),
|
|
1815
|
-
(0, CommandClassDecorators_1.expectedCCResponse)(Security2CCCommandsSupportedReport)
|
|
1816
|
-
], Security2CCCommandsSupportedGet);
|
|
1817
|
-
//# sourceMappingURL=Security2CC.js.map
|