Commit Graph

377 Commits

Author SHA1 Message Date
Bo Zhu
c704834cb6 Add an optional metadata blob for recoverable application keys
This metadata, if present, will be authenticated (but unencrypted)
together with the application key material.

Bug: 112191661
Test: atest FrameworksCoreTests:android.security.keystore.recovery
      atest FrameworksServicesTests:com.android.server.locksettings.recoverablekeystore
      atest -m RecoveryControllerHostTest RecoverableKeyStoreEndtoEndHostTest RecoverySessionHostTest

Change-Id: I2846952758a2c1a7b1f0849e1adda1f05a3e305e
2019-01-17 17:38:19 -08:00
TreeHugger Robot
278913ae62 Merge "Update KeyStore for new biometric modalities" 2018-11-16 22:52:30 +00:00
Janis Danisevskis
463e2b0d3c Merge "Multi-threaded keystore" am: 9f248989bf am: cbd890315e
am: 444162a57c

Change-Id: I2c09961a74c7de92d85f3d2045dd065c94bc6fac
2018-11-15 06:39:39 -08:00
Janis Danisevskis
b0358e72be Multi-threaded keystore
This patch makes the framework use the asynchronous keystore api model.

Bug: 111443219
Test: Ran full keystore cts test suite
Change-Id: I8d1fdc70cb9eb501d3f22a97d1221904c2ef8f9a
2018-11-14 09:59:16 -08:00
Kevin Chyn
057b743fe9 Update KeyStore for new biometric modalities
Biometrics are now generic from KeyStore point of view

Bug: 113624536

Test: Unable to create keys when no templates enrolled
Test: Able to create keys when templates are enrolled
Test: No regression in Fingerprint
      Keys are invalidated after enrolling another FP

Change-Id: I6bdc20eb58c8a0c10a986519d4ba9e1843ebc89d
2018-11-02 18:09:25 -07:00
Dmitry Dementyev
2dfc3ae608 Clean-up removed RecoveryController API
Bug: 79604447
Test: N/A
Change-Id: If12654aa46ba3a9d018eb68c4d0bec591a22bbb9
2018-10-09 16:19:26 -07:00
Adam Vartanian
86b381be69 Merge "Inline two short methods from Conscrypt" am: 9da9b33cc2 am: 91d61ea0ed
am: 8879ee4a78

Change-Id: Iffbb91414c16b055fc3358e83fb5c23ef4998816
2018-09-25 02:33:46 -07:00
Adam Vartanian
54148c0e57 Inline two short methods from Conscrypt
We're trying to reduce unnecessary direct dependencies on Conscrypt.
These two methods are simple and the implementations can't change, so
they're good candidates for inlining directly instead of depending on
the Conscrypt implementation.

Bug: 110404540
Test: atest NetworkSecurityConfigTests (same failures pre/post)
Change-Id: I303d955e3f49885326fe75f451c06a52af745053
2018-09-24 15:34:13 +01:00
Mathew Inwood
4dbdcf43ad Add @UnsupportedAppUsage annotations
For packages:
  android.security.net.config
  android.security.keystore
  android.security.keymaster
  android.security

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: Ifed4da56531195f64fd53d84f14b4e8298843b2c
Merged-In: I7762dd647bede8abc9be2c538af3a3a99a25a73e
2018-08-16 18:49:37 +01:00
Mathew Inwood
e420f8b5fb Add @UnsupportedAppUsage annotations
For packages:
  android.security.net.config
  android.security.keystore
  android.security.keymaster
  android.security

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I7762dd647bede8abc9be2c538af3a3a99a25a73e
2018-08-16 18:40:47 +01:00
Chad Brubaker
11ecd58309 Deprecate targetSandboxVersion=2
Most of the targetSandboxVersion=2 protections have moved to target O
MR1 or P, or were reverted, so move the remaining checks to isInstantApp
and remove the requirement for Instant Apps to target
targetSandboxVersion=2

