LifeMate — Personal, Family & Learning Companion

feat/local-signing-preflight
chore/phase1-repository-cleanup deploy/stable-web-apk deployment-static design/mobile-accessibility-v2 design/mobile-navigation-review docs/child-education-access-decision docs/offline-data-rescue-options docs/owner-guide-and-delivery-plan docs/phase1-policy-options docs/public-review-live-2026-10-15 feat/aparat-learning-library feat/child-device-safety feat/child-identity-schema feat/flutter-mobile-navigation feat/learning-content-operations feat/local-signing-preflight feat/online-family-stage0 feat/personal-encrypted-recovery feat/private-planner-series-api feat/public-review-page feat/standalone-weekly-planner feat/weekly-planner-android final-feature-1/iran-family-school fix/auth-abuse-expiry-safety fix/auth-expiry-after-lock fix/backend-request-safety fix/lifeguide-bootstrap-naming-ci fix/lifeguide-pages-qa-base-preflight fix/lifeguide-qa-pages-env-deployment fix/local-task-persistence fix/managed-child-session-boundary fix/personal-jalali-dates fix/personal-notification-controls fix/personal-upgrade-delivery-guard fix/sms-approval-gates fix/study-duration-display infra/cloudflare-neon-migration infra/lifeguide-cloudflare-qa infra/lifeguide-github-pages-qa infra/lifeguide-supabase-qa main phase-1/foundation-completion phase-2/product-foundation-identity phase-3/planner-school-family-core phase-4/ai-learning-wellbeing phase-5/hardening-observability-release test/android-reminder-acceptance test/personal-notification-settings test/personal-recovery-acceptance test/role-entry-apk
md 60 lines 3.79 KB
Rendered Raw
1 # Local signing preflight — preparation only
2
3 Scope: a read-only host tool for a future, explicitly chosen owner-local key
4 inspection. This packet implements and exercises it with ephemeral synthetic
5 keys only. ADR0018's preparation-only boundary is unchanged. It does not create
6 an owner key, configure signing, transfer child data or unlock APK delivery.
7
8 ## Problem and approach
9
10 The installed APK's public signer is recorded in the delivered baseline. Its
11 private key's availability is UNVERIFIED. Existing release automation signs the
12 online application on GitHub; it is unsuitable for inspecting an offline owner's
13 key locally. Parsing verbose keytool output could expose certificate identity.
14 Use Python for explicit CLI/guards and a small local JDK17+ helper for typed
15 KeyStore inspection instead. No network, device or signing/build commands.
16
17 Default `check` reads only the public baseline and checks Java availability,
18 including compiling the fixed helper with empty input (no key inspection).
19 `inspect` requires an explicit file, alias, acknowledgement and a non-echoing
20 interactive terminal. Passwords have no argument/environment interface. The
21 tool never searches for keys, copies/exports/generates one, prints identities,
22 writes reports automatically, or modifies the selected file. Output is JSON
23 containing only a fingerprint, public compatibility facts and fixed codes.
24
25 The encrypted file is read once with the existing bounded no-follow regular-file
26 reader (2 MiB maximum). A local subprocess receives bounded binary stdin, no
27 secret/path/alias arguments: `LGKI`, then four unsigned big-endian 32-bit lengths
28 and their byte strings: keystore, UTF-8 alias (1–256 bytes), store password
29 (1–4096 bytes), key password (1–4096 bytes). EOF required. Passwords reject NUL,
30 CR and LF. Java supports JKS and PKCS12; it decrypts a PrivateKeyEntry, signs a
31 random internal challenge and verifies it with the certificate's public key.
32 RSA/SHA256withRSA and EC/SHA256withECDSA only. Challenge/signature/private key
33 are never output. Fixed helper JSON v1 has `certificateSha256`, `debugCertificate`,
34 `privateKeyProof` (true) and `certificateCurrentlyValid` booleans, or a refusal
35 code. Python validates the exact schema. Child timeout 30 seconds, heap 96 MiB.
36
37 Comparison is against the reviewed delivered baseline, with no caller override.
38 A matching debug signer remains a compatibility fact; the tool must separately
39 refuse to label it production-ready. Every report keeps `delivery: BLOCKED`,
40 `releaseReadiness: UNVERIFIED`, `installedDeviceVerification: UNVERIFIED` and
41 `dataPreservation: UNVERIFIED`. A successful inspection is not release approval.
42
43 ## Acceptance and boundaries
44
45 - Real temporary JKS/PKCS12 fixtures: repeated inspection, encrypted fixture copy,
46 wrong store/key passwords, missing/certificate-only aliases, corrupt input,
47 debug certificate. Source bytes remain equal. Fixture identity is fictional.
48 - CLI acknowledgement/TTY before file access; malformed arguments/errors, helper
49 corruption/timeout cannot leak canary passwords, paths, aliases or raw output.
50 - No symlink, FIFO, directory, oversized file or baseline override. No plaintext
51 file writes or secret arguments. JVM environment options that can inject
52 agents/options are removed from the helper child environment.
53 - Ubuntu/Windows CI uses ephemeral test keys only and uploads no key material.
54 - Windows interactive prompts/ACL, owner keys/device, actual signing/upgrade,
55 data transfer and Android acceptance remain UNVERIFIED until separately done.
56 - Python/JVM memory zeroization, hostile administrators/JDKs, parent-directory
57 symlink confinement and adversarial local filesystems are not guaranteed.
58
59 No Flutter/backend/Gradle/package/version/workflow-delivery-policy changes.
60 No merge, deploy, DNS, public release, owner key operation or real-data operation.