Commit Graph

307 Commits

Author SHA1 Message Date
Robert Berry
889e78cb28 Merge "Add RecoverySession importKeyChainSnapshot method" into pi-dev 2018-03-21 12:25:37 +00:00
Robert Berry
4a5c87def0 Add RecoverySession importKeyChainSnapshot method
This imports the keys directly into the keystore of LockSettingsService,
allowing them to be accessed via the RecoveryController getKey method.
This is better as it does not expose raw key material to any app.

Bug: 74345822
Test: runtest frameworks-services -p \
      com.android.server.locksettings.recoverablekeystore

Change-Id: I4991b0cff1d2fa2e5bd0b53a71c096499e93e98b
2018-03-21 10:24:41 +00:00
Bo Zhu
b31ab6740d Use the new root cert file under the core/ folder
This CL also adds an alias param to the RecoverySession#start method.

Bug: 76033708
Test: runtest frameworks-services -p \
      com.android.server.locksettings.recoverablekeystore

Change-Id: I870f4f89bd6e319e1687a981aa04af0d23f3c922
2018-03-20 22:49:00 -07:00
TreeHugger Robot
62fa81f7b4 Merge "Move the trusted root CA certs for RecoverableKeyStore to our own folder" into pi-dev 2018-03-21 00:38:35 +00:00
Bo Zhu
c5c4a0e948 Move the trusted root CA certs for RecoverableKeyStore to our own folder
Bug: 74621071
Test: runtest frameworks-core -p android.security.keystore.recovery
Change-Id: I3668594b29f56832f2a1fe78b01f585c897bf952
2018-03-20 15:17:30 -07:00
TreeHugger Robot
cb686a19e6 Merge "Minor changes to the API to align the choice of password hashing algorithm" into pi-dev 2018-03-20 21:13:26 +00:00
Bo Zhu
e066a59436 Minor changes to the API to align the choice of password hashing
algorithm

The password hashing algorithm has existing implementation in AOSP.

Bug: 75024420
Test: None
Change-Id: If1b07dadf21837af1cb2835df3f12c234894f57e
2018-03-19 22:32:27 -07:00
TreeHugger Robot
f679bda843 Merge "Move trusted CA certs to core" into pi-dev 2018-03-19 21:44:23 +00:00
Robert Berry
2efe66b649 Move trusted CA certs to core
Android Security team asked us to do this.

Bug: 74621071
Test: runtest frameworks-core -p android.security.backup
Change-Id: Ieae1649b82d0143fd5d560195f74b9fc10316d02
2018-03-19 16:27:07 +00:00
TreeHugger Robot
b57365562d Merge "ConfirmationDialog: Fail if accessibility services are running." into pi-dev 2018-03-19 14:27:16 +00:00
Aseem Kumar
c1742e5137 Unhide getKey() and importKey() and the whole class of RecoveryController.
Added @RequiresPermission(android.permission.RECOVER_KEYSTORE) on all
public APIs of RecoveryController.

Bug: 73900159
Test: adb shell am instrument -w -e package \
com.android.server.locksettings.recoverablekeystore \
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: I1047c038603869307d7a2462a2e5635fcd1c94c2
2018-03-16 13:07:25 -07:00
Robert Berry
06764e5ad8 Delete unused RecoveryController exceptions
These were never used by GMSCore, so can safely be deleted.

Bug: 74944591
Test: it builds
Change-Id: Ib8955262223aa5d86de0b342f6e04c7461c71583
2018-03-15 14:34:16 +00:00
Bo Zhu
636108077f DO NOT MERGE Fix the null return value of getTrustedHardwareCertPath
I forgot to serialize and deserialize it in the last CL adding it.

Bug: 74359698
Change-Id: I34f9225dc63b55223c2a7db23ee3fa6abf056a0d
Test: atest RecoveryControllerHostTest
(cherry picked from commit b4d2cc684d)
2018-03-14 22:10:24 +00:00
David Zeuthen
e3aad1c076 ConfirmationDialog: Fail if accessibility services are running.
As the confirmation dialog only has limited accessibility support it
may not be usable by users requiring accessibility services.

Therefore, if the user has enabled accessibility services, fail with
ConfirmationNotAvailableException so the application can handle this
case. Also document this behavior.

Bug: 74545109
Test: Manually tested.
Change-Id: Ibfb80d217f5cbdc9ec2f4e0432dfdd88add69703
2018-03-12 17:27:38 -04:00
Bo Zhu
7f414d94fc Check the public-key signature of the whole certificate file before
accepting the certificates

This change requires an additional param to the initRecoveryService()
API to take in the public-key signature.

Bug: 73904566
Test: adb shell am instrument -w -e package \
com.android.server.locksettings.recoverablekeystore \
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: I2aeead1fda51b6cd8df71ed3b5066342ebc8d5ea
2018-02-28 11:58:30 -08:00
TreeHugger Robot
5240541e01 Merge "Remove @removed from APIs still in use" 2018-02-28 13:43:36 +00:00
Robert Berry
5af199c56e Remove @removed from APIs still in use
I completely misunderstood this annotation.

Bug: 73962883
Test: ran unit tests
Change-Id: Id3e3863fc6fd1e0614a3c75d25cd35239667eaf0
2018-02-28 10:31:43 +00:00
TreeHugger Robot
195599663a Merge "ConfirmationDialog: Pass accessibility options and implement isSupported()." 2018-02-27 22:26:30 +00:00
TreeHugger Robot
e2a95e5c5f Merge "Add a new API to import a key provided by the caller, such that this key can also be synced to the remote service" 2018-02-27 20:30:57 +00:00
TreeHugger Robot
9ba8462a06 Merge "Mark all old RecoveryController APIs as deprecated" 2018-02-27 19:51:27 +00:00
Bo Zhu
2c8e5383c8 Add a new API to import a key provided by the caller, such that this key
can also be synced to the remote service

This API may be useful for backward-compatibility work, e.g., recovering
a key that's backed up in Android Q+ to Android P without updating the
Android P Frameworks code. This API may also be useful for other use cases.

Bug: 73785182
Change-Id: I1022dffb6a12bdf3df2022db5739169fcc9347d2
Test: adb shell am instrument -w -e package \
com.android.server.locksettings.recoverablekeystore \
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
2018-02-27 09:18:59 -08:00
Robert Berry
19512fa32e Remove unused RecoveryClaim file
This is not part of the API so not sure why it's even in the package.

Test: manual
Change-Id: Ie970d2801d84719126e5d2e90351b14655f9e6f3
2018-02-27 11:10:38 +00:00
Robert Berry
8cb582d8bc Mark all old RecoveryController APIs as deprecated
Test: none, no functionality changed
Change-Id: I0ff1d169b1597bf6e4447f52b0685874e7ec3745
2018-02-27 11:10:22 +00:00
Robert Berry
beafcb50d4 Fix minor documentation issues in RecoveryController
Test: none, just doc updates
Change-Id: I7d2152f788a65162d72dbd9970230a9a07034014
2018-02-26 19:01:38 +00:00
David Zeuthen
bbb7f65a23 ConfirmationDialog: Pass accessibility options and implement isSupported().
Bug: 63928580
Test: Manually tested.
Change-Id: I6a06d10a4cb924c3e57c8e212ba4626cad00f4a1
2018-02-26 11:08:00 -05:00
TreeHugger Robot
a620aa1a13 Merge "Remove account param from generateKey method" 2018-02-26 15:16:18 +00:00
TreeHugger Robot
c44d5053f2 Merge "Remove account from WrappedApplicationKey" 2018-02-26 14:52:19 +00:00
Robert Berry
8230c8e0d4 Add test for KeyChainSnapshot Parcelable
Bug: 73811828
Test: runtest frameworks-core -p android.security.keystore.recovery
Change-Id: I9448ff791f4f8b82621df2d4343febdce86dbf42
2018-02-26 11:17:55 +00:00
Robert Berry
291bd32c9e Remove account from WrappedApplicationKey
Recovery controller will no longer be aware of accounts. It is up to
the recovery agent to decide where to upload keys, and if so what
accounts to use.

Bug: 73811828
Test: runtest frameworks-core -p android.security.keystore.recovery
Change-Id: I929076d948f4d36ba88b68cca08058a5cdde0107
2018-02-25 23:11:17 +00:00
Robert Berry
a3b994798d Remove account param from generateKey method
Bug: 73811828
Test: runtest frameworks-services -p
      com.android.server.locksettings.recoverablekeystore
Change-Id: If2f4174beea9cfb8c852139a7594815c377dbe7a
2018-02-25 14:48:42 +00:00
Robert Berry
f34ad9509d Merge "Remove packageName from getRecoveryStatus" 2018-02-25 14:08:47 +00:00
TreeHugger Robot
8a36da32a1 Merge "Add CertPath to KeyChainSnapshot and startRecoverySession" 2018-02-24 10:19:21 +00:00
Bo Zhu
7c1972ff71 Add CertPath to KeyChainSnapshot and startRecoverySession
CertPath will include a cert of the trusted hardware and necessary
intermediate certificates.

Bug: 73784851
Change-Id: Ic70616b8f119891a82402b91035456e404c5f6de
Test: adb shell am instrument -w -e package \
com.android.server.locksettings.recoverablekeystore \
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
2018-02-23 16:44:41 -08:00
TreeHugger Robot
ed24f903ea Merge "Revert "Add "Unlocked device required" parameter to keys"" 2018-02-23 17:42:45 +00:00
Robert Berry
01468dae19 Merge "Make it possible to construct a RecoverySession" 2018-02-23 16:40:36 +00:00
Robert Berry
56f06b4d11 Remove packageName from getRecoveryStatus
This parameter is unused.

Bug: 73757432
Test: runtest frameworks-services -p
      com.android.server.locksettings.recoverablekeystore