Change-Id: I448a7565e26d4eafece1bdc657192117d790ff3a
Fixes: 111314398
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/EphemeralTest.java
2018-08-02 15:55:34 -07:00
Bo Zhu
f7e7b1d375 Merge "Revert "Revert "Change the root of trust for CryptAuth Vault Service""" into pi-dev am: 90dbb0ed72
am: 542dbb9734

Change-Id: I953c5cf4f2475dc0d371e4b3fb3f9ad7520c60ad
2018-05-11 10:08:47 -07:00
Bo Zhu
bd7879ce3e Revert "Revert "Change the root of trust for CryptAuth Vault Service""
This reverts commit be4f735cb1.

Reason for revert: Resubmit the CL http://ag/3983388 that was reverted. The server side change has been deployed now.

Bug: 78920513
Change-Id: If676799176ecf90fd51a97027a9ff83bec5d4bed
2018-05-11 05:11:11 +00:00
Bo Zhu
ad3c9066ef Merge "Revert "Change the root of trust for CryptAuth Vault Service"" into pi-dev am: 3b0f011709
am: 4fabef2d66

Change-Id: Ibbdf78fa96c748145775c9a4f556eaf739924426
2018-05-10 09:21:18 -07:00
Bo Zhu
be4f735cb1 Revert "Change the root of trust for CryptAuth Vault Service"
This reverts commit 1f40978609.

Reason for revert: Will resubmit once the server side change is ready

Bug: 79513473
Bug: 78920513
Change-Id: I4c94d307a9181390a59cdc1602cc9d04c1661ad0
2018-05-10 15:53:08 +00:00
android-build-team Robot
276d60a873 Merge "Change the root of trust for CryptAuth Vault Service" into pi-dev am: 738b0a8b42
am: 665c7c7b73

Change-Id: Ie41bfd20283226e769b592cab48955544b8a6426
2018-05-09 11:57:25 -07:00
Bo Zhu
1f40978609 Change the root of trust for CryptAuth Vault Service
Change-Id: I99899e7e6c090cf22cf31b0b4d5fd3e33dcb2f8f
Bug: 78920513
Test: adb shell am instrument -w -e package
com.android.server.locksettings.recoverablekeystore
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
2018-05-08 16:33:49 -07:00
Chad Brubaker
8bfbc6e710 Add nsconfig support for WFA CAs
Bug: 78643773
Test: manually verified
Change-Id: Ib7d2b24669074b74bbda7ab7163ef25584e95a11
2018-04-26 19:33:06 +00:00
Dmitry Dementyev
745d2c98f9 Remove implementation of deprecated RecoveryController methods.
Bug: 78021839
Test: manual
Change-Id: I8a8a23f1cc14e7b9ffe1e758b6f35906d1a5cf2f
2018-04-14 13:37:07 -07:00
Jeff Sharkey
3990ee1c9f Clean up APIs before declaring API 28.
As part of finalizing an SDK, we need to ensure that no new APIs are
marked @Deprecated, since they're typically cleanup that someone
forgot to finish.

Someone forgot to replace Slice.getTimestamp() with Slice.getLong().

Bug: 77588754
Test: builds, boots
Exempt-From-Owner-Approval: SDK finalization
Change-Id: Ic0ec91a43d161a69c1e840c42046ad500b7aeca0
2018-04-11 13:49:21 -06:00
Bo Zhu
b95c90ce2d Add an API to check whether the recoverable keystore is enabled
Bug: 77690455
Test: It builds
Change-Id: I94be0e341d8a3e0fa9a5f9af8beda60e08a449e8
2018-04-10 14:50:21 -07:00
TreeHugger Robot
4147a83ae5 Merge "Revert "Remove deprecated RecoveryController API."" into pi-dev 2018-04-06 12:28:09 +00:00
Robert Berry
c157e21249 Revert "Remove deprecated RecoveryController API."
This reverts commit 0d55aa387a.

Reason for revert: aps_sidecar binary is still using some of these @removed APIs. Although HEAD of auth_folsom is fixed, aps_sidecar burned in framework is old.

