ObliviOS Developer portal Project site

Home / Decisions / ADR-040

Adopt a hardware-backed "Candidate B" dummy-cost credential check.

Accepted, recorded 15 August 2026.

Decision
ADR-040
Date
2026-08-15
Status
AcceptedAccepted
Mentions
ADR-039

1Decision

Adopt a hardware-backed "Candidate B" dummy-cost credential check (docs/superpowers/specs/2026-08-15-duress-dummy-candidate-b-design.md) in place of the software-only "Candidate A" sketched in Stage 1's plan, and record that ADR-039's own review trigger has fired: real-hardware timing measurement found the symmetric-cost dispatch was not symmetric with a software-only dummy.

2Why and evidence

Stage 1 Task 1 measured two already-shipped code paths on the emulator: a real per-profile check (unlockLskfBasedProtector, real GateKeeper round-trip) at 38.51ms mean, versus GrapheneOS's existing wipe-PIN check (DuressCredential.verify, software-only scrypt) at 2.37ms mean — a 16.3x gap, non-overlapping ranges.

A dummy mirroring only the wipe-PIN's software cost would be a measurable timing side-channel, so Candidate A is ruled out by real data, not preference.

Candidate B instead adds a new special-user sentinel (USER_DURESS_DUMMY, alongside the existing USER_FRP/USER_REPAIR_MODE pattern) whose "pay" operation is a direct call to the already-shipped SyntheticPasswordManager.verifySpecialUserCredential, so the real HAL round-trip (GateKeeper or Weaver, auto-detected the same way createLskfBasedProtector already does) is the literal same class of operation as a real per-profile check, not an approximation.

Storage deliberately mirrors USER_REPAIR_MODE's plain-file pattern, not USER_FRP's, after source review confirmed FRP's persistent data is backed by PersistentDataBlockManagerInternal — a dedicated factory-reset-protection partition unrelated to this feature and unsafe to entangle with.

Provisioning is eager (at LockSettingsService startup, idempotent) with a lazy self-healing fallback, chosen over pure lazy-on-first-use to avoid any first-attempt timing tell.

3Consequences

Updated 2026-08-16. Code has landed and is emulator-validated: frameworks/base commits e37c96c8 (primitive) and e6e5746 (a real defect fix — see below), system/sepolicy a99b535e, system/core c55eb4e7, all on branch aegisos-duress-dummy-primitive.

The LockSettingsService startup hook point this design left open is confirmed safe against real source: onBootPhase's PHASE_ACTIVITY_MANAGER_READY branch, the same phase repair-mode's own boot-time maintenance already uses.

Real execution found one scope gap this design did not anticipate — system_server cannot write an arbitrary new /metadata subdirectory by design (a deliberate GrapheneOS SELinux hardening boundary); fixed with a narrowly-scoped dedicated SELinux type mirroring the existing watchdog/repair_mode pattern, not a widening of the generic grant.

Task review also found provisionDuressDummyIfNeeded never cleared stale GateKeeper/Weaver state before re-enrolling (unlike the real per-profile path it mirrors) — fixed and independently re-reviewed. Real measured dummy-check HAL round-trip: 147.03ms, ~3.8x this ADR's own 38.51ms per-profile figure rather than closely matching (plausible cold-boot-vs-warm-HAL explanation, not confirmed) — see the review trigger update.

Physical Pixel 7a hardware validation (Weaver-vs-GateKeeper auto-detection, real-hardware timing) is in progress, not yet complete.

4Review when

Revisit if physical hardware validation finds a materially different timing profile than the emulator (e.g. Weaver adds enough cost asymmetry of its own to reopen a side-channel), or if provisioning at LockSettingsService startup proves unsafe against real GateKeeper-service-readiness ordering.

Partially live, not yet resolved: the emulator's own real timing (147.03ms dummy vs. 38.51ms real per-profile) already shows a 3.8x gap on the same platform — not yet treated as a confirmed trigger since the two figures were measured in different HAL warm/cold states, not a like-for-like comparison, but physical hardware measurement (Task 3, in progress) should either explain this gap or confirm it's real and reopen this decision.

Read from docs/governance/decision-log.md, entry ADR-040.