hex/src/audio
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dax 92bcf45aa3
verify the hex microphone driver's signature before installing it (#2767)
* verify the Hex Microphone driver's signature before installing it

The driver install copied whatever bundle validated: the app's own copy,
or, when that was missing, scripts/build-hex-microphone-driver.sh's
output in ~/Library/Caches/hex-mic, a user-writable path. Nothing checked
the code signature, so an admin-approved install could plant a driver
from outside Hex's trust anchor into the HAL folder.

A published build (stable or dev channel) now checks the chosen bundle
with codesign --verify --deep --strict -R (src/codesign.rs) against
app/driver-requirement.txt: anchor apple generic, identifier
anomaly.hex.microphone.driver, Developer ID, and Anomaly's team
5NZ4Q7NXJ4. The check runs in the install worker before the admin prompt
and reports through DriverActionState::Failed.

dev_build::is_local_build is the gate: debug, test, HEX_LOCAL_BUILD,
HEX_TEST_BUILD, or an unmarked 0.0.0-dev checkout. It is narrower than
is_dev_build, whose dev-channel builds are published and signed with the
same Developer ID, so a dev-channel driver is verified too.

The candidate selection is a pure function: a bundle copy that is present
but broken fails the install instead of falling through to the cache, and
only local builds consider ~/Library/Caches/hex-mic at all, so an ad-hoc
or other-team signed driver still installs there.

The updater is untouched.

* read the bundled driver version without checking its signature

status() asks for the bundled driver's version on the UI thread (the macOS
host's platform poll), and the version read went through
bundled_driver_path(), which spawns codesign in a shipped build. The
version read now shares the install's candidate order and cache policy but
never verifies; only the install worker, before the admin prompt, checks
the signature.

Also says exactly what the requirement test pins (the driver's identifier
and the team ID the updater's requirement uses), and lists every kind of
local build the cache fallback covers in the feature map.

* driver install: re-check the signature as root and refuse symlinked copies

Addresses the second review of #2767.

The user-side codesign check ran before the admin prompt, so a bundle
swapped while the prompt was up was copied anyway. The requirement now
travels to osascript as its own argv item (empty for local builds) and
the root shell checks the staged copy with codesign --verify before it
replaces the driver or restarts coreaudiod. The copy refuses a symlinked
or non-directory source, drops ACLs and quarantine flags, and leaves the
staging copy root:wheel with no group or other write.

Candidate inspection uses symlink_metadata: a symlink (dangling included)
or a non-directory fails the install instead of reading as missing, and
only a real Hex.app's Contents folder counts as the running bundle. The
user home comes from app_paths.

is_local_build no longer treats a hand-stamped 0.0.0-dev-<N> build (what
scripts/release-app.sh makes, signed and notarized) as local; only
build.rs's -dev-local marker is local. is_dev_build is unchanged.

nix/package.nix's fileset now carries the two app/*-requirement.txt files
the Linux build and tests include, and the codesign helper compiles on
macOS only.
2026-11-24 16:58:01 -05:00
..
hex_microphone fix(audio): stop using cpal default devices on Windows (#2622) 2026-11-23 22:08:04 -05:00
open Labs: voice isolation for dictation on macOS and iOS (#2425) (#2429) 2026-11-22 17:00:41 -05:00
recording_environment dictation: don't count audio before output suppression as missed opening speech (#2338) (#2514) 2026-11-23 07:09:11 -05:00
recovering refactor(core): simplify engine slot, output plan, labs, updater, audio, and onboarding view (#2627) 2026-11-23 19:38:36 -08:00
browser_media.rs dictation: don't count audio before output suppression as missed opening speech (#2338) (#2514) 2026-11-23 07:09:11 -05:00
call_input.rs Meetings: record the input the call app uses (#1086) (#1091) 2026-11-03 00:14:23 -05:00
default_endpoint.rs fix(audio): stop using cpal default devices on Windows (#2622) 2026-11-23 22:08:04 -05:00
devices.rs refactor(audio): split src/audio.rs into capability modules (#2246) 2026-11-21 13:06:57 -08:00
effect_holds.rs refactor(audio): explicit owner/recovery states and composed OS audio control (#2485) 2026-11-22 22:46:17 -08:00
fixture.rs refactor(audio): explicit owner/recovery states and composed OS audio control (#2485) 2026-11-22 22:46:17 -08:00
hex_microphone.rs verify the hex microphone driver's signature before installing it (#2767) 2026-11-24 16:58:01 -05:00
idle_sleep.rs Fold audio and recording-environment modules into audio/ 2026-10-31 16:12:40 -07:00
input_format.rs fix(audio): stop using cpal default devices on Windows (#2622) 2026-11-23 22:08:04 -05:00
input_level.rs Show the microphone's level on the recording toolbar and capsule (t1607) (#2217) 2026-11-21 10:04:34 -08:00
instant.rs refactor(audio): split src/audio.rs into capability modules (#2246) 2026-11-21 13:06:57 -08:00
interruption.rs windows, linux: keep a dictation press across a microphone reopen (#2098) 2026-11-20 16:58:08 -05:00
lid.rs Extract instant and lid from audio.rs 2026-10-31 18:57:51 -07:00
linger.rs fix(dictation): release the warm mic while the display sleeps or the screen is locked (#1956) 2026-11-18 02:34:47 -05:00
mix_format.rs windows: try iaudioclient3, interface activation and auto-convert wasapi paths (#1270) 2026-11-04 08:49:05 -05:00
open.rs fix(audio): stop using cpal default devices on Windows (#2622) 2026-11-23 22:08:04 -05:00
output_ducking.rs dictation: don't count audio before output suppression as missed opening speech (#2338) (#2514) 2026-11-23 07:09:11 -05:00
output_route.rs meetings: rebuild the system tap when the output changes or goes digitally silent (#2642) 2026-11-24 02:08:04 -05:00
overloads.rs audio: keep overload reporting off CoreAudio's real-time thread (#1643) 2026-11-10 13:17:35 -05:00
recording_environment.rs dictation: don't count audio before output suppression as missed opening speech (#2338) (#2514) 2026-11-23 07:09:11 -05:00
recovering.rs refactor(core): simplify engine slot, output plan, labs, updater, audio, and onboarding view (#2627) 2026-11-23 19:38:36 -08:00
recovery.rs fix: renegotiate the mic's sample rate after digital silence (#1575) (#1693) 2026-11-11 09:30:51 -05:00
routes.rs fix(audio): stop using cpal default devices on Windows (#2622) 2026-11-23 22:08:04 -05:00
stream.rs fix(audio): stop using cpal default devices on Windows (#2622) 2026-11-23 22:08:04 -05:00
system_idle.rs meetings: end a call that hangs up as the mac locks (#2685) (#2697) 2026-11-24 09:24:10 -05:00
transport.rs linux: move input_activity and input_route into input/ (#2150) 2026-11-21 01:53:36 -05:00
voice_filter.rs Fold audio and recording-environment modules into audio/ 2026-10-31 16:12:40 -07:00
voice_processing.rs Labs: voice isolation for dictation on macOS and iOS (#2425) (#2429) 2026-11-22 17:00:41 -05:00
wasapi_capture.rs fix(audio): stop using cpal default devices on Windows (#2622) 2026-11-23 22:08:04 -05:00