Bug: 77629807
Change-Id: I2f03c7d12de30cc2eebd91bb65646caaa00fcd1d
2018-04-06 10:30:44 +00:00
TreeHugger Robot
ae938f5437 Merge "ConfirmationPrompt: Update for API review." into pi-dev 2018-04-05 18:50:35 +00:00
Dmitry Dementyev
654598b542 Merge "Remove deprecated recoverable keystore classes." into pi-dev 2018-04-04 17:42:11 +00:00
Dmitry Dementyev
ce70473a89 Merge "Remove deprecated RecoveryController API." into pi-dev 2018-04-04 17:41:51 +00:00
David Zeuthen
1870e2dec4 ConfirmationPrompt: Update for API review.
Misc. changes but notably the ConfirmationDialog class was renamed to
ConfirmationPrompt.

Manually tested by updating sample Android Confirmations application
to use updated API.

Bug: 77242268
Test: Manually tested.
Change-Id: I1caa3c6bff9486b43ba111329d1ef83c3b67baf9
2018-04-04 10:00:42 -04:00
Aseem Kumar
23174b7eae Throw ServiceSpecificException if calling app tries to initialize
certificates with lower version. Earlier, the code just returned
silently, giving no indication that updating certs failed.

Change-Id: I3eb1b9f423791a655b47b3e76c20a170e2b632c0
Bug: 77533356
Test: runtest frameworks-services -p
    com.android.server.locksettings.recoverablekeystore
2018-04-03 12:15:11 -07:00
Dmitry Dementyev
80def87389 Remove deprecated recoverable keystore classes.
RecoveryController and related Parcelables were moved to a different package long time ago. Only very old recvoery controller implementations used it.

Bug: 74944591
Test: atest RecoveryControllerHostTest
Change-Id: I803b7d8a813f7e6c3606dc77afb2e0a3d916ec3f
2018-04-02 18:57:37 -07:00
TreeHugger Robot
41d6d7c424 Merge "Revert "Throw invalid cert exception when deprecated initRecoveryService method"" into pi-dev 2018-04-03 01:55:30 +00:00
Dmitry Dementyev
0d55aa387a Remove deprecated RecoveryController API.
1) Mark all deprecated methods as removed.

Bug: 74944591
Test: atest RecoveryControllerHostTest
Change-Id: I2dd88d2ba0b9fb254327ee85b9d983ab10eb061b
2018-04-02 18:35:08 -07:00
Bo Zhu
1364455fd7 Merge "Expose the JNI scrypt function in a standalone Java class so we can use it in RecoverableKeyStore as well" into pi-dev 2018-04-03 00:28:43 +00:00
Dmitry Dementyev
0f23660488 Revert "Throw invalid cert exception when deprecated initRecoveryService method"
This reverts commit 50bc7e42d7.

Reason for revert: API is still used by old binary

Change-Id: I3c8348211baa26245786abda6360a8df96e2d223
Bug: 77293264
2018-04-03 00:19:27 +00:00
Bo Zhu
09856135e3 Expose the JNI scrypt function in a standalone Java class so we can
use it in RecoverableKeyStore as well

Bug: 77325751
Test: It builds. No caller code yet.

Change-Id: I6ff847cff2efbd023612e51fe35be980f27f162d
2018-04-02 15:47:08 -07:00
Dmitry Dementyev
bf08774704 Merge "Throw invalid cert exception when deprecated initRecoveryService method is used." into pi-dev 2018-04-01 19:34:31 +00:00
Bo Zhu
0b8c82e660 Throw an exception if the given root alias is unknown
Bug: 76433465
Test: runtest frameworks-services -p
com.android.server.locksettings.recoverablekeystore

Change-Id: I3a213ab0cd3b0e9c002bc44d4ce929977e119e81
2018-03-31 21:35:28 -07:00
Dmitry Dementyev
50bc7e42d7 Throw invalid cert exception when deprecated initRecoveryService method
is used.

