Skip to content

Add A17 (SDK 37) KeyTestingPatches and backport for A16 - #62

Open
KVVat wants to merge 3 commits into
android:masterfrom
KVVat:patch-update-sdk37
Open

KVVat wants to merge 3 commits into
android:masterfrom
KVVat:patch-update-sdk37

Conversation

@KVVat

@KVVat KVVat commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds the Android 17 (26Q2-release / SDK 37) Key Testing Patches and backports the lab-requested key-dumping updates to Android 16 (25Q2-release / SDK 36):

  1. KMD.3 SyntheticPasswordManager Zeroization Control (dumpsys lock_settings --clear)
    • Running adb shell dumpsys lock_settings continues to print recorded KMD.3 key buffers non-destructively.
    • Running adb shell dumpsys lock_settings --clear (also accepts clear or -c) outputs the current state once, overwrites all stored byte[] key buffers with 0x00 (Arrays.fill), sets all references to null, resets mKMDsecdisProtectorId = 0, and permanently blocks further debug buffer re-assignment until the next reboot (mKMDZeroized = true).
    • All debug key buffer assignments now route through storeKMDKey() / storeKMDSecdiscardable(), zeroizing any previous buffer before replacement to prevent residual copies on the Java heap.
  2. KMD.4 vold CBOR Inner Key Extraction (system/vold/KeyStorage.cpp)
    • Parses KeyMint CBOR envelopes (EncryptedKeyBlobV1 / #6.16(Cose_Encrypt0)) in retrieveKey() and logs only the extracted inner key bytes (stripping the shared CBOR header/characteristics overhead) for keys such as /data/misc/vold/user_keys/ce/0/current.
    • Falls back to logging the raw key unchanged when the key buffer is not CBOR-encoded.
    • Leaves the actual *key buffer untouched so storage decryption behavior is unaffected.
  3. Android 17 (26Q2-release) Full Patch Set
    • Adds niap-cc/KeyTestingPatches/Android17/ covering system/vold, external/wpa_supplicant_8, system/security/keystore2, frameworks/base/services/.../locksettings, README.md, and an optional local workstation build workaround (_build/soong/ui/build/cipd.go.patch, not applicable to Android 16).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant