Commit Graph

342 Commits

Author SHA1 Message Date
Robert Berry
a0696a6f9c Merge "Merge "Do not throw KeystoreException for when a key does not exist" into pi-dev am: 73b7722c13" into pi-dev-plus-aosp
am: 2220061b45

Change-Id: I6bd7211be02e0cf755f8b88f13558c16a83bc62f
2018-03-23 22:55:30 +00:00
TreeHugger Robot
73b7722c13 Merge "Do not throw KeystoreException for when a key does not exist" into pi-dev 2018-03-23 20:03:45 +00:00
Dmitry Dementyev
422a2c13ad Merge "Prepare KeyChainSnapshot to removing deprecated getTrustedHardwarePublicKey method." into pi-dev am: 95f2965a74
am: 64a9487249

Change-Id: Ie1468db0c0a71233895ec9e1cc61665146c6f791
2018-03-23 18:57:22 +00:00
Dmitry Dementyev
a762236f51 Merge "Update RecoverableKeyStoreManager methods to throw NullPointerException when null is passed as @NonNull argument." into pi-dev am: 364dbf1c9e
am: e7250b6ec6

Change-Id: I283fa89f8da060180bfc89d4eb5ec61e5e43ff4c
2018-03-23 17:42:47 +00:00
Dmitry Dementyev
95f2965a74 Merge "Prepare KeyChainSnapshot to removing deprecated getTrustedHardwarePublicKey method." into pi-dev 2018-03-23 17:16:17 +00:00
Dmitry Dementyev
364dbf1c9e Merge "Update RecoverableKeyStoreManager methods to throw NullPointerException when null is passed as @NonNull argument." into pi-dev 2018-03-23 17:06:18 +00:00
Bo Zhu
c9c790a938 Merge "Unhide the enum/function for the password hashing algorithm scrypt" into pi-dev am: 9ec7026e92
am: 2e815c6e74

Change-Id: I3374a90dbdee1feb2eeecd054da6069c3e630802
2018-03-23 15:57:36 +00:00
Bo Zhu
9ec7026e92 Merge "Unhide the enum/function for the password hashing algorithm scrypt" into pi-dev 2018-03-23 15:25:36 +00:00
Aseem Kumar
e7834b5677 Merge "Delete unimplemented APIs from RecoveryController." into pi-dev am: 0ed26bc8b1
am: b0add1f630

Change-Id: I6a03ba603aa44d0ecc0b3b10dd27b896a4d0879f
2018-03-23 11:44:23 +00:00
Robert Berry
72f5755721 Do not throw KeystoreException for when a key does not exist
Bug: 75955240
Test: manual
Change-Id: Ibd2f4d7cd654752b69d2d22e803d4d1cc05c118f
2018-03-23 08:08:02 +00:00
Aseem Kumar
933dfc1cd6 Delete unimplemented APIs from RecoveryController.
Bug: 74859770
Test: make update-api builds
Change-Id: Ic547e0ee2ef13995389a71369ffa736a7d83b78a
2018-03-23 05:16:42 +00:00
Bo Zhu
40d8a45b23 Unhide the enum/function for the password hashing algorithm scrypt
Bug: 75024420
Test: none, it's just unhiding APIs
Change-Id: I9cbb327678d334079e2c660d85013f3073d4cb87
2018-03-22 20:22:44 -07:00
Dmitry Dementyev
1e6a9dcecb Update RecoverableKeyStoreManager methods to throw NullPointerException when null is passed as @NonNull argument.
Mark serverParams as nullable. Null value can be used to prevent new
snapshots creation.

Bug: 73959762
Test: Test: adb shell am instrument \
-w -e package com.android.server.locksettings.recoverablekeystore \
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I5c6ddd696b2882b3d27978b0146ff419bedaf5ee
2018-03-22 19:47:20 -07:00
Dmitry Dementyev
3b67e06de5 Prepare KeyChainSnapshot to removing deprecated getTrustedHardwarePublicKey method.
Add null checks to getTrustedHardwareCertPath.
Remove unused and outdated PersistentKeyChainSnapshot class.
Use CertPath instead of public keys in  KeySyncTaskTest.

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

Change-Id: Ifabe7d5fa250069ebe0885ce52ec29b01294f63a
2018-03-22 19:43:17 -07:00
Robert Berry
d76a3d2716 Merge "Unhide RecoveryController#getRootCertificates()" into pi-dev am: c6bd185565
am: be910a789e

Change-Id: I5fdaf507def6a7f679b2ce4569f5787864e31f45
2018-03-22 18:13:14 +00:00
Robert Berry
bdafd55ff0 Merge "Unhide RecoverySession#recoverKeyChainSnapshot() method" into pi-dev am: 3818de595b
am: 986afbd959

Change-Id: Id38a53ef38e7d493e715cff747ebd2b0a9880a98
2018-03-22 18:07:58 +00:00
Robert Berry
c6bd185565 Merge "Unhide RecoveryController#getRootCertificates()" into pi-dev 2018-03-22 17:23:05 +00:00
Robert Berry
3818de595b Merge "Unhide RecoverySession#recoverKeyChainSnapshot() method" into pi-dev 2018-03-22 17:19:33 +00:00
Robert Berry
6909539a2d Merge "Small fix for the key grant alias used in importKey" into pi-dev am: f9332469a4
am: 157aee22f5