Throw unsupported operation exception when older version of RecoveryController is used.

Bug: 77293264
Test: atest RecoveryControllerHostTest
Change-Id: I0003104a4305444fac0092f4f6929545cf7c9413
2018-03-31 00:49:23 -07:00
Bo Zhu
41d2dd2f26 Expose e.getMessage() from the exceptions in RecoverableKeyStore
Bug: 77327780
Test: runtest frameworks-services -p \
      com.android.server.locksettings.recoverablekeystore

Change-Id: Ibf04d6405e6468bfdfef0a8cb8e6e96bffbbf3a2
2018-03-30 13:14:29 -07:00
Dmitry Dementyev
912853be10 Merge "Remove deprecated generateAndStoreKey method implementation" into pi-dev 2018-03-30 16:44:53 +00:00
Brian Young
0186b42f2a Merge changes from topics "niap-asym-write-pi-dev", "niap-asym-write-api-pi-dev" into pi-dev
* changes:
  Restore "Add "Unlocked device required" parameter to keys"
  Add "Unlocked device required" key API
2018-03-30 14:21:19 +00:00
Robert Berry
d490937854 Merge "Update RecoveryController JavaDoc" into pi-dev 2018-03-30 10:37:41 +00:00
Robert Berry
93f38d7b3a Update RecoveryController JavaDoc
Try to encode as many requirements as possible into the Recovery Agent
JavaDoc.

Bug: 70900575
Test: None, it is documentation
Change-Id: Iae05be24fa29d885f560943f256fd8d7ca692cf7
2018-03-30 11:35:06 +01:00
Dmitry Dementyev
86f5bb1a8c Remove deprecated generateAndStoreKey method implementation
Bug: 77156834
Test: GTS, apct.
Change-Id: I23791fced21308467afc60cc16efc4aee7074134
2018-03-30 05:58:11 +00:00
Bo Zhu
3cda0f2989 Merge "Minor correction to the javadoc to match implementation" into pi-dev 2018-03-30 00:04:46 +00:00
Bo Zhu
ba94b9ab00 Minor correction to the javadoc to match implementation
Change the number of bytes for the length prefix for salted hash to be
4-byte instead of 1-byte

Bug: 77294103
Test: None
Change-Id: Ifa2739c757539e9b7d2aaa1ea702de0148a311ba
2018-03-29 16:42:29 -07:00
Dmitry Dementyev
57ca3da24f Add support for testing mode root certificate.
1) Add Certificate
2) Helper class for end-to-end tests
3) Only create snapshot for passwords with special prefix in test mode
4) Sync only keys with insecure prefix in test mode.

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

Change-Id: I6edc8c4716c3a034b6b79c7aa6f4b8478e9a3c9e
2018-03-29 14:18:42 -07:00
Robert Berry
52c15f1699 Add warning comment about serialization
As it's important we do not break serialization of KeyChainSnapshot
(as it could fail in weird and mysterious ways if we did), add
comments warning anybody editing those files to also update the
serializer and deserializer, as well as appropriate tests.

Test: none, just adding comments
Bug: 73921897
Change-Id: If73162b8fb2a0b44fd954b72c9030cd9e042282b
2018-03-29 10:21:50 +01:00
Brian Young
36716eb470 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

Merged-In: Iccd7dafd77258d903d11353e02ba3ab956050c40
Change-Id: Iccd7dafd77258d903d11353e02ba3ab956050c40
(cherry picked from commit fd75c7232a)
2018-03-28 08:38:56 -07:00
Dmitry Dementyev
16d9db57f5 Use Builder instead for KeyChainProtectionParams.
Use Builder to create KeyChainSnapshot it tests.
Bug: 75952916
Test: apct
Change-Id: I5ab8c864a7ccc55dafa40867ec4364a705738d86
2018-03-26 12:03:51 -07:00
Dmitry Dementyev
a5b29ffffe Merge "Remove unimplemented RecoverableKeystoreManager APIs." into pi-dev 2018-03-26 02:18:33 +00:00