electron-cast 0.3.1 → 0.5.0-next.1
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/CHANGELOG.md +340 -0
- package/CONTRIBUTING.md +305 -0
- package/README.md +215 -60
- package/SECURITY.md +324 -0
- package/dist/cjs/client/auth/build-time.d.ts +7 -0
- package/dist/cjs/client/auth/build-time.js +11 -0
- package/dist/cjs/client/auth/build-time.js.map +1 -0
- package/dist/cjs/client/auth/cast-auth.d.ts +46 -0
- package/dist/cjs/client/auth/cast-auth.js +145 -0
- package/dist/cjs/client/auth/cast-auth.js.map +1 -0
- package/dist/cjs/client/auth/cast-cert-validator.d.ts +34 -0
- package/dist/cjs/client/auth/cast-cert-validator.js +89 -0
- package/dist/cjs/client/auth/cast-cert-validator.js.map +1 -0
- package/dist/cjs/client/auth/crl.d.ts +45 -0
- package/dist/cjs/client/auth/crl.js +227 -0
- package/dist/cjs/client/auth/crl.js.map +1 -0
- package/dist/cjs/client/auth/der.d.ts +62 -0
- package/dist/cjs/client/auth/der.js +208 -0
- package/dist/cjs/client/auth/der.js.map +1 -0
- package/dist/cjs/client/auth/names.d.ts +52 -0
- package/dist/cjs/client/auth/names.js +447 -0
- package/dist/cjs/client/auth/names.js.map +1 -0
- package/dist/cjs/client/auth/path-validator.d.ts +29 -0
- package/dist/cjs/client/auth/path-validator.js +421 -0
- package/dist/cjs/client/auth/path-validator.js.map +1 -0
- package/dist/cjs/client/auth/trust-data.d.ts +24 -0
- package/dist/cjs/client/auth/trust-data.js +97 -0
- package/dist/cjs/client/auth/trust-data.js.map +1 -0
- package/dist/cjs/client/auth/x509.d.ts +109 -0
- package/dist/cjs/client/auth/x509.js +442 -0
- package/dist/cjs/client/auth/x509.js.map +1 -0
- package/dist/cjs/client/cast-client.d.ts +111 -0
- package/dist/cjs/client/cast-client.js +505 -0
- package/dist/cjs/client/cast-client.js.map +1 -0
- package/dist/cjs/client/errors.d.ts +28 -0
- package/dist/cjs/client/errors.js +50 -0
- package/dist/cjs/client/errors.js.map +1 -0
- package/dist/cjs/client/index.d.ts +6 -0
- package/dist/cjs/client/index.js +21 -0
- package/dist/cjs/client/index.js.map +1 -0
- package/dist/cjs/client/namespaces.d.ts +9 -0
- package/dist/cjs/client/namespaces.js +13 -0
- package/dist/cjs/client/namespaces.js.map +1 -0
- package/dist/cjs/client/types.d.ts +27 -0
- package/dist/cjs/client/types.js +3 -0
- package/dist/cjs/client/types.js.map +1 -0
- package/dist/cjs/dial/dial-registry.d.ts +104 -0
- package/dist/cjs/dial/dial-registry.js +301 -0
- package/dist/cjs/dial/dial-registry.js.map +1 -0
- package/dist/cjs/dial/dial-sink-service.d.ts +108 -0
- package/dist/cjs/dial/dial-sink-service.js +314 -0
- package/dist/cjs/dial/dial-sink-service.js.map +1 -0
- package/dist/cjs/dial/http.d.ts +40 -0
- package/dist/cjs/dial/http.js +172 -0
- package/dist/cjs/dial/http.js.map +1 -0
- package/dist/cjs/dial/index.d.ts +63 -0
- package/dist/cjs/dial/index.js +134 -0
- package/dist/cjs/dial/index.js.map +1 -0
- package/dist/cjs/dial/origins.d.ts +4 -0
- package/dist/cjs/dial/origins.js +36 -0
- package/dist/cjs/dial/origins.js.map +1 -0
- package/dist/cjs/dial/parse.d.ts +101 -0
- package/dist/cjs/dial/parse.js +296 -0
- package/dist/cjs/dial/parse.js.map +1 -0
- package/dist/cjs/dial/route-provider.d.ts +96 -0
- package/dist/cjs/dial/route-provider.js +376 -0
- package/dist/cjs/dial/route-provider.js.map +1 -0
- package/dist/cjs/dial/ssdp-socket.d.ts +34 -0
- package/dist/cjs/dial/ssdp-socket.js +72 -0
- package/dist/cjs/dial/ssdp-socket.js.map +1 -0
- package/dist/cjs/dial/xml.d.ts +13 -0
- package/dist/cjs/dial/xml.js +208 -0
- package/dist/cjs/dial/xml.js.map +1 -0
- package/dist/cjs/discovery/cast-discovery.d.ts +105 -0
- package/dist/cjs/discovery/cast-discovery.js +323 -0
- package/dist/cjs/discovery/cast-discovery.js.map +1 -0
- package/dist/cjs/discovery/device-cache.d.ts +54 -0
- package/dist/cjs/discovery/device-cache.js +240 -0
- package/dist/cjs/discovery/device-cache.js.map +1 -0
- package/dist/cjs/discovery/dns-packet.d.ts +70 -0
- package/dist/cjs/discovery/dns-packet.js +251 -0
- package/dist/cjs/discovery/dns-packet.js.map +1 -0
- package/dist/cjs/discovery/index.d.ts +5 -0
- package/dist/cjs/discovery/index.js +22 -0
- package/dist/cjs/discovery/index.js.map +1 -0
- package/dist/cjs/discovery/ip-policy.d.ts +20 -0
- package/dist/cjs/discovery/ip-policy.js +109 -0
- package/dist/cjs/discovery/ip-policy.js.map +1 -0
- package/dist/cjs/discovery/udp-socket.d.ts +19 -0
- package/dist/cjs/discovery/udp-socket.js +166 -0
- package/dist/cjs/discovery/udp-socket.js.map +1 -0
- package/dist/cjs/electron/access-code.d.ts +221 -0
- package/dist/cjs/electron/access-code.js +586 -0
- package/dist/cjs/electron/access-code.js.map +1 -0
- package/dist/cjs/electron/app-discovery.d.ts +82 -0
- package/dist/cjs/electron/app-discovery.js +219 -0
- package/dist/cjs/electron/app-discovery.js.map +1 -0
- package/dist/cjs/electron/default-presentation.d.ts +38 -0
- package/dist/cjs/electron/default-presentation.js +88 -0
- package/dist/cjs/electron/default-presentation.js.map +1 -0
- package/dist/cjs/electron/main.d.ts +173 -0
- package/dist/cjs/electron/main.js +990 -0
- package/dist/cjs/electron/main.js.map +1 -0
- package/dist/cjs/electron/manager-api.d.ts +314 -0
- package/dist/cjs/electron/manager-api.js +402 -0
- package/dist/cjs/electron/manager-api.js.map +1 -0
- package/dist/cjs/electron/media-controller.d.ts +79 -0
- package/dist/cjs/electron/media-controller.js +251 -0
- package/dist/cjs/electron/media-controller.js.map +1 -0
- package/dist/cjs/electron/network-monitor.d.ts +61 -0
- package/dist/cjs/electron/network-monitor.js +124 -0
- package/dist/cjs/electron/network-monitor.js.map +1 -0
- package/dist/cjs/electron/preload.d.ts +39 -0
- package/dist/cjs/electron/preload.js +96 -0
- package/dist/cjs/electron/preload.js.map +1 -0
- package/dist/cjs/electron/presentation-envelope.d.ts +60 -0
- package/dist/cjs/electron/presentation-envelope.js +318 -0
- package/dist/cjs/electron/presentation-envelope.js.map +1 -0
- package/dist/cjs/electron/presentation-handler.d.ts +135 -0
- package/dist/cjs/electron/presentation-handler.js +643 -0
- package/dist/cjs/electron/presentation-handler.js.map +1 -0
- package/dist/cjs/electron/presentation-source.d.ts +76 -0
- package/dist/cjs/electron/presentation-source.js +132 -0
- package/dist/cjs/electron/presentation-source.js.map +1 -0
- package/dist/cjs/electron/session-service.d.ts +348 -0
- package/dist/cjs/electron/session-service.js +1273 -0
- package/dist/cjs/electron/session-service.js.map +1 -0
- package/dist/cjs/electron/session-tracker.d.ts +82 -0
- package/dist/cjs/electron/session-tracker.js +225 -0
- package/dist/cjs/electron/session-tracker.js.map +1 -0
- package/dist/cjs/electron/sink-service.d.ts +246 -0
- package/dist/cjs/electron/sink-service.js +606 -0
- package/dist/cjs/electron/sink-service.js.map +1 -0
- package/dist/cjs/electron/wired-display/controller.d.ts +76 -0
- package/dist/cjs/electron/wired-display/controller.js +198 -0
- package/dist/cjs/electron/wired-display/controller.js.map +1 -0
- package/dist/cjs/electron/wired-display/displays.d.ts +44 -0
- package/dist/cjs/electron/wired-display/displays.js +98 -0
- package/dist/cjs/electron/wired-display/displays.js.map +1 -0
- package/dist/cjs/electron/wired-display/electron-windows.d.ts +111 -0
- package/dist/cjs/electron/wired-display/electron-windows.js +306 -0
- package/dist/cjs/electron/wired-display/electron-windows.js.map +1 -0
- package/dist/cjs/electron/wired-display/index.d.ts +90 -0
- package/dist/cjs/electron/wired-display/index.js +115 -0
- package/dist/cjs/electron/wired-display/index.js.map +1 -0
- package/dist/cjs/electron/wired-display/local-presentation.d.ts +98 -0
- package/dist/cjs/electron/wired-display/local-presentation.js +234 -0
- package/dist/cjs/electron/wired-display/local-presentation.js.map +1 -0
- package/dist/cjs/electron/wired-display/provider.d.ts +112 -0
- package/dist/cjs/electron/wired-display/provider.js +202 -0
- package/dist/cjs/electron/wired-display/provider.js.map +1 -0
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.js +27 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/mirroring/backend.d.ts +76 -0
- package/dist/cjs/mirroring/backend.js +21 -0
- package/dist/cjs/mirroring/backend.js.map +1 -0
- package/dist/cjs/mirroring/electron/agent-protocol.d.ts +158 -0
- package/dist/cjs/mirroring/electron/agent-protocol.js +11 -0
- package/dist/cjs/mirroring/electron/agent-protocol.js.map +1 -0
- package/dist/cjs/mirroring/electron/agent-source.d.ts +20 -0
- package/dist/cjs/mirroring/electron/agent-source.js +621 -0
- package/dist/cjs/mirroring/electron/agent-source.js.map +1 -0
- package/dist/cjs/mirroring/electron/engine-process.d.ts +87 -0
- package/dist/cjs/mirroring/electron/engine-process.js +81 -0
- package/dist/cjs/mirroring/electron/engine-process.js.map +1 -0
- package/dist/cjs/mirroring/electron/host.d.ts +89 -0
- package/dist/cjs/mirroring/electron/host.js +321 -0
- package/dist/cjs/mirroring/electron/host.js.map +1 -0
- package/dist/cjs/mirroring/electron/port-backend.d.ts +107 -0
- package/dist/cjs/mirroring/electron/port-backend.js +446 -0
- package/dist/cjs/mirroring/electron/port-backend.js.map +1 -0
- package/dist/cjs/mirroring/encoding-support.d.ts +66 -0
- package/dist/cjs/mirroring/encoding-support.js +89 -0
- package/dist/cjs/mirroring/encoding-support.js.map +1 -0
- package/dist/cjs/mirroring/engine.d.ts +16 -0
- package/dist/cjs/mirroring/engine.js +78 -0
- package/dist/cjs/mirroring/engine.js.map +1 -0
- package/dist/cjs/mirroring/mirror-settings.d.ts +101 -0
- package/dist/cjs/mirroring/mirror-settings.js +140 -0
- package/dist/cjs/mirroring/mirror-settings.js.map +1 -0
- package/dist/cjs/mirroring/mirroring-activity.d.ts +207 -0
- package/dist/cjs/mirroring/mirroring-activity.js +367 -0
- package/dist/cjs/mirroring/mirroring-activity.js.map +1 -0
- package/dist/cjs/mirroring/mirroring-manager.d.ts +134 -0
- package/dist/cjs/mirroring/mirroring-manager.js +286 -0
- package/dist/cjs/mirroring/mirroring-manager.js.map +1 -0
- package/dist/cjs/mirroring/protocol/answer.d.ts +87 -0
- package/dist/cjs/mirroring/protocol/answer.js +233 -0
- package/dist/cjs/mirroring/protocol/answer.js.map +1 -0
- package/dist/cjs/mirroring/protocol/constants.d.ts +64 -0
- package/dist/cjs/mirroring/protocol/constants.js +70 -0
- package/dist/cjs/mirroring/protocol/constants.js.map +1 -0
- package/dist/cjs/mirroring/protocol/errors.d.ts +25 -0
- package/dist/cjs/mirroring/protocol/errors.js +34 -0
- package/dist/cjs/mirroring/protocol/errors.js.map +1 -0
- package/dist/cjs/mirroring/protocol/frame-id.d.ts +9 -0
- package/dist/cjs/mirroring/protocol/frame-id.js +24 -0
- package/dist/cjs/mirroring/protocol/frame-id.js.map +1 -0
- package/dist/cjs/mirroring/protocol/messenger.d.ts +42 -0
- package/dist/cjs/mirroring/protocol/messenger.js +122 -0
- package/dist/cjs/mirroring/protocol/messenger.js.map +1 -0
- package/dist/cjs/mirroring/protocol/offer.d.ts +109 -0
- package/dist/cjs/mirroring/protocol/offer.js +192 -0
- package/dist/cjs/mirroring/protocol/offer.js.map +1 -0
- package/dist/cjs/mirroring/protocol/recommendations.d.ts +28 -0
- package/dist/cjs/mirroring/protocol/recommendations.js +103 -0
- package/dist/cjs/mirroring/protocol/recommendations.js.map +1 -0
- package/dist/cjs/mirroring/routing.d.ts +60 -0
- package/dist/cjs/mirroring/routing.js +147 -0
- package/dist/cjs/mirroring/routing.js.map +1 -0
- package/dist/cjs/mirroring/rtcp/ntp.d.ts +27 -0
- package/dist/cjs/mirroring/rtcp/ntp.js +62 -0
- package/dist/cjs/mirroring/rtcp/ntp.js.map +1 -0
- package/dist/cjs/mirroring/rtcp/parser.d.ts +50 -0
- package/dist/cjs/mirroring/rtcp/parser.js +270 -0
- package/dist/cjs/mirroring/rtcp/parser.js.map +1 -0
- package/dist/cjs/mirroring/rtcp/sender-report.d.ts +32 -0
- package/dist/cjs/mirroring/rtcp/sender-report.js +56 -0
- package/dist/cjs/mirroring/rtcp/sender-report.js.map +1 -0
- package/dist/cjs/mirroring/rtcp/wire.d.ts +54 -0
- package/dist/cjs/mirroring/rtcp/wire.js +73 -0
- package/dist/cjs/mirroring/rtcp/wire.js.map +1 -0
- package/dist/cjs/mirroring/rtp/frame-crypto.d.ts +11 -0
- package/dist/cjs/mirroring/rtp/frame-crypto.js +39 -0
- package/dist/cjs/mirroring/rtp/frame-crypto.js.map +1 -0
- package/dist/cjs/mirroring/rtp/frame.d.ts +23 -0
- package/dist/cjs/mirroring/rtp/frame.js +3 -0
- package/dist/cjs/mirroring/rtp/frame.js.map +1 -0
- package/dist/cjs/mirroring/rtp/packetizer.d.ts +27 -0
- package/dist/cjs/mirroring/rtp/packetizer.js +92 -0
- package/dist/cjs/mirroring/rtp/packetizer.js.map +1 -0
- package/dist/cjs/mirroring/sender/audio-sender.d.ts +23 -0
- package/dist/cjs/mirroring/sender/audio-sender.js +52 -0
- package/dist/cjs/mirroring/sender/audio-sender.js.map +1 -0
- package/dist/cjs/mirroring/sender/bandwidth-estimator.d.ts +26 -0
- package/dist/cjs/mirroring/sender/bandwidth-estimator.js +107 -0
- package/dist/cjs/mirroring/sender/bandwidth-estimator.js.map +1 -0
- package/dist/cjs/mirroring/sender/capture-size-oracle.d.ts +121 -0
- package/dist/cjs/mirroring/sender/capture-size-oracle.js +440 -0
- package/dist/cjs/mirroring/sender/capture-size-oracle.js.map +1 -0
- package/dist/cjs/mirroring/sender/frame-sender.d.ts +103 -0
- package/dist/cjs/mirroring/sender/frame-sender.js +217 -0
- package/dist/cjs/mirroring/sender/frame-sender.js.map +1 -0
- package/dist/cjs/mirroring/sender/packet-router.d.ts +74 -0
- package/dist/cjs/mirroring/sender/packet-router.js +196 -0
- package/dist/cjs/mirroring/sender/packet-router.js.map +1 -0
- package/dist/cjs/mirroring/sender/sender-session.d.ts +85 -0
- package/dist/cjs/mirroring/sender/sender-session.js +240 -0
- package/dist/cjs/mirroring/sender/sender-session.js.map +1 -0
- package/dist/cjs/mirroring/sender/sender.d.ts +120 -0
- package/dist/cjs/mirroring/sender/sender.js +457 -0
- package/dist/cjs/mirroring/sender/sender.js.map +1 -0
- package/dist/cjs/mirroring/sender/video-encoder-metrics.d.ts +29 -0
- package/dist/cjs/mirroring/sender/video-encoder-metrics.js +64 -0
- package/dist/cjs/mirroring/sender/video-encoder-metrics.js.map +1 -0
- package/dist/cjs/mirroring/sender/video-sender.d.ts +95 -0
- package/dist/cjs/mirroring/sender/video-sender.js +183 -0
- package/dist/cjs/mirroring/sender/video-sender.js.map +1 -0
- package/dist/cjs/mirroring/session-host.d.ts +185 -0
- package/dist/cjs/mirroring/session-host.js +630 -0
- package/dist/cjs/mirroring/session-host.js.map +1 -0
- package/dist/cjs/mirroring/stats/clock-offset-estimator.d.ts +11 -0
- package/dist/cjs/mirroring/stats/clock-offset-estimator.js +123 -0
- package/dist/cjs/mirroring/stats/clock-offset-estimator.js.map +1 -0
- package/dist/cjs/mirroring/stats/openscreen-stats-client.d.ts +12 -0
- package/dist/cjs/mirroring/stats/openscreen-stats-client.js +21 -0
- package/dist/cjs/mirroring/stats/openscreen-stats-client.js.map +1 -0
- package/dist/cjs/mirroring/stats/sorted-map.d.ts +23 -0
- package/dist/cjs/mirroring/stats/sorted-map.js +70 -0
- package/dist/cjs/mirroring/stats/sorted-map.js.map +1 -0
- package/dist/cjs/mirroring/stats/statistics-analyzer.d.ts +50 -0
- package/dist/cjs/mirroring/stats/statistics-analyzer.js +339 -0
- package/dist/cjs/mirroring/stats/statistics-analyzer.js.map +1 -0
- package/dist/cjs/mirroring/stats/statistics-collector.d.ts +29 -0
- package/dist/cjs/mirroring/stats/statistics-collector.js +53 -0
- package/dist/cjs/mirroring/stats/statistics-collector.js.map +1 -0
- package/dist/cjs/mirroring/stats/statistics-common.d.ts +61 -0
- package/dist/cjs/mirroring/stats/statistics-common.js +45 -0
- package/dist/cjs/mirroring/stats/statistics-common.js.map +1 -0
- package/dist/cjs/mirroring/stats/statistics-dispatcher.d.ts +28 -0
- package/dist/cjs/mirroring/stats/statistics-dispatcher.js +104 -0
- package/dist/cjs/mirroring/stats/statistics-dispatcher.js.map +1 -0
- package/dist/cjs/mirroring/stats/statistics.d.ts +84 -0
- package/dist/cjs/mirroring/stats/statistics.js +147 -0
- package/dist/cjs/mirroring/stats/statistics.js.map +1 -0
- package/dist/cjs/mirroring/transport/udp-environment.d.ts +40 -0
- package/dist/cjs/mirroring/transport/udp-environment.js +97 -0
- package/dist/cjs/mirroring/transport/udp-environment.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/polyfill/bridge-types.d.ts +97 -0
- package/dist/cjs/polyfill/bridge-types.js +3 -0
- package/dist/cjs/polyfill/bridge-types.js.map +1 -0
- package/dist/cjs/polyfill/install.d.ts +12 -0
- package/dist/cjs/polyfill/install.js +1569 -0
- package/dist/cjs/polyfill/install.js.map +1 -0
- package/dist/cjs/polyfill/presentation-receiver.d.ts +12 -0
- package/dist/cjs/polyfill/presentation-receiver.js +369 -0
- package/dist/cjs/polyfill/presentation-receiver.js.map +1 -0
- package/dist/cjs/polyfill/presentation-standin.d.ts +13 -0
- package/dist/cjs/polyfill/presentation-standin.js +421 -0
- package/dist/cjs/polyfill/presentation-standin.js.map +1 -0
- package/dist/cjs/protocol/cast-message.d.ts +20 -0
- package/dist/cjs/protocol/cast-message.js +171 -0
- package/dist/cjs/protocol/cast-message.js.map +1 -0
- package/dist/cjs/protocol/device-auth.d.ts +61 -0
- package/dist/cjs/protocol/device-auth.js +113 -0
- package/dist/cjs/protocol/device-auth.js.map +1 -0
- package/dist/cjs/protocol/errors.d.ts +4 -0
- package/dist/cjs/protocol/errors.js +12 -0
- package/dist/cjs/protocol/errors.js.map +1 -0
- package/dist/cjs/protocol/framing.d.ts +18 -0
- package/dist/cjs/protocol/framing.js +100 -0
- package/dist/cjs/protocol/framing.js.map +1 -0
- package/dist/cjs/protocol/index.d.ts +4 -0
- package/dist/cjs/protocol/index.js +21 -0
- package/dist/cjs/protocol/index.js.map +1 -0
- package/dist/cjs/protocol/proto-wire.d.ts +11 -0
- package/dist/cjs/protocol/proto-wire.js +64 -0
- package/dist/cjs/protocol/proto-wire.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +56 -0
- package/dist/cli.js.map +1 -0
- package/dist/client/auth/build-time.d.ts +7 -0
- package/dist/client/auth/build-time.js +8 -0
- package/dist/client/auth/build-time.js.map +1 -0
- package/dist/client/auth/cast-auth.d.ts +46 -0
- package/dist/client/auth/cast-auth.js +141 -0
- package/dist/client/auth/cast-auth.js.map +1 -0
- package/dist/client/auth/cast-cert-validator.d.ts +34 -0
- package/dist/client/auth/cast-cert-validator.js +86 -0
- package/dist/client/auth/cast-cert-validator.js.map +1 -0
- package/dist/client/auth/crl.d.ts +45 -0
- package/dist/client/auth/crl.js +221 -0
- package/dist/client/auth/crl.js.map +1 -0
- package/dist/client/auth/der.d.ts +62 -0
- package/dist/client/auth/der.js +196 -0
- package/dist/client/auth/der.js.map +1 -0
- package/dist/client/auth/names.d.ts +52 -0
- package/dist/client/auth/names.js +438 -0
- package/dist/client/auth/names.js.map +1 -0
- package/dist/client/auth/path-validator.d.ts +29 -0
- package/dist/client/auth/path-validator.js +417 -0
- package/dist/client/auth/path-validator.js.map +1 -0
- package/dist/client/auth/trust-data.d.ts +24 -0
- package/dist/client/auth/trust-data.js +94 -0
- package/dist/client/auth/trust-data.js.map +1 -0
- package/dist/client/auth/x509.d.ts +109 -0
- package/dist/client/auth/x509.js +430 -0
- package/dist/client/auth/x509.js.map +1 -0
- package/dist/client/cast-client.d.ts +20 -1
- package/dist/client/cast-client.js +74 -3
- package/dist/client/cast-client.js.map +1 -1
- package/dist/client/errors.d.ts +11 -0
- package/dist/client/errors.js +13 -0
- package/dist/client/errors.js.map +1 -1
- package/dist/client/index.d.ts +2 -0
- package/dist/dial/dial-registry.d.ts +104 -0
- package/dist/dial/dial-registry.js +297 -0
- package/dist/dial/dial-registry.js.map +1 -0
- package/dist/dial/dial-sink-service.d.ts +108 -0
- package/dist/dial/dial-sink-service.js +310 -0
- package/dist/dial/dial-sink-service.js.map +1 -0
- package/dist/dial/http.d.ts +40 -0
- package/dist/dial/http.js +165 -0
- package/dist/dial/http.js.map +1 -0
- package/dist/dial/index.d.ts +63 -0
- package/dist/dial/index.js +115 -0
- package/dist/dial/index.js.map +1 -0
- package/dist/dial/origins.d.ts +4 -0
- package/dist/dial/origins.js +32 -0
- package/dist/dial/origins.js.map +1 -0
- package/dist/dial/parse.d.ts +101 -0
- package/dist/dial/parse.js +281 -0
- package/dist/dial/parse.js.map +1 -0
- package/dist/dial/route-provider.d.ts +96 -0
- package/dist/dial/route-provider.js +369 -0
- package/dist/dial/route-provider.js.map +1 -0
- package/dist/dial/ssdp-socket.d.ts +34 -0
- package/dist/dial/ssdp-socket.js +65 -0
- package/dist/dial/ssdp-socket.js.map +1 -0
- package/dist/dial/xml.d.ts +13 -0
- package/dist/dial/xml.js +204 -0
- package/dist/dial/xml.js.map +1 -0
- package/dist/dial-test/cli-main.d.ts +17 -0
- package/dist/dial-test/cli-main.js +130 -0
- package/dist/dial-test/cli-main.js.map +1 -0
- package/dist/dial-test/report.d.ts +55 -0
- package/dist/dial-test/report.js +77 -0
- package/dist/dial-test/report.js.map +1 -0
- package/dist/dial-test/runner.d.ts +42 -0
- package/dist/dial-test/runner.js +566 -0
- package/dist/dial-test/runner.js.map +1 -0
- package/dist/dial-test/scrub.d.ts +14 -0
- package/dist/dial-test/scrub.js +73 -0
- package/dist/dial-test/scrub.js.map +1 -0
- package/dist/discovery/cast-discovery.d.ts +23 -2
- package/dist/discovery/cast-discovery.js +94 -14
- package/dist/discovery/cast-discovery.js.map +1 -1
- package/dist/discovery/device-cache.d.ts +15 -1
- package/dist/discovery/device-cache.js +31 -7
- package/dist/discovery/device-cache.js.map +1 -1
- package/dist/discovery/index.d.ts +1 -0
- package/dist/discovery/index.js +1 -0
- package/dist/discovery/index.js.map +1 -1
- package/dist/discovery/ip-policy.d.ts +20 -0
- package/dist/discovery/ip-policy.js +103 -0
- package/dist/discovery/ip-policy.js.map +1 -0
- package/dist/discovery/udp-socket.d.ts +8 -1
- package/dist/discovery/udp-socket.js +59 -5
- package/dist/discovery/udp-socket.js.map +1 -1
- package/dist/electron/access-code.d.ts +221 -0
- package/dist/electron/access-code.js +577 -0
- package/dist/electron/access-code.js.map +1 -0
- package/dist/electron/app-discovery.d.ts +82 -0
- package/dist/electron/app-discovery.js +215 -0
- package/dist/electron/app-discovery.js.map +1 -0
- package/dist/electron/default-presentation.d.ts +38 -0
- package/dist/electron/default-presentation.js +83 -0
- package/dist/electron/default-presentation.js.map +1 -0
- package/dist/electron/main.d.ts +122 -13
- package/dist/electron/main.js +776 -63
- package/dist/electron/main.js.map +1 -1
- package/dist/electron/manager-api.d.ts +314 -0
- package/dist/electron/manager-api.js +390 -0
- package/dist/electron/manager-api.js.map +1 -0
- package/dist/electron/media-controller.d.ts +79 -0
- package/dist/electron/media-controller.js +248 -0
- package/dist/electron/media-controller.js.map +1 -0
- package/dist/electron/network-monitor.d.ts +61 -0
- package/dist/electron/network-monitor.js +117 -0
- package/dist/electron/network-monitor.js.map +1 -0
- package/dist/electron/preload.d.ts +5 -0
- package/dist/electron/preload.js +9 -1
- package/dist/electron/preload.js.map +1 -1
- package/dist/electron/presentation-envelope.js +7 -1
- package/dist/electron/presentation-envelope.js.map +1 -1
- package/dist/electron/presentation-handler.d.ts +39 -4
- package/dist/electron/presentation-handler.js +208 -57
- package/dist/electron/presentation-handler.js.map +1 -1
- package/dist/electron/presentation-source.d.ts +76 -0
- package/dist/electron/presentation-source.js +125 -0
- package/dist/electron/presentation-source.js.map +1 -0
- package/dist/electron/session-service.d.ts +225 -10
- package/dist/electron/session-service.js +735 -151
- package/dist/electron/session-service.js.map +1 -1
- package/dist/electron/session-tracker.d.ts +82 -0
- package/dist/electron/session-tracker.js +219 -0
- package/dist/electron/session-tracker.js.map +1 -0
- package/dist/electron/sink-service.d.ts +246 -0
- package/dist/electron/sink-service.js +602 -0
- package/dist/electron/sink-service.js.map +1 -0
- package/dist/electron/wired-display/controller.d.ts +76 -0
- package/dist/electron/wired-display/controller.js +194 -0
- package/dist/electron/wired-display/controller.js.map +1 -0
- package/dist/electron/wired-display/displays.d.ts +44 -0
- package/dist/electron/wired-display/displays.js +91 -0
- package/dist/electron/wired-display/displays.js.map +1 -0
- package/dist/electron/wired-display/electron-windows.d.ts +111 -0
- package/dist/electron/wired-display/electron-windows.js +301 -0
- package/dist/electron/wired-display/electron-windows.js.map +1 -0
- package/dist/electron/wired-display/index.d.ts +90 -0
- package/dist/electron/wired-display/index.js +99 -0
- package/dist/electron/wired-display/index.js.map +1 -0
- package/dist/electron/wired-display/local-presentation.d.ts +98 -0
- package/dist/electron/wired-display/local-presentation.js +228 -0
- package/dist/electron/wired-display/local-presentation.js.map +1 -0
- package/dist/electron/wired-display/provider.d.ts +112 -0
- package/dist/electron/wired-display/provider.js +197 -0
- package/dist/electron/wired-display/provider.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mirroring/backend.d.ts +76 -0
- package/dist/mirroring/backend.js +18 -0
- package/dist/mirroring/backend.js.map +1 -0
- package/dist/mirroring/electron/agent-protocol.d.ts +158 -0
- package/dist/mirroring/electron/agent-protocol.js +10 -0
- package/dist/mirroring/electron/agent-protocol.js.map +1 -0
- package/dist/mirroring/electron/agent-source.d.ts +20 -0
- package/dist/mirroring/electron/agent-source.js +618 -0
- package/dist/mirroring/electron/agent-source.js.map +1 -0
- package/dist/mirroring/electron/engine-process.d.ts +87 -0
- package/dist/mirroring/electron/engine-process.js +78 -0
- package/dist/mirroring/electron/engine-process.js.map +1 -0
- package/dist/mirroring/electron/host.d.ts +89 -0
- package/dist/mirroring/electron/host.js +318 -0
- package/dist/mirroring/electron/host.js.map +1 -0
- package/dist/mirroring/electron/port-backend.d.ts +107 -0
- package/dist/mirroring/electron/port-backend.js +441 -0
- package/dist/mirroring/electron/port-backend.js.map +1 -0
- package/dist/mirroring/encoding-support.d.ts +66 -0
- package/dist/mirroring/encoding-support.js +81 -0
- package/dist/mirroring/encoding-support.js.map +1 -0
- package/dist/mirroring/engine.d.ts +16 -0
- package/dist/mirroring/engine.js +75 -0
- package/dist/mirroring/engine.js.map +1 -0
- package/dist/mirroring/mirror-settings.d.ts +101 -0
- package/dist/mirroring/mirror-settings.js +134 -0
- package/dist/mirroring/mirror-settings.js.map +1 -0
- package/dist/mirroring/mirroring-activity.d.ts +207 -0
- package/dist/mirroring/mirroring-activity.js +362 -0
- package/dist/mirroring/mirroring-activity.js.map +1 -0
- package/dist/mirroring/mirroring-manager.d.ts +134 -0
- package/dist/mirroring/mirroring-manager.js +281 -0
- package/dist/mirroring/mirroring-manager.js.map +1 -0
- package/dist/mirroring/protocol/answer.d.ts +87 -0
- package/dist/mirroring/protocol/answer.js +226 -0
- package/dist/mirroring/protocol/answer.js.map +1 -0
- package/dist/mirroring/protocol/constants.d.ts +64 -0
- package/dist/mirroring/protocol/constants.js +66 -0
- package/dist/mirroring/protocol/constants.js.map +1 -0
- package/dist/mirroring/protocol/errors.d.ts +25 -0
- package/dist/mirroring/protocol/errors.js +29 -0
- package/dist/mirroring/protocol/errors.js.map +1 -0
- package/dist/mirroring/protocol/frame-id.d.ts +9 -0
- package/dist/mirroring/protocol/frame-id.js +20 -0
- package/dist/mirroring/protocol/frame-id.js.map +1 -0
- package/dist/mirroring/protocol/messenger.d.ts +42 -0
- package/dist/mirroring/protocol/messenger.js +118 -0
- package/dist/mirroring/protocol/messenger.js.map +1 -0
- package/dist/mirroring/protocol/offer.d.ts +109 -0
- package/dist/mirroring/protocol/offer.js +176 -0
- package/dist/mirroring/protocol/offer.js.map +1 -0
- package/dist/mirroring/protocol/recommendations.d.ts +28 -0
- package/dist/mirroring/protocol/recommendations.js +99 -0
- package/dist/mirroring/protocol/recommendations.js.map +1 -0
- package/dist/mirroring/routing.d.ts +60 -0
- package/dist/mirroring/routing.js +130 -0
- package/dist/mirroring/routing.js.map +1 -0
- package/dist/mirroring/rtcp/ntp.d.ts +27 -0
- package/dist/mirroring/rtcp/ntp.js +57 -0
- package/dist/mirroring/rtcp/ntp.js.map +1 -0
- package/dist/mirroring/rtcp/parser.d.ts +50 -0
- package/dist/mirroring/rtcp/parser.js +265 -0
- package/dist/mirroring/rtcp/parser.js.map +1 -0
- package/dist/mirroring/rtcp/sender-report.d.ts +32 -0
- package/dist/mirroring/rtcp/sender-report.js +51 -0
- package/dist/mirroring/rtcp/sender-report.js.map +1 -0
- package/dist/mirroring/rtcp/wire.d.ts +54 -0
- package/dist/mirroring/rtcp/wire.js +68 -0
- package/dist/mirroring/rtcp/wire.js.map +1 -0
- package/dist/mirroring/rtp/frame-crypto.d.ts +11 -0
- package/dist/mirroring/rtp/frame-crypto.js +35 -0
- package/dist/mirroring/rtp/frame-crypto.js.map +1 -0
- package/dist/mirroring/rtp/frame.d.ts +23 -0
- package/dist/mirroring/rtp/frame.js +2 -0
- package/dist/mirroring/rtp/frame.js.map +1 -0
- package/dist/mirroring/rtp/packetizer.d.ts +27 -0
- package/dist/mirroring/rtp/packetizer.js +88 -0
- package/dist/mirroring/rtp/packetizer.js.map +1 -0
- package/dist/mirroring/sender/audio-sender.d.ts +23 -0
- package/dist/mirroring/sender/audio-sender.js +54 -0
- package/dist/mirroring/sender/audio-sender.js.map +1 -0
- package/dist/mirroring/sender/bandwidth-estimator.d.ts +26 -0
- package/dist/mirroring/sender/bandwidth-estimator.js +103 -0
- package/dist/mirroring/sender/bandwidth-estimator.js.map +1 -0
- package/dist/mirroring/sender/capture-size-oracle.d.ts +121 -0
- package/dist/mirroring/sender/capture-size-oracle.js +433 -0
- package/dist/mirroring/sender/capture-size-oracle.js.map +1 -0
- package/dist/mirroring/sender/frame-sender.d.ts +103 -0
- package/dist/mirroring/sender/frame-sender.js +212 -0
- package/dist/mirroring/sender/frame-sender.js.map +1 -0
- package/dist/mirroring/sender/packet-router.d.ts +74 -0
- package/dist/mirroring/sender/packet-router.js +191 -0
- package/dist/mirroring/sender/packet-router.js.map +1 -0
- package/dist/mirroring/sender/sender-session.d.ts +85 -0
- package/dist/mirroring/sender/sender-session.js +235 -0
- package/dist/mirroring/sender/sender-session.js.map +1 -0
- package/dist/mirroring/sender/sender.d.ts +120 -0
- package/dist/mirroring/sender/sender.js +452 -0
- package/dist/mirroring/sender/sender.js.map +1 -0
- package/dist/mirroring/sender/video-encoder-metrics.d.ts +29 -0
- package/dist/mirroring/sender/video-encoder-metrics.js +58 -0
- package/dist/mirroring/sender/video-encoder-metrics.js.map +1 -0
- package/dist/mirroring/sender/video-sender.d.ts +95 -0
- package/dist/mirroring/sender/video-sender.js +190 -0
- package/dist/mirroring/sender/video-sender.js.map +1 -0
- package/dist/mirroring/session-host.d.ts +185 -0
- package/dist/mirroring/session-host.js +625 -0
- package/dist/mirroring/session-host.js.map +1 -0
- package/dist/mirroring/stats/clock-offset-estimator.d.ts +11 -0
- package/dist/mirroring/stats/clock-offset-estimator.js +120 -0
- package/dist/mirroring/stats/clock-offset-estimator.js.map +1 -0
- package/dist/mirroring/stats/openscreen-stats-client.d.ts +12 -0
- package/dist/mirroring/stats/openscreen-stats-client.js +17 -0
- package/dist/mirroring/stats/openscreen-stats-client.js.map +1 -0
- package/dist/mirroring/stats/sorted-map.d.ts +23 -0
- package/dist/mirroring/stats/sorted-map.js +66 -0
- package/dist/mirroring/stats/sorted-map.js.map +1 -0
- package/dist/mirroring/stats/statistics-analyzer.d.ts +50 -0
- package/dist/mirroring/stats/statistics-analyzer.js +335 -0
- package/dist/mirroring/stats/statistics-analyzer.js.map +1 -0
- package/dist/mirroring/stats/statistics-collector.d.ts +29 -0
- package/dist/mirroring/stats/statistics-collector.js +49 -0
- package/dist/mirroring/stats/statistics-collector.js.map +1 -0
- package/dist/mirroring/stats/statistics-common.d.ts +61 -0
- package/dist/mirroring/stats/statistics-common.js +39 -0
- package/dist/mirroring/stats/statistics-common.js.map +1 -0
- package/dist/mirroring/stats/statistics-dispatcher.d.ts +28 -0
- package/dist/mirroring/stats/statistics-dispatcher.js +100 -0
- package/dist/mirroring/stats/statistics-dispatcher.js.map +1 -0
- package/dist/mirroring/stats/statistics.d.ts +84 -0
- package/dist/mirroring/stats/statistics.js +141 -0
- package/dist/mirroring/stats/statistics.js.map +1 -0
- package/dist/mirroring/transport/udp-environment.d.ts +40 -0
- package/dist/mirroring/transport/udp-environment.js +93 -0
- package/dist/mirroring/transport/udp-environment.js.map +1 -0
- package/dist/polyfill/bridge-types.d.ts +11 -0
- package/dist/polyfill/presentation-receiver.d.ts +12 -0
- package/dist/polyfill/presentation-receiver.js +366 -0
- package/dist/polyfill/presentation-receiver.js.map +1 -0
- package/dist/polyfill/presentation-standin.js +160 -17
- package/dist/polyfill/presentation-standin.js.map +1 -1
- package/dist/protocol/device-auth.d.ts +61 -0
- package/dist/protocol/device-auth.js +106 -0
- package/dist/protocol/device-auth.js.map +1 -0
- package/dist/protocol/framing.d.ts +1 -1
- package/dist/protocol/framing.js +1 -1
- package/dist/protocol/framing.js.map +1 -1
- package/dist/protocol/index.d.ts +1 -0
- package/dist/protocol/index.js +1 -0
- package/dist/protocol/index.js.map +1 -1
- package/dist/protocol/proto-wire.d.ts +11 -0
- package/dist/protocol/proto-wire.js +60 -0
- package/dist/protocol/proto-wire.js.map +1 -0
- package/docs/API.md +724 -0
- package/docs/ARCHITECTURE.md +242 -0
- package/docs/CHROMIUM-MAP.md +176 -0
- package/docs/DESIGN.md +1189 -0
- package/docs/FAQ.md +123 -0
- package/docs/GETTING-STARTED.md +248 -0
- package/docs/MAIN-API.md +524 -0
- package/docs/TROUBLESHOOTING.md +283 -0
- package/docs/guides/audio-and-groups.md +75 -0
- package/docs/guides/custom-receivers.md +109 -0
- package/docs/guides/device-authentication.md +145 -0
- package/docs/guides/device-picker.md +176 -0
- package/docs/guides/index.md +17 -0
- package/docs/guides/low-level-client.md +103 -0
- package/docs/guides/restart-rejoin.md +172 -0
- package/docs/guides/testing.md +162 -0
- package/docs/guides/windows-and-iframes.md +116 -0
- package/docs/readme/badges/dependencies.svg +1 -0
- package/docs/readme/badges/electron.svg +1 -0
- package/docs/readme/badges/license.svg +1 -0
- package/docs/readme/badges/node.svg +1 -0
- package/docs/readme/board.jpg +0 -0
- package/docs/readme/hero-dark.jpg +0 -0
- package/docs/readme/hero-light.jpg +0 -0
- package/docs/readme/nosignal.jpg +0 -0
- package/docs/readme/parity.jpg +0 -0
- package/docs/readme/trace.svg +22 -0
- package/package.json +67 -16
- package/src/cli.ts +57 -0
- package/src/client/auth/build-time.ts +7 -0
- package/src/client/auth/cast-auth.ts +186 -0
- package/src/client/auth/cast-cert-validator.ts +133 -0
- package/src/client/auth/crl.ts +228 -0
- package/src/client/auth/der.ts +193 -0
- package/src/client/auth/names.ts +411 -0
- package/src/client/auth/path-validator.ts +449 -0
- package/src/client/auth/trust-data.ts +95 -0
- package/src/client/auth/x509.ts +488 -0
- package/src/client/cast-client.ts +85 -3
- package/src/client/errors.ts +29 -0
- package/src/client/index.ts +2 -0
- package/src/dial/dial-registry.ts +316 -0
- package/src/dial/dial-sink-service.ts +343 -0
- package/src/dial/http.ts +200 -0
- package/src/dial/index.ts +135 -0
- package/src/dial/origins.ts +31 -0
- package/src/dial/parse.ts +319 -0
- package/src/dial/route-provider.ts +429 -0
- package/src/dial/ssdp-socket.ts +79 -0
- package/src/dial/xml.ts +180 -0
- package/src/dial-test/cli-main.ts +146 -0
- package/src/dial-test/report.ts +109 -0
- package/src/dial-test/runner.ts +615 -0
- package/src/dial-test/scrub.ts +74 -0
- package/src/discovery/cast-discovery.ts +106 -19
- package/src/discovery/device-cache.ts +43 -8
- package/src/discovery/index.ts +1 -0
- package/src/discovery/ip-policy.ts +97 -0
- package/src/discovery/udp-socket.ts +66 -4
- package/src/electron/access-code.ts +681 -0
- package/src/electron/app-discovery.ts +244 -0
- package/src/electron/default-presentation.ts +104 -0
- package/src/electron/main.ts +866 -72
- package/src/electron/manager-api.ts +664 -0
- package/src/electron/media-controller.ts +313 -0
- package/src/electron/network-monitor.ts +140 -0
- package/src/electron/preload.ts +16 -2
- package/src/electron/presentation-envelope.ts +7 -1
- package/src/electron/presentation-handler.ts +211 -58
- package/src/electron/presentation-source.ts +155 -0
- package/src/electron/session-service.ts +808 -149
- package/src/electron/session-tracker.ts +248 -0
- package/src/electron/sink-service.ts +726 -0
- package/src/electron/wired-display/controller.ts +212 -0
- package/src/electron/wired-display/displays.ts +107 -0
- package/src/electron/wired-display/electron-windows.ts +386 -0
- package/src/electron/wired-display/index.ts +181 -0
- package/src/electron/wired-display/local-presentation.ts +286 -0
- package/src/electron/wired-display/provider.ts +276 -0
- package/src/index.ts +1 -0
- package/src/mirroring/backend.ts +103 -0
- package/src/mirroring/electron/agent-protocol.ts +84 -0
- package/src/mirroring/electron/agent-source.ts +619 -0
- package/src/mirroring/electron/engine-process.ts +131 -0
- package/src/mirroring/electron/host.ts +361 -0
- package/src/mirroring/electron/port-backend.ts +466 -0
- package/src/mirroring/encoding-support.ts +146 -0
- package/src/mirroring/engine.ts +91 -0
- package/src/mirroring/mirror-settings.ts +174 -0
- package/src/mirroring/mirroring-activity.ts +466 -0
- package/src/mirroring/mirroring-manager.ts +342 -0
- package/src/mirroring/protocol/answer.ts +285 -0
- package/src/mirroring/protocol/constants.ts +75 -0
- package/src/mirroring/protocol/errors.ts +36 -0
- package/src/mirroring/protocol/frame-id.ts +20 -0
- package/src/mirroring/protocol/messenger.ts +128 -0
- package/src/mirroring/protocol/offer.ts +275 -0
- package/src/mirroring/protocol/recommendations.ts +135 -0
- package/src/mirroring/routing.ts +160 -0
- package/src/mirroring/rtcp/ntp.ts +61 -0
- package/src/mirroring/rtcp/parser.ts +292 -0
- package/src/mirroring/rtcp/sender-report.ts +88 -0
- package/src/mirroring/rtcp/wire.ts +76 -0
- package/src/mirroring/rtp/frame-crypto.ts +38 -0
- package/src/mirroring/rtp/frame.ts +25 -0
- package/src/mirroring/rtp/packetizer.ts +95 -0
- package/src/mirroring/sender/audio-sender.ts +59 -0
- package/src/mirroring/sender/bandwidth-estimator.ts +111 -0
- package/src/mirroring/sender/capture-size-oracle.ts +476 -0
- package/src/mirroring/sender/frame-sender.ts +293 -0
- package/src/mirroring/sender/packet-router.ts +228 -0
- package/src/mirroring/sender/sender-session.ts +306 -0
- package/src/mirroring/sender/sender.ts +497 -0
- package/src/mirroring/sender/video-encoder-metrics.ts +64 -0
- package/src/mirroring/sender/video-sender.ts +243 -0
- package/src/mirroring/session-host.ts +725 -0
- package/src/mirroring/stats/clock-offset-estimator.ts +139 -0
- package/src/mirroring/stats/openscreen-stats-client.ts +19 -0
- package/src/mirroring/stats/sorted-map.ts +68 -0
- package/src/mirroring/stats/statistics-analyzer.ts +388 -0
- package/src/mirroring/stats/statistics-collector.ts +69 -0
- package/src/mirroring/stats/statistics-common.ts +112 -0
- package/src/mirroring/stats/statistics-dispatcher.ts +133 -0
- package/src/mirroring/stats/statistics.ts +170 -0
- package/src/mirroring/transport/udp-environment.ts +100 -0
- package/src/polyfill/bridge-types.ts +11 -0
- package/src/polyfill/presentation-receiver.ts +350 -0
- package/src/polyfill/presentation-standin.ts +150 -17
- package/src/protocol/device-auth.ts +126 -0
- package/src/protocol/framing.ts +1 -1
- package/src/protocol/index.ts +1 -0
- package/src/protocol/proto-wire.ts +55 -0
package/SECURITY.md
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
This document describes what electron-cast trusts, what it checks, and what it leaves to the app. It reflects
|
|
4
|
+
v0.4.0. To report a vulnerability, see [Reporting a vulnerability](#reporting-a-vulnerability).
|
|
5
|
+
|
|
6
|
+
## Threat model
|
|
7
|
+
|
|
8
|
+
electron-cast lets web pages in your Electron windows talk to Cast devices on the local network. Three parties are
|
|
9
|
+
involved:
|
|
10
|
+
|
|
11
|
+
| Party | Trust |
|
|
12
|
+
|---|---|
|
|
13
|
+
| Your main process and preload | Trusted. electron-cast runs there. |
|
|
14
|
+
| The page in the window | Not trusted. It may be a third-party site, or a trusted site that has been compromised, or include third-party scripts. It can run any JavaScript in its own world. |
|
|
15
|
+
| Devices and everything else on the local network | Not trusted. Anyone on the same network segment can answer discovery queries, impersonate a device, or read unencrypted traffic. |
|
|
16
|
+
|
|
17
|
+
What the library tries to guarantee:
|
|
18
|
+
|
|
19
|
+
- A page can only use the narrow bridge the preload exposes. It never gets Node, sockets, `ipcRenderer` or an IPC
|
|
20
|
+
handle. It works with `sandbox: true` and `contextIsolation: true`.
|
|
21
|
+
- A page cannot choose which device, host or port to connect to. The main process opens channels only to devices
|
|
22
|
+
discovery found (at addresses Chrome would accept), and a page casts only to a device the app's `selectDevice`
|
|
23
|
+
returned (or the app's own `startCasting` named).
|
|
24
|
+
- A page cannot see or touch another origin's sessions, except that, as in Chrome, a page that already knows a session
|
|
25
|
+
id can rejoin that session (see [Scoping of sessions and messages](#scoping-of-sessions-and-messages)).
|
|
26
|
+
- A device is used only after it proves it is a genuine Google-certified Cast device (on by default; see
|
|
27
|
+
[TLS and device authentication](#tls-and-device-authentication)).
|
|
28
|
+
- Malformed input from the page, a device, or the network is rejected without crashing the main process.
|
|
29
|
+
|
|
30
|
+
What it does not defend against: a compromised main process or preload, a compromised renderer process (see
|
|
31
|
+
[User gesture](#user-gesture)), an app that auto-approves every request in `selectDevice`, and, when device
|
|
32
|
+
verification is turned off, an attacker on the local network who can impersonate a device (see
|
|
33
|
+
[TLS and device authentication](#tls-and-device-authentication)).
|
|
34
|
+
|
|
35
|
+
## What crosses the IPC boundary
|
|
36
|
+
|
|
37
|
+
The preload exposes one bridge object to the page's main world, and the page can call it directly. Nothing the page
|
|
38
|
+
sends is trusted: every call is validated in the main process, in `src/electron/main.ts`,
|
|
39
|
+
`src/electron/session-service.ts` and `src/electron/presentation-handler.ts`.
|
|
40
|
+
|
|
41
|
+
Channels, with the default channel name `electron-cast`:
|
|
42
|
+
|
|
43
|
+
| Channel | Direction | Used by |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| `electron-cast:presentation` (invoke) | page to main | Default mode: `getAvailability`, `stopWatching`, `start`, `reconnect`, `close`, `terminate`. `reconnect` is how a page rejoins a session by id, after a reload or an app restart. |
|
|
46
|
+
| `electron-cast:presentation:send` (send) | page to main | Default mode: one message on an open connection |
|
|
47
|
+
| `electron-cast:presentation:event` | main to page | Default mode: availability, messages, connection state |
|
|
48
|
+
| `electron-cast:call` (invoke) | page to main | `mode: "chromecast"`: `initialize`, `requestSession`, `joinSession`, `sendMessage`, `stopSession`, `leaveSession`, `setReceiverVolume`, `setReceiverMuted` |
|
|
49
|
+
| `electron-cast:event` | main to page | `mode: "chromecast"`: availability, session updates, messages |
|
|
50
|
+
|
|
51
|
+
How the main process validates what arrives:
|
|
52
|
+
|
|
53
|
+
- **Who is asking.** The origin comes from `event.senderFrame` in the main process, never from anything the page
|
|
54
|
+
says. In an iframe it is the iframe's own origin. A call with no sender frame is refused. If the frame's URL cannot be parsed, the origin is `""` and
|
|
55
|
+
`allowOrigin` decides.
|
|
56
|
+
- **Method names.** Only the methods above are accepted. Anything else gets an error reply.
|
|
57
|
+
- **Parameter types.** Every method has a parser that checks types: ids and session ids are strings, `level` is a
|
|
58
|
+
finite number from 0 to 1, `muted` is a boolean, `timeoutMs` is a positive finite number. A call that does not
|
|
59
|
+
match gets `invalid_parameter` (`InvalidAccessError` in default mode). Nothing page-supplied is used as a host,
|
|
60
|
+
port or file path.
|
|
61
|
+
- **Sizes.** Connection, watch and presentation ids are at most 256 characters, a request carries at most 16 URLs,
|
|
62
|
+
a presentation URL is at most 4096 characters, an app id matches `[A-Za-z0-9._-]{1,64}`, and a page-to-receiver
|
|
63
|
+
message over 1,048,576 characters is dropped. The Cast wire limit of 64 KiB still applies below that, and a
|
|
64
|
+
message over it fails with an error instead of being sent. Each page keeps at most 32 availability watches, and at most 100 media
|
|
65
|
+
requests are tracked per connection.
|
|
66
|
+
- **Envelope format.** In default mode, messages on a connection must be one of eight known router message types
|
|
67
|
+
with the expected fields; others are dropped. Only the media requests the Cast SDK sends (`LOAD`, `PLAY`,
|
|
68
|
+
`PAUSE`, `SEEK` and the like) are forwarded on the media namespace.
|
|
69
|
+
- **One request at a time.** A page can have one `requestSession` or `start` pending. A second is refused.
|
|
70
|
+
- **Replies.** Handlers never throw or reject across the boundary; failures come back as `{ ok: false, code }`.
|
|
71
|
+
|
|
72
|
+
What goes back to the page: whether a receiver is available (a boolean), then, for a session the user started, the
|
|
73
|
+
device's friendly name, capabilities and volume, the receiver app's name, namespaces and icon, and the messages that
|
|
74
|
+
app sends. The page never gets a device's IP address or port. In default mode the receiver label is a hash of the
|
|
75
|
+
device id and a per-process random token, and the friendly name is HTML-escaped, because Google's SDK may put it
|
|
76
|
+
into markup. Treat everything a device sends as untrusted data.
|
|
77
|
+
|
|
78
|
+
## User gesture
|
|
79
|
+
|
|
80
|
+
Chrome only lets a page start a cast from a user gesture, and electron-cast follows that in default mode, in two places:
|
|
81
|
+
|
|
82
|
+
- The page-side stand-in rejects `PresentationRequest.start()` with `InvalidAccessError` ("PresentationRequest::start()
|
|
83
|
+
requires user gesture.") when `navigator.userActivation.isActive` is false, as Blink's `PresentationRequest::start()`
|
|
84
|
+
does. This runs in the page's own JavaScript, so it is a compatibility behaviour, not a security boundary.
|
|
85
|
+
- The preload reads `navigator.userActivation.isActive` itself, in its isolated world, when the page calls the bridge's
|
|
86
|
+
`start`, and sends that as `hasGesture`, replacing anything the page passed. The main process refuses a `start`
|
|
87
|
+
whose `hasGesture` is not `true` with `AbortError` and Chrome's message (what `PresentationServiceImpl::StartPresentation`
|
|
88
|
+
reports as `PRESENTATION_REQUEST_CANCELLED`). A page script cannot forge this: it cannot reach the IPC channel, and
|
|
89
|
+
overriding `navigator.userActivation` in the main world does not change the isolated world's view (smoke-tested).
|
|
90
|
+
|
|
91
|
+
Known gap, and the trust boundary: Electron has no main-process API for a frame's transient user activation (`WebFrameMain` and
|
|
92
|
+
`IpcMainInvokeEvent` have none; only `webContents.executeJavaScript(code, userGesture)` and the media-access
|
|
93
|
+
handler's `userGesture` touch the concept), so the check is made in the renderer process, by the preload, instead of
|
|
94
|
+
in the browser process as Chrome does. It holds against a page's scripts. It does not hold against a compromised
|
|
95
|
+
renderer process, which can also forge the IPC itself. An Electron-native handler would get Chromium's browser-side
|
|
96
|
+
check for free.
|
|
97
|
+
|
|
98
|
+
`mode: "chromecast"` has no gesture check at all. A hostile page can call that bridge without a click.
|
|
99
|
+
|
|
100
|
+
The real consent step is `selectDevice`. A session only starts if your callback resolves a device, and the callback
|
|
101
|
+
is your UI in the main process, so the page cannot answer it. Always show the user a prompt, show the requesting
|
|
102
|
+
origin (`request.origin`), and do not auto-pick a device. A page that is allowed to cast can still make the prompt
|
|
103
|
+
appear repeatedly, one at a time, so keep the prompt cancellable and consider rate-limiting it.
|
|
104
|
+
|
|
105
|
+
## allowOrigin
|
|
106
|
+
|
|
107
|
+
`allowOrigin(origin)` is checked on every call from a page, in both modes, using the origin of the frame that made
|
|
108
|
+
the call. When it returns false the call is refused. In `mode: "chromecast"` the page gets `extension_missing`, as if
|
|
109
|
+
electron-cast were not installed. In default mode availability reads as false and `start` fails. If `allowOrigin`
|
|
110
|
+
throws, the call is refused.
|
|
111
|
+
|
|
112
|
+
- **Default: no check.** Without `allowOrigin`, every page in a window that has the preload can cast.
|
|
113
|
+
- **Recommendation: always set it,** and compare against exact origins you control, for example
|
|
114
|
+
`(origin) => origin === "https://music.example.com"`. Do not match with `endsWith`, `includes` or a prefix test.
|
|
115
|
+
- **Install the preload only in windows and views that show pages that should cast.** A window without the preload
|
|
116
|
+
has no way to reach these channels. With `nodeIntegrationInSubFrames`, the preload also runs in iframes. Each frame
|
|
117
|
+
is checked against its own origin.
|
|
118
|
+
|
|
119
|
+
`allowOrigin` is evaluated on each call, so changing what it returns takes effect on the next call. It does not end
|
|
120
|
+
sessions that are already open; to do that, call `dispose()` on the manager.
|
|
121
|
+
|
|
122
|
+
## Scoping of sessions and messages
|
|
123
|
+
|
|
124
|
+
A session records the origin that created it and the set of webContents that are members of it.
|
|
125
|
+
|
|
126
|
+
- **Who can act on a session.** `sendMessage`, `stopSession`, `leaveSession` and the volume calls need the caller's
|
|
127
|
+
webContents to be a member of the session. Other pages, including pages of the same origin in another window,
|
|
128
|
+
cannot message or stop it unless they have joined.
|
|
129
|
+
- **Who can join.** Auto-join needs the caller's origin to equal the session's origin and the same app id.
|
|
130
|
+
`origin_scoped` joins any window of that origin; `tab_and_origin_scoped` (the default policy in Google's SDK) joins
|
|
131
|
+
only the sender that already had the session, including after a reload. Auto-join only finds sessions this run
|
|
132
|
+
started.
|
|
133
|
+
- **Joining by id (default mode).** `reconnect("cast-session_<id>")`, which Google's SDK issues for
|
|
134
|
+
`requestSessionById`, joins by session id and checks no origin, as Chrome does (`AppActivity::CanJoinSession` checks
|
|
135
|
+
only the app id and that the client is not already connected). So the session id acts as the capability: a page
|
|
136
|
+
that knows the id and the session's app id can join it from any origin that `allowOrigin` admits.
|
|
137
|
+
The lookup also finds a session this run did not start, on any known
|
|
138
|
+
device (one still playing from before an app restart, or started from a phone), by asking each device what it runs.
|
|
139
|
+
electron-cast persists no ids; the app decides whether to store one. In `mode: "chromecast"`, `joinSession` still
|
|
140
|
+
needs the caller's origin to equal the session's.
|
|
141
|
+
- **Who receives events.** Events and receiver messages are sent only to the member's own frame (`frame.send`), and
|
|
142
|
+
messages from the device are routed by the receiver app's transport id, so a session sees only its own app's
|
|
143
|
+
traffic.
|
|
144
|
+
- **Lifetime.** A navigation of the page leaves its sessions open on the device, parked, so the next page of the
|
|
145
|
+
same sender can rejoin them (as in Chrome). A destroyed webContents leaves its sessions for good. When a
|
|
146
|
+
session has no members left, electron-cast releases its connection to the app; the app keeps running on the
|
|
147
|
+
device until it is stopped.
|
|
148
|
+
- **Per frame in default mode.** Every frame, iframes included, is its own sender with its own watches, connections
|
|
149
|
+
and sessions, and cannot read, close or message another frame's. Iframes only get a preload with
|
|
150
|
+
`nodeIntegrationInSubFrames: true`, which runs the cast bridge in every iframe of every origin, so keep
|
|
151
|
+
`allowOrigin` strict. A removed iframe or a navigating page ends the iframe's sessions. In `mode: "chromecast"`
|
|
152
|
+
membership is by webContents (main frame only; a call from an iframe is refused), so windows that are all allowed
|
|
153
|
+
by `allowOrigin` share one webContents' sessions.
|
|
154
|
+
|
|
155
|
+
### What a page can do inside its own session
|
|
156
|
+
|
|
157
|
+
A page that holds a session can:
|
|
158
|
+
|
|
159
|
+
- Send messages on the namespaces of the receiver app. This is the point of the Cast protocol: the page and the
|
|
160
|
+
receiver app define their own messages. In default mode the namespace must be one the receiver app lists in its
|
|
161
|
+
status. In `mode: "chromecast"` the page can name any namespace string, including Cast system namespaces, but the
|
|
162
|
+
destination is always the receiver app's own transport. It cannot send to the platform receiver that way.
|
|
163
|
+
- Send media requests (load, play, pause, seek, queue edits), set the device volume and mute, and stop the session.
|
|
164
|
+
- The volume and the stop apply to the device, so they are heard by anyone else using it, and stopping ends the app
|
|
165
|
+
for other senders (phones, for example) that joined the same app.
|
|
166
|
+
|
|
167
|
+
A page cannot launch an app without a session request, cannot choose the device, and cannot reach another page's
|
|
168
|
+
session. It does choose the receiver app id (default mode takes it from the presentation URL, which the SDK builds
|
|
169
|
+
from the app id the page configures), so a page allowed to cast can launch any app on the device the user picked.
|
|
170
|
+
|
|
171
|
+
## TLS and device authentication
|
|
172
|
+
|
|
173
|
+
`CastClient` connects to a device over TLS on port 8009 (or the port advertised in mDNS) with
|
|
174
|
+
`rejectUnauthorized: false`. This is normal for Cast. A Cast device presents a certificate it generated itself, which
|
|
175
|
+
no public certificate authority has signed, so ordinary certificate validation always fails. Chrome also accepts
|
|
176
|
+
that certificate and instead authenticates the device with a separate challenge on the
|
|
177
|
+
`urn:x-cast:com.google.cast.tp.deviceauth` namespace, which checks the device's certificate chain against Google's
|
|
178
|
+
Cast root certificates.
|
|
179
|
+
|
|
180
|
+
From 0.4.0 electron-cast does the same challenge, on by default: after the TLS handshake and before CONNECT,
|
|
181
|
+
`CastClient.connect()` sends a nonce and checks the device's reply (a port of Chromium's
|
|
182
|
+
`cast_auth_util.cc` and certificate code, with Google's Cast root certificates built in). It requires that the TLS
|
|
183
|
+
certificate's validity window is current and short, that the device's certificate chain leads to a Cast root, that
|
|
184
|
+
the chain is not revoked, and that the device's signature over the nonce and this connection's TLS certificate
|
|
185
|
+
verifies, which ties the proof to this connection. A device that fails makes `connect()` reject with `CastAuthError`
|
|
186
|
+
(with a `reason`), the socket is closed, and the device is never listed: as in Chrome, a device is a sink only once its
|
|
187
|
+
channel has passed authentication, so a failing device does not reach the picker. Names still come from mDNS, so show
|
|
188
|
+
them as plain text.
|
|
189
|
+
Details and the differences from Chromium: [docs/DESIGN.md](docs/DESIGN.md).
|
|
190
|
+
|
|
191
|
+
With `verifyDevices: false` (manager) or `verifyDevice: false` (client), none of this runs: the connection is
|
|
192
|
+
encrypted but the device is not authenticated, so anyone on the local network who can answer mDNS queries, or
|
|
193
|
+
intercept traffic between your computer and the device, can pose as a Cast device. If the user picks that device, the
|
|
194
|
+
attacker receives whatever the page sends it, such as media URLs and app-specific messages and tokens (YouTube's lounge
|
|
195
|
+
tokens, for example). It does not get cookies or anything else from the page. Turn it off only for receivers that are
|
|
196
|
+
not Google-certified.
|
|
197
|
+
|
|
198
|
+
`CastClientOptions.tls` is spread after the defaults, so an app that wants to pin a certificate can pass its own
|
|
199
|
+
`tls` options through a custom `createClient`.
|
|
200
|
+
|
|
201
|
+
The `deviceAuth` client option replaces the trust anchors and the clock. It exists for tests and private Cast
|
|
202
|
+
deployments; an app that sets it decides what counts as genuine.
|
|
203
|
+
|
|
204
|
+
**Old releases and devices that send no CRL (the stale fallback CRL).** Revocation uses the CRL the device sends, or else a fallback CRL built
|
|
205
|
+
into the package that counts for 20 weeks from the package's build time. When a release is older than that and the
|
|
206
|
+
device sent no valid CRL, the revocation check is skipped (`CastClient.deviceAuth.revocationChecked` is `false`),
|
|
207
|
+
where Chromium would refuse the device; Chrome updates itself, an Electron app may not, and Chrome likewise stops
|
|
208
|
+
enforcing Certificate Transparency when its built-in log list is over 70 days old
|
|
209
|
+
(`ChromeCTPolicyEnforcer::IsLogDataTimely`). What still holds: the chain to a Cast root, the device certificate
|
|
210
|
+
checks, the signature over this connection's TLS certificate, revocation by a CRL the device sends, and revocation by
|
|
211
|
+
a fallback CRL that has not lapsed. What does not: a device Google has revoked can pass if it sends no CRL. Update
|
|
212
|
+
electron-cast regularly, and treat `revocationChecked: false` as a prompt to do so.
|
|
213
|
+
|
|
214
|
+
## Device addresses
|
|
215
|
+
|
|
216
|
+
Answers to mDNS queries are accepted from any host on the network, so a hostile one can announce a device at an address
|
|
217
|
+
of its choosing, including a public one on the internet or loopback (a local service on this machine). Chrome opens no
|
|
218
|
+
Cast channel to a publicly routable or loopback address unless its `MediaRouterCastAllowAllIPs` policy is set
|
|
219
|
+
(`CastMediaSinkServiceImpl::OpenChannel`), and the manager does the same: no channel is opened to such an address, so
|
|
220
|
+
the device is not listed, offered by `selectDevice` or connected to. Private, link-local, unique-local and
|
|
221
|
+
carrier-grade-NAT (`100.64.0.0/10`) addresses are allowed, as in Chrome. `sinks: { allowAllIps: true }` lifts the rule
|
|
222
|
+
(devices on a routed or VPN network with public addressing). As in Chrome the address checked is the one a channel is
|
|
223
|
+
being opened to, each time one is opened, so a device that later announces a public address gets no channel there; a
|
|
224
|
+
`CastClient` you create yourself connects wherever you point it.
|
|
225
|
+
Chrome's quirks are kept: an IPv4-mapped loopback (`::ffff:127.0.0.1`) is not refused, and an address that cannot be
|
|
226
|
+
parsed is.
|
|
227
|
+
|
|
228
|
+
## mDNS exposure
|
|
229
|
+
|
|
230
|
+
Discovery sends multicast DNS queries for `_googlecast._tcp.local` to `224.0.0.251:5353`:
|
|
231
|
+
|
|
232
|
+
- on every non-internal, non-link-local IPv4 interface the OS reports, including VPN and virtual adapters;
|
|
233
|
+
- over IPv6 as well: queries to `ff02::fb` from one link-local address per adapter. A device found that way is
|
|
234
|
+
connected to over its `fe80::` address with the adapter's zone; IPv4 is preferred when a device has both;
|
|
235
|
+
- right at start, again after 1 s and 3 s, then about every 60 s;
|
|
236
|
+
- with the interface list re-checked every 10 s, so a new network is joined as soon as it appears. A network that goes
|
|
237
|
+
away takes its devices with it at once, and after the machine wakes from sleep the sockets are replaced and queried
|
|
238
|
+
again.
|
|
239
|
+
|
|
240
|
+
It binds UDP port 5353 with address reuse so it can coexist with the system's mDNS responder, and falls back to an
|
|
241
|
+
ephemeral port if that fails. If the IPv6 socket for an adapter cannot be opened, IPv4 carries on. It does not advertise anything and does not answer queries; it only asks. The queries
|
|
242
|
+
reveal to everyone on those networks that this machine looks for Cast devices.
|
|
243
|
+
|
|
244
|
+
Answers are accepted from any host on those networks, parsed with a defensive decoder (malformed packets are dropped),
|
|
245
|
+
and turned into device records. A device record's address comes from the answer, so a hostile host can announce a
|
|
246
|
+
device name and an address of its choosing. As in Chrome, the manager opens a TLS channel to each device found at an
|
|
247
|
+
allowed address (not publicly routable, not loopback) to authenticate it before listing it, so such a host receives a
|
|
248
|
+
TLS connection and an authentication challenge, and nothing more unless it passes. Show the device's name as plain text
|
|
249
|
+
in your picker, since it is attacker-controlled when the network is.
|
|
250
|
+
|
|
251
|
+
Nothing is sent and no socket is opened until you call `manager.start()`. To turn casting off:
|
|
252
|
+
|
|
253
|
+
- never create the manager, or never call `start()`, for users who disable it;
|
|
254
|
+
- call `await manager.dispose()` to stop discovery, close the sockets, close device connections and remove the IPC
|
|
255
|
+
handlers. A disposed manager cannot be restarted; create a new one to turn casting back on.
|
|
256
|
+
|
|
257
|
+
With `presentation: false` only `mode: "chromecast"` pages are served.
|
|
258
|
+
|
|
259
|
+
## SSDP and DIAL HTTP exposure
|
|
260
|
+
|
|
261
|
+
DIAL is on by default, as in Chrome. `dial: false` removes everything in this section.
|
|
262
|
+
|
|
263
|
+
- **SSDP.** `manager.start()` also sends `M-SEARCH` requests to `239.255.255.250:1900`, four times a second apart, on
|
|
264
|
+
every external IPv4 interface (as for mDNS, VPN and virtual adapters included), every 120 s. Each search uses a UDP
|
|
265
|
+
socket on an ephemeral port that is open only while a cycle runs (about 5 s) and takes unicast answers. The search
|
|
266
|
+
tells the networks that this machine looks for DIAL devices, and its `USER-AGENT` carries the Chromium version and the
|
|
267
|
+
OS. Nothing is advertised.
|
|
268
|
+
- **Answers are untrusted.** An answer counts only if its `LOCATION` is an http(s) URL whose host is an IP literal in
|
|
269
|
+
private, loopback or link-local space and equals the address the answer came from, so a host cannot point electron-cast
|
|
270
|
+
at a third party. The `Application-URL` header of the description is held to the same rule, and so is the `Location`
|
|
271
|
+
of a launch (otherwise the stop falls back to `<app url>/run`). Descriptions and app info are read with a reader that
|
|
272
|
+
refuses entity declarations (so no entity expansion), caps nesting at 64 and stops at 256 KiB. At most 256 devices are
|
|
273
|
+
kept. Show a DIAL sink's name as plain text: it is whatever the device's description says.
|
|
274
|
+
- **HTTP to devices.** Without any page involved, each device found is sent one `GET` of its description (again every
|
|
275
|
+
12 hours or when its `CONFIGID` changes). A page that watches the availability of a `cast-dial:` source makes
|
|
276
|
+
electron-cast `GET` that app's info from each device. Launching sends a `POST` and stopping a `DELETE`, after the user
|
|
277
|
+
chose the device in `selectDevice`. These requests are plain HTTP, as the DIAL specification has it; they carry
|
|
278
|
+
`Origin: package:Google-Chrome.<major>.<OS>`, follow no redirect, send no cookies and use no proxy.
|
|
279
|
+
- **What a page can do.** It can ask for the availability of any app name (letters, digits and `-._~`) and so learn
|
|
280
|
+
whether any of the user's DIAL devices has that app (at most 32 apps are asked about at once), unless the app is one Chrome limits to certain origins and the
|
|
281
|
+
page's origin is not one of them. It can launch only on a device the user picked, with any `dialPostData` and launch
|
|
282
|
+
parameter it likes, which the device's app receives. It can send `STOP`, which stops its own route's app. As in Chrome,
|
|
283
|
+
closing a page does not stop a launched app.
|
|
284
|
+
- **DIAL has no authentication.** Unlike Cast it has no device authentication and no TLS: anyone on the network can
|
|
285
|
+
answer a search with a name of their choosing, and the user then sees it in the picker. This matches Chrome.
|
|
286
|
+
|
|
287
|
+
## Mirroring
|
|
288
|
+
|
|
289
|
+
Mirroring is off unless the app passes `mirroring` to `createCastManager`, and only the main process can start it
|
|
290
|
+
(`startCasting`); no page can. What it adds:
|
|
291
|
+
|
|
292
|
+
- **Capture.** The app names the page (`webContentsId`) or screen (`desktopSourceId`) to send. Capture runs in a hidden
|
|
293
|
+
window on a private in-memory session partition. That window is sandboxed, has context isolation, denies navigation
|
|
294
|
+
and new windows, and grants only the media permission. Its page and preload are generated by the library and written
|
|
295
|
+
to a fresh temporary directory (removed when the route ends). Desktop capture uses the one source id the app
|
|
296
|
+
chose, and grants the `display-capture` permission to that window only; loopback audio is only requested when `withAudio` is set. Screen capture can show anything on
|
|
297
|
+
screen, so ask the user before calling it.
|
|
298
|
+
- **Network.** The stream is UDP from an ephemeral port on all interfaces to the device's address (Cast streaming
|
|
299
|
+
has no fixed port). The sender accepts packets only from the endpoint the receiver announced in its ANSWER, and
|
|
300
|
+
ignores others. Frames are AES-128-CTR encrypted with a per-session random key and IV mask, sent in the OFFER over the
|
|
301
|
+
device's TLS channel (the keys are redacted from logs, as Chrome does). The receiver's address comes from the
|
|
302
|
+
authenticated Cast channel, not from the network, and the OFFER goes over the device's one kept-open channel.
|
|
303
|
+
- **Processes.** Encoded frames travel from the hidden window to a utility process over a `MessagePort`, not through
|
|
304
|
+
the main process. A malformed message from the window is ignored; an engine crash ends the route.
|
|
305
|
+
- The device is checked as in every other cast (device authentication), and the receiver app is stopped when the route
|
|
306
|
+
ends.
|
|
307
|
+
|
|
308
|
+
## Dependencies and supply chain
|
|
309
|
+
|
|
310
|
+
electron-cast has no runtime dependencies. It uses Node's `tls`, `dgram` and `crypto`; device authentication,
|
|
311
|
+
including the X.509, CRL and DER parsing, is part of the package rather than a dependency. Electron is an optional
|
|
312
|
+
peer dependency (`electron >=35`) and is never imported: you pass Electron's objects in. The preload entry has no
|
|
313
|
+
imports of its own, so a bundler can inline it. The package ships an ES module build and a CommonJS build.
|
|
314
|
+
|
|
315
|
+
## Reporting a vulnerability
|
|
316
|
+
|
|
317
|
+
Please do not open a public issue for a security problem.
|
|
318
|
+
|
|
319
|
+
Use GitHub's private vulnerability reporting: go to
|
|
320
|
+
[github.com/adammpkins/electron-cast](https://github.com/adammpkins/electron-cast), open the **Security** tab and
|
|
321
|
+
choose **Report a vulnerability**. Include the version, the Electron version, steps to reproduce, and what an attacker
|
|
322
|
+
gains. You will get a reply there, and a fix is released with a credit if you want one.
|
|
323
|
+
|
|
324
|
+
Fixes are made against the latest release.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When this package was built, epoch milliseconds: the stand-in for Chromium's base::GetBuildTime(), where the built-in
|
|
3
|
+
* fallback CRL's 20-week window starts. It is `undefined` in the source; `npm run build` (scripts/stamp-build-time.mjs)
|
|
4
|
+
* rewrites this one assignment in the emitted dist files, so source checkouts and tests fall back to the date in
|
|
5
|
+
* trust-data.ts and the working tree stays clean.
|
|
6
|
+
*/
|
|
7
|
+
export declare const BUILD_TIME: number | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BUILD_TIME = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* When this package was built, epoch milliseconds: the stand-in for Chromium's base::GetBuildTime(), where the built-in
|
|
6
|
+
* fallback CRL's 20-week window starts. It is `undefined` in the source; `npm run build` (scripts/stamp-build-time.mjs)
|
|
7
|
+
* rewrites this one assignment in the emitted dist files, so source checkouts and tests fall back to the date in
|
|
8
|
+
* trust-data.ts and the working tree stays clean.
|
|
9
|
+
*/
|
|
10
|
+
exports.BUILD_TIME = 1795607102275;
|
|
11
|
+
//# sourceMappingURL=build-time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-time.js","sourceRoot":"","sources":["../../../../src/client/auth/build-time.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACU,QAAA,UAAU,GAAuB,SAAS,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type CastDeviceCertPolicy } from "./cast-cert-validator.ts";
|
|
2
|
+
/** Replacements for the trust anchors and the clock in device authentication. For tests and private Cast deployments. */
|
|
3
|
+
export interface DeviceAuthOptions {
|
|
4
|
+
/** Verification time, epoch milliseconds. Defaults to now. */
|
|
5
|
+
now?: number;
|
|
6
|
+
/** Trust anchors (DER) replacing the Cast Root CA and Eureka Root CA. For tests and private Cast deployments. */
|
|
7
|
+
roots?: Uint8Array[];
|
|
8
|
+
/** CRL trust anchors (DER) replacing the Cast CRL Root CA. */
|
|
9
|
+
crlRoots?: Uint8Array[];
|
|
10
|
+
/** Replacement fallback CRL (a serialized CrlBundle), or `null` for none. */
|
|
11
|
+
fallbackCrl?: Uint8Array | null;
|
|
12
|
+
/** The "build time" the fallback CRL's 20-week window starts at, epoch milliseconds. */
|
|
13
|
+
fallbackCrlBuildTime?: number;
|
|
14
|
+
}
|
|
15
|
+
/** What device authentication established about a device, available as `CastClient.deviceAuth` once connected. */
|
|
16
|
+
export interface DeviceAuthResult {
|
|
17
|
+
policy: CastDeviceCertPolicy;
|
|
18
|
+
hashAlgorithm: "sha1" | "sha256";
|
|
19
|
+
/** False when the device's reply did not echo our nonce; Chromium records this and carries on. */
|
|
20
|
+
nonceEchoed: boolean;
|
|
21
|
+
/** True when the device sent no usable CRL and the built-in fallback CRL was used instead. */
|
|
22
|
+
usedFallbackCrl: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* False only when the built-in fallback CRL had expired and the device sent no valid CRL, so the revocation check was
|
|
25
|
+
* skipped (Chromium would refuse the device). Revocation by a device CRL or a still-valid fallback CRL is always checked.
|
|
26
|
+
*/
|
|
27
|
+
revocationChecked: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** A challenge: the nonce and the DeviceAuthMessage bytes that go in the CastMessage's binary payload. */
|
|
30
|
+
export declare function createAuthChallenge(): {
|
|
31
|
+
nonce: Buffer;
|
|
32
|
+
payload: Buffer;
|
|
33
|
+
};
|
|
34
|
+
/** The decoded fields of a binary CastMessage reply on the deviceauth namespace. */
|
|
35
|
+
export interface AuthReplyMessage {
|
|
36
|
+
payloadType: number;
|
|
37
|
+
payloadBinary: Buffer | undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* AuthenticateChallengeReply. Throws {@link CastAuthError} unless the reply proves the TLS peer is a genuine,
|
|
41
|
+
* Google-certified Cast device.
|
|
42
|
+
*
|
|
43
|
+
* `peerCertDer` is the DER of the TLS certificate the device presented on this connection; the signature in the
|
|
44
|
+
* reply is over `senderNonce || peerCertDer`, which binds the proof to this TLS session's certificate.
|
|
45
|
+
*/
|
|
46
|
+
export declare function authenticateChallengeReply(reply: AuthReplyMessage, peerCertDer: Uint8Array, nonce: Uint8Array, options?: DeviceAuthOptions): DeviceAuthResult;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAuthChallenge = createAuthChallenge;
|
|
4
|
+
exports.authenticateChallengeReply = authenticateChallengeReply;
|
|
5
|
+
const node_crypto_1 = require("node:crypto");
|
|
6
|
+
const errors_ts_1 = require("../../protocol/errors.js");
|
|
7
|
+
const cast_message_ts_1 = require("../../protocol/cast-message.js");
|
|
8
|
+
const device_auth_ts_1 = require("../../protocol/device-auth.js");
|
|
9
|
+
const errors_ts_2 = require("../errors.js");
|
|
10
|
+
const cast_cert_validator_ts_1 = require("./cast-cert-validator.js");
|
|
11
|
+
const crl_ts_1 = require("./crl.js");
|
|
12
|
+
const trust_data_ts_1 = require("./trust-data.js");
|
|
13
|
+
const x509_ts_1 = require("./x509.js");
|
|
14
|
+
/**
|
|
15
|
+
* The sender side of Cast device authentication, ported from components/media_router/common/providers/cast/channel/
|
|
16
|
+
* cast_auth_util.cc (AuthenticateChallengeReply, VerifyCredentialsImpl, VerifyTLSCertificate, ParseAuthMessage,
|
|
17
|
+
* VerifyAndMapDigestAlgorithm, AuthContext::VerifySenderNonce) and cast_message_util.cc (CreateAuthChallengeMessage).
|
|
18
|
+
*/
|
|
19
|
+
/** Chromium's kMaxSelfSignedCertLifetimeInDays. */
|
|
20
|
+
const MAX_SELF_SIGNED_CERT_LIFETIME_MS = 4 * 24 * 60 * 60 * 1000;
|
|
21
|
+
/** Chromium's kNonceSizeInBytes. */
|
|
22
|
+
const NONCE_SIZE = 16;
|
|
23
|
+
/** A challenge: the nonce and the DeviceAuthMessage bytes that go in the CastMessage's binary payload. */
|
|
24
|
+
function createAuthChallenge() {
|
|
25
|
+
const nonce = (0, node_crypto_1.randomBytes)(NONCE_SIZE);
|
|
26
|
+
return { nonce, payload: (0, device_auth_ts_1.encodeAuthChallenge)({ senderNonce: nonce, hashAlgorithm: device_auth_ts_1.HashAlgorithm.SHA256 }) };
|
|
27
|
+
}
|
|
28
|
+
let defaultAnchors;
|
|
29
|
+
let defaultCrlAnchors;
|
|
30
|
+
const parseAll = (ders) => ders.map((d) => (0, x509_ts_1.parseCertificate)(d));
|
|
31
|
+
function anchorsFor(options) {
|
|
32
|
+
if (options.roots !== undefined)
|
|
33
|
+
return parseAll(options.roots);
|
|
34
|
+
defaultAnchors ??= parseAll([Buffer.from(trust_data_ts_1.CAST_ROOT_CA_B64, "base64"), Buffer.from(trust_data_ts_1.EUREKA_ROOT_CA_B64, "base64")]);
|
|
35
|
+
return defaultAnchors;
|
|
36
|
+
}
|
|
37
|
+
function crlAnchorsFor(options) {
|
|
38
|
+
if (options.crlRoots !== undefined)
|
|
39
|
+
return parseAll(options.crlRoots);
|
|
40
|
+
defaultCrlAnchors ??= parseAll([Buffer.from(trust_data_ts_1.CAST_CRL_ROOT_CA_B64, "base64")]);
|
|
41
|
+
return defaultCrlAnchors;
|
|
42
|
+
}
|
|
43
|
+
const REASONS = {
|
|
44
|
+
OK: () => undefined,
|
|
45
|
+
OK_FALLBACK_CRL: () => undefined,
|
|
46
|
+
OK_FALLBACK_CRL_STALE: () => undefined,
|
|
47
|
+
ERR_CERTS_MISSING: (d) => new errors_ts_2.CastAuthError("invalid_certificate", `no device certificate: ${d}`),
|
|
48
|
+
ERR_CERTS_PARSE: (d) => new errors_ts_2.CastAuthError("invalid_certificate", d),
|
|
49
|
+
ERR_CERTS_DATE_INVALID: (d) => new errors_ts_2.CastAuthError("invalid_certificate", `failed date validity check: ${d}`),
|
|
50
|
+
ERR_CERTS_VERIFY_GENERIC: (d) => new errors_ts_2.CastAuthError("untrusted_chain", `the certificate chain is not trusted: ${d}`),
|
|
51
|
+
ERR_CERTS_RESTRICTIONS: (d) => new errors_ts_2.CastAuthError("invalid_certificate", d),
|
|
52
|
+
ERR_CERTS_REVOKED: (d) => new errors_ts_2.CastAuthError("revoked", d),
|
|
53
|
+
ERR_CERTS_REVOKED_BY_FALLBACK_CRL: (d) => new errors_ts_2.CastAuthError("revoked", d),
|
|
54
|
+
ERR_FALLBACK_CRL_INVALID: (d) => new errors_ts_2.CastAuthError("crl_invalid", d),
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* AuthenticateChallengeReply. Throws {@link CastAuthError} unless the reply proves the TLS peer is a genuine,
|
|
58
|
+
* Google-certified Cast device.
|
|
59
|
+
*
|
|
60
|
+
* `peerCertDer` is the DER of the TLS certificate the device presented on this connection; the signature in the
|
|
61
|
+
* reply is over `senderNonce || peerCertDer`, which binds the proof to this TLS session's certificate.
|
|
62
|
+
*/
|
|
63
|
+
function authenticateChallengeReply(reply, peerCertDer, nonce, options = {}) {
|
|
64
|
+
const now = options.now ?? Date.now();
|
|
65
|
+
// ParseAuthMessage
|
|
66
|
+
if (reply.payloadType !== cast_message_ts_1.PayloadType.BINARY)
|
|
67
|
+
throw new errors_ts_2.CastAuthError("malformed_reply", "wrong payload type in the challenge reply");
|
|
68
|
+
if (reply.payloadBinary === undefined)
|
|
69
|
+
throw new errors_ts_2.CastAuthError("malformed_reply", "the challenge reply has no binary payload");
|
|
70
|
+
let message;
|
|
71
|
+
try {
|
|
72
|
+
message = (0, device_auth_ts_1.decodeDeviceAuthMessage)(reply.payloadBinary);
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
if (err instanceof errors_ts_1.CastProtocolError)
|
|
76
|
+
throw new errors_ts_2.CastAuthError("malformed_reply", `cannot parse the challenge reply: ${err.message}`);
|
|
77
|
+
throw err;
|
|
78
|
+
}
|
|
79
|
+
if (message.error !== undefined)
|
|
80
|
+
throw new errors_ts_2.CastAuthError("device_error", `the device answered with auth error ${message.error.errorType}`);
|
|
81
|
+
const response = message.response;
|
|
82
|
+
if (response === undefined)
|
|
83
|
+
throw new errors_ts_2.CastAuthError("malformed_reply", "the challenge reply has no response");
|
|
84
|
+
// VerifyTLSCertificate: the TLS certificate's validity period is repurposed as the signature's lifetime.
|
|
85
|
+
let peer;
|
|
86
|
+
try {
|
|
87
|
+
peer = (0, x509_ts_1.parseCertificate)(peerCertDer);
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
throw new errors_ts_2.CastAuthError("tls_certificate_invalid", `the TLS certificate does not parse: ${err instanceof Error ? err.message : String(err)}`);
|
|
91
|
+
}
|
|
92
|
+
if (peer.notBefore > now)
|
|
93
|
+
throw new errors_ts_2.CastAuthError("tls_certificate_invalid", "the TLS certificate's valid start date is in the future");
|
|
94
|
+
if (peer.notAfter < now)
|
|
95
|
+
throw new errors_ts_2.CastAuthError("tls_certificate_invalid", "the TLS certificate has expired");
|
|
96
|
+
if (peer.notAfter > now + MAX_SELF_SIGNED_CERT_LIFETIME_MS)
|
|
97
|
+
throw new errors_ts_2.CastAuthError("tls_certificate_invalid", "the TLS certificate's lifetime is too long");
|
|
98
|
+
// AuthContext::VerifySenderNonce records a missing or different nonce but does not fail.
|
|
99
|
+
const nonceEchoed = Buffer.from(nonce).equals(response.senderNonce);
|
|
100
|
+
// VerifyCredentialsImpl
|
|
101
|
+
const signatureInput = Buffer.concat([response.senderNonce, peerCertDer]);
|
|
102
|
+
const anchors = anchorsFor(options);
|
|
103
|
+
const crlAnchors = crlAnchorsFor(options);
|
|
104
|
+
let crl;
|
|
105
|
+
if (response.crl !== undefined && response.crl.length > 0) {
|
|
106
|
+
crl = (0, crl_ts_1.parseAndVerifyCrl)(response.crl, now, { anchors: crlAnchors, isFallback: false });
|
|
107
|
+
}
|
|
108
|
+
const fallbackBytes = options.fallbackCrl === undefined ? Buffer.from(trust_data_ts_1.CAST_FALLBACK_CRL_B64, "base64") : options.fallbackCrl;
|
|
109
|
+
const fallbackOptions = { anchors: crlAnchors, isFallback: true, fallbackBuildTime: options.fallbackCrlBuildTime ?? trust_data_ts_1.FALLBACK_CRL_BUILD_TIME };
|
|
110
|
+
const fallbackCrl = fallbackBytes === null ? undefined : (0, crl_ts_1.parseAndVerifyCrl)(fallbackBytes, now, fallbackOptions);
|
|
111
|
+
const fallbackCrlStale = fallbackBytes !== null && fallbackCrl === undefined && (0, crl_ts_1.isFallbackCrlStale)(fallbackBytes, now, fallbackOptions);
|
|
112
|
+
const chain = [response.clientAuthCertificate, ...response.intermediateCertificates];
|
|
113
|
+
const verified = (0, cast_cert_validator_ts_1.verifyDeviceCert)(chain, now, { anchors, crl, fallbackCrl, fallbackCrlStale });
|
|
114
|
+
const failure = REASONS[verified.error](verified.detail);
|
|
115
|
+
if (failure !== undefined)
|
|
116
|
+
throw failure;
|
|
117
|
+
if (response.signature.length === 0 && signatureInput.length > 0)
|
|
118
|
+
throw new errors_ts_2.CastAuthError("bad_signature", "the signature is empty");
|
|
119
|
+
let hash;
|
|
120
|
+
if (response.hashAlgorithm === device_auth_ts_1.HashAlgorithm.SHA1)
|
|
121
|
+
hash = "sha1";
|
|
122
|
+
else if (response.hashAlgorithm === device_auth_ts_1.HashAlgorithm.SHA256)
|
|
123
|
+
hash = "sha256";
|
|
124
|
+
else
|
|
125
|
+
throw new errors_ts_2.CastAuthError("unsupported_algorithm", `unsupported hash algorithm ${response.hashAlgorithm}`);
|
|
126
|
+
// CertVerificationContextImpl::VerifySignatureOverData: RSASSA-PKCS1-v1_5 with the chosen digest, RSA keys only.
|
|
127
|
+
const key = verified.publicKey;
|
|
128
|
+
let signatureOk = false;
|
|
129
|
+
try {
|
|
130
|
+
signatureOk = key !== undefined && key.asymmetricKeyType === "rsa" && (0, node_crypto_1.verify)(hash, signatureInput, key, response.signature);
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
signatureOk = false;
|
|
134
|
+
}
|
|
135
|
+
if (!signatureOk)
|
|
136
|
+
throw new errors_ts_2.CastAuthError("bad_signature", "failed verifying the signature over the TLS certificate");
|
|
137
|
+
return {
|
|
138
|
+
policy: verified.policy,
|
|
139
|
+
hashAlgorithm: hash,
|
|
140
|
+
nonceEchoed,
|
|
141
|
+
usedFallbackCrl: verified.error === "OK_FALLBACK_CRL",
|
|
142
|
+
revocationChecked: verified.error !== "OK_FALLBACK_CRL_STALE",
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=cast-auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cast-auth.js","sourceRoot":"","sources":["../../../../src/client/auth/cast-auth.ts"],"names":[],"mappings":";;AAyDA,kDAGC;AA8CD,gEA+EC;AAzLD,6CAAkE;AAClE,wDAA6D;AAC7D,oEAA6D;AAC7D,kEAA4G;AAC5G,4CAA6C;AAC7C,qEAA2G;AAC3G,qCAA+E;AAC/E,mDAMyB;AACzB,uCAAqE;AAErE;;;;GAIG;AAEH,mDAAmD;AACnD,MAAM,gCAAgC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACjE,oCAAoC;AACpC,MAAM,UAAU,GAAG,EAAE,CAAC;AA+BtB,0GAA0G;AAC1G,SAAgB,mBAAmB;IACjC,MAAM,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QAAE,MAAM,IAAI,yBAAa,CAAC,eAAe,EAAE,yDAAyD,CAAC,CAAC;IAEtH,OAAO;QACL,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,aAAa,EAAE,IAAI;QACnB,WAAW;QACX,eAAe,EAAE,QAAQ,CAAC,KAAK,KAAK,iBAAiB;QACrD,iBAAiB,EAAE,QAAQ,CAAC,KAAK,KAAK,uBAAuB;KAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type KeyObject } from "node:crypto";
|
|
2
|
+
import type { CastCrl } from "./crl.ts";
|
|
3
|
+
import { type ParsedCertificate } from "./x509.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Cast device certificate verification, ported from components/media_router/common/providers/cast/certificate/
|
|
6
|
+
* cast_cert_validator.cc (VerifyDeviceCertUsingCustomTrustStore, GetValidationDate, CheckTargetCertificate,
|
|
7
|
+
* DetermineDeviceCertificatePolicy) with the CRL_REQUIRED_WITH_FALLBACK policy Chromium's cast_auth_util.cc uses.
|
|
8
|
+
*/
|
|
9
|
+
export type CastCertError = "OK" | "OK_FALLBACK_CRL" | "OK_FALLBACK_CRL_STALE" | "ERR_CERTS_MISSING" | "ERR_CERTS_PARSE" | "ERR_CERTS_DATE_INVALID" | "ERR_CERTS_VERIFY_GENERIC" | "ERR_CERTS_RESTRICTIONS" | "ERR_CERTS_REVOKED" | "ERR_CERTS_REVOKED_BY_FALLBACK_CRL" | "ERR_FALLBACK_CRL_INVALID";
|
|
10
|
+
/** The device may be restricted to audio by its certificate chain (CastDeviceCertPolicy). */
|
|
11
|
+
export type CastDeviceCertPolicy = "unrestricted" | "audio_only";
|
|
12
|
+
export interface DeviceCertVerification {
|
|
13
|
+
error: CastCertError;
|
|
14
|
+
/** Set when the error is OK, OK_FALLBACK_CRL or OK_FALLBACK_CRL_STALE (and set earlier too, as in Chromium). */
|
|
15
|
+
policy: CastDeviceCertPolicy;
|
|
16
|
+
/** The device certificate's public key, for checking the challenge signature. */
|
|
17
|
+
publicKey: KeyObject | undefined;
|
|
18
|
+
/** Detail for diagnostics. */
|
|
19
|
+
detail: string;
|
|
20
|
+
}
|
|
21
|
+
export interface DeviceCertOptions {
|
|
22
|
+
anchors: ParsedCertificate[];
|
|
23
|
+
/** The CRL the device supplied, if it parsed and verified (undefined otherwise, like a null CastCRL). */
|
|
24
|
+
crl: CastCrl | undefined;
|
|
25
|
+
/** The built-in fallback CRL, if it parsed and verified. */
|
|
26
|
+
fallbackCrl: CastCrl | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* True when `fallbackCrl` is missing only because its 20-week window has lapsed (it otherwise verifies). Without a
|
|
29
|
+
* device CRL the revocation check is then skipped, where Chromium would fail closed; see docs/DESIGN.md.
|
|
30
|
+
*/
|
|
31
|
+
fallbackCrlStale?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** VerifyDeviceCertUsingCustomTrustStore with CRLPolicy::CRL_REQUIRED_WITH_FALLBACK. */
|
|
34
|
+
export declare function verifyDeviceCert(certs: Uint8Array[], time: number, options: DeviceCertOptions): DeviceCertVerification;
|