Change-Id: I153a84d71b0ebaed8ce3a1f0f33c70036dd960b2
2018-02-23 15:12:06 +00:00
Robert Berry
e04e09ad87 Make it possible to construct a RecoverySession
These methods are currently inaccessible.

Bug: 73763265
Test: it builds

Change-Id: I8358a8084e1c4fa96b1fe599ef6b17d6196d6a12
2018-02-23 12:00:34 +00:00
Brian Young
da82e2cb71 Revert "Add "Unlocked device required" parameter to keys"
This reverts commit efc3f16be7.

Reason for revert: Regression in creating auth-bound keys

Bug: 73773914

Bug: 67752510

Change-Id: Ic3886ceb3c3c0c4274682ed9f5f2bfbf8fdd71b9
2018-02-23 01:31:49 +00:00
Robert Berry
bbe02ae8a3 Remove package name parameter from setRecoveryStatus
Package name is implicit. Recovery agent can only act for the same uid.

Bug: 73757432
Test: runtest frameworks-services -p
      com.android.server.locksettings.recoverablekeystore

Change-Id: I45abf4b956fa4e97d981614d9e61295e85d5669e
2018-02-22 10:45:32 +00:00
Brian Young
a83d333843 Merge "Add "Unlocked device required" parameter to keys" 2018-02-16 01:18:53 +00:00
Bo Zhu
8060c29816 Add OWNERS files for the recoverable keystore folders
Test: None
Change-Id: I4ad1079cbda4e10ea5f76fb8b3cc280befc62928
2018-02-14 14:38:34 -08:00
Brian C. Young
efc3f16be7 Add "Unlocked device required" parameter to keys
Add a keymaster parameter for keys that should be inaccessible when
the device screen is locked. "Locked" here is a state where the device
can be used or accessed without any further trust factor such as a
PIN, password, fingerprint, or trusted face or voice.

This parameter is added to the Java keystore interface for key
creation and import, as well as enums specified by and for the native
keystore process.

Test: CTS tests in I8a5affd1eaed176756175158e3057e44934fffed

Bug: 67752510

Change-Id: I314b848f6971d1849a7a6347d52e41d9604639ae
2018-02-14 12:19:13 -08:00
Logan Chien
404eb2bcd5 Fix PDK build
This commit moves "IConfirmationPromptCallback.aidl" and
"IKeystoreService.aidl" to "system/security/keystore/binder" so that
"libkeystore_aidl" can be built in PDK builds.

Test: Run `cts-tradefed run cts -m CtsKeystoreTestCases` on Pixel 2017
and the test results are idential with and without this CL.

Test: Build PDK with special manifest described in
http://b/69539820#comment18 and http://b/69539820#comment19.

Test: Build a target (described in http://b/72961456) with
`platform.zip` built from master FSK source tree.

Bug: 69539820
Bug: 72961456
Change-Id: I7350f0ca943b15a6f3e40023a6cc299bdf8aed0e
2018-02-14 15:46:50 +08:00
Dmitry Dementyev
29b9de5b8a Update RecoveryController to use KeyStore grant API.
Missing parts:
1) Whitelist locksettingsservice to use grant API.
2) Probably have similar update for recovered keys - they will live in
system service and RecoveryAgent will use getKey() method to access
them.
3) ApplicationKeyStorageTest

Bug: 66499222
Test: adb shell am instrument -w -e package \
com.android.server.locksettings.recoverablekeystore \
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: I584b89e3f777bed679b2eb5173750f3f1dee3635
2018-02-01 17:41:18 -08:00
TreeHugger Robot
00646ee730 Merge "Add Confirmation API." 2018-01-31 18:40:32 +00:00
Dmitry Dementyev
a823068ef1 Merge "Remove finalizer which clears user secret at unpredictable time." 2018-01-30 22:56:20 +00:00
David Zeuthen
a8e8b659d0 Add Confirmation API.
This CL adds new Framework APIs that can be used for the secure
confirmations. This includes support for configuring a key such that
it can only sign data returned by the confirmation APIs.

Bug: 63928580
Test: Manually tested.
Change-Id: I94c1fc532376bd555b3dc37fc4709469450cfde6
2018-01-30 17:33:21 -05:00
Dmitry Dementyev
19da3400a6 Remove finalizer which clears user secret at unpredictable time.
Bug: 72443379
Test: adb shell am instrument -w -e package
com.android.server.locksettings.recoverablekeystore
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Id5410494664952d171beff615e0497a8af061e69
2018-01-30 13:16:47 -08:00
Jorim Jaggi
05bf37612c Merge "Revert "Add "Unlocked device required" parameter to keys"" 2018-01-30 15:36:28 +00:00
Brian Young
3a28570b28 Revert "Add "Unlocked device required" parameter to keys"
This reverts commit 55fff3a89d.

Reason for revert: Build breakages on elfin, gce_x86_phone.

Bug: 67752510

Bug: 72679761
Change-Id: Ia495e9cb158b64fcf015e37b170554a7ed6810a7
2018-01-30 15:31:42 +00:00