Change-Id: Ida134803f6c251448ba65cfcc87669c01ea99f2b
2018-03-22 14:25:30 +00:00
Robert Berry
ce50efa321 Merge "Unhide the new RecoverySession#start with the alias for root cert" into pi-dev am: 98ea60c427
am: 60efe8379d

Change-Id: I5b04c097bb5f26fe031191bcc208db9408f998a3
2018-03-22 14:20:27 +00:00
Robert Berry
f9332469a4 Merge "Small fix for the key grant alias used in importKey" into pi-dev 2018-03-22 13:55:31 +00:00
Robert Berry
750b71c651 Unhide RecoverySession#recoverKeyChainSnapshot() method
The other methods expose raw key materials, which is a security flaw. This
new API is already being used by GMSCore, via reflection (although falling
back to the old methods if it is not available). Would be good to switch it
on ASAP.

Bug: 74345822
Test: Tested with GMSCore
Change-Id: I30d53c9e825888d1122c72d23b7c1c10c6edb1e9
2018-03-22 13:49:54 +00:00
Robert Berry
93d002ca5f Unhide RecoveryController#getRootCertificates()
This is so we can add a GTS test to affirm that GMS devices include the
Google Cloud Key Vault root certificate.

Test: runtest frameworks-core -p android.security.keystore.recovery
Bug: 74621045
Change-Id: Ib6431f5739f3dff066832e6aa300dd9da5bc0727
2018-03-22 13:49:20 +00:00
Bo Zhu
e7997a3ea7 Unhide the new RecoverySession#start with the alias for root cert
Bug: 76033708
Test: none, it's just unhiding APIs
Change-Id: Iec1e44d24bb1704da082404566233ada83b8eb81
2018-03-21 19:50:50 -07:00
Bo Zhu
c5ab69469d Small fix for the key grant alias used in importKey
Bug: 74345822
Test: atest RecoveryControllerHostTest#testImportKey_ValidKey
Change-Id: I54812b3d7465ee508fe48886f5897470fe7455a0
2018-03-21 23:46:20 +00:00
Robert Berry
cececb6d19 Merge "Add RecoverySession importKeyChainSnapshot method" into pi-dev am: 889e78cb28
am: b0850c9a16

Change-Id: Ib6df86c889582368e8129ebf0e5d0d543c520b41
2018-03-21 12:51:12 +00:00
Bo Zhu
06cf154386 Merge "Use the new root cert file under the core/ folder" into pi-dev am: 82235880f6
am: 518b7de5af

Change-Id: If4e987b389c529cce4c0e252e100d7d84b5579cf
2018-03-21 12:44:02 +00:00
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
deea4dcb58 Merge "Move the trusted root CA certs for RecoverableKeyStore to our own folder" into pi-dev am: 62fa81f7b4
am: 71802f34c2

Change-Id: Ib9f4be5e23d50fd6bbd32cd7469eea67b1e82386
2018-03-21 06:06:58 +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
Bo Zhu
a6bb320e74 Merge "Minor changes to the API to align the choice of password hashing algorithm" into pi-dev am: cb686a19e6
am: 85baae4778

Change-Id: I0eefe1d2040367e9df7815f048f94e252290c698
2018-03-21 01:48:45 +00: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
Robert Berry
4f78109b5f Merge "Move trusted CA certs to core" into pi-dev am: f679bda843
am: 4d549c21ff

Change-Id: I7329c070aae09104e004d94c53b8d80b85dbbdbf
2018-03-20 03:30:36 +00: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
David Zeuthen
49ccdf5d06 Merge "ConfirmationDialog: Fail if accessibility services are running." into pi-dev am: b57365562d
am: f3f0683eeb

Change-Id: I3e936595bc91cf312a0abbcb1e68896e51cf4263
2018-03-19 14:52:59 +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
183dcf30ba Merge "Unhide getKey() and importKey() and the whole class of RecoveryController. Added @RequiresPermission(android.permission.RECOVER_KEYSTORE) on all public APIs of RecoveryController." into pi-dev am: 3b0450d4a9
am: 12c26fc509

Change-Id: I46b57bd17237f75323f56c1bd690132872bb75f4
2018-03-16 23:05:10 +00:00
TreeHugger Robot
0f44c5de26 Merge changes from topics "niap-asym-write", "niap-asym-write-api"
* changes:
  Restore "Add "Unlocked device required" parameter to keys"
  Add "Unlocked device required" key API
2018-03-16 22:31:19 +00:00
Brian Young
fd75c7232a Add "Unlocked device required" key API
This adds the API methods and values for keyguard-bound keys, but
contains none of the actual functionality.

Test: CTS tests in CtsKeystoreTestCases

Bug: 67752510
Change-Id: Iccd7dafd77258d903d11353e02ba3ab956050c40
2018-03-16 15:27:10 -07: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
b4d2cc684d 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
2018-03-09 14:21:14 -08: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