Commit Graph

805 Commits

Author SHA1 Message Date
Janis Danisevskis
a6dcf091f5 Keystore 2.0: Remove Keystore 1.0 SPI with all remaining references
Bug: 171305684
Test: CtsKeystoreTestCases
Change-Id: I337515dadc9e45b909bff058d4e13371b4fa843c
2021-04-01 17:06:41 -07:00
Steven Moreland
5fdf93fc9d Merge "Keystore 2.0: Update to canonical service name." 2021-03-29 17:02:31 +00:00
Max Bires
e7f48b9926 Merge "Adding AIDL and functions for talking to RemoteProvisioner" 2021-03-25 00:03:09 +00:00
Janis Danisevskis
11c25156a2 Merge "Keystore 2.0: Disable BackendBusyException." 2021-03-24 19:02:46 +00:00
Janis Danisevskis
e36f515441 Merge "Keystore 2.0: Add onDeviceOffBody to AndroidKeyStoreMaintenance." 2021-03-24 18:32:35 +00:00
Janis Danisevskis
5d1c590723 Keystore 2.0: Disable BackendBusyException.
This disables throwing BackendBusyException in Android S. Instead we
keep the legacy behavior of spinning until an operation can be created.

Bug: 180133780
Test: N/A
Change-Id: I802148c59338b91e751498607fa903e156e40aa6
2021-03-24 09:22:56 -07:00
Max Bires
7fd458dc44 Adding AIDL and functions for talking to RemoteProvisioner
This change adds an AIDL interface which the RemoteProvisioner app
implements that allows the keystore SPI to inform the app when an
attestation key may have been used, and when the underlying attestation
key pool is totally empty. The former is a non-blocking call, and the
latter blocks until completion.

Since the latter involves network, there are timeouts involved on the
app side to ensure that the blocking call doesn't hang indefinitely if
there's no network.

Test: atest CtsKeystoreTestCases && atest RemoteProvisionerUnitTests

Change-Id: Ie49e37659c96ce5c1626d1b99a4a7ccc62028156
2021-03-24 01:13:10 -07:00
Janis Danisevskis
fd5cba4483 Keystore 2.0: Add onDeviceOffBody to AndroidKeyStoreMaintenance.
Also have KeyStore.onDeviceOffBody call
AndroidKeyStoreMaintenance.onDeviceOffBody.

Test: N/A
Bug: 171305684
Change-Id: I0b01764bfc4c5828d17ccfffb4f8dad5f3bcea6d
2021-03-23 19:18:55 -07:00
Janis Danisevskis
68570cc5a7 Keystore 2.0: Add @IntDef for Keystore namespaces.
Bug: 182914789
Test: N/A
Change-Id: Ibdfd2a4a37d7200317ef449ef857f34401625237
2021-03-22 17:43:32 -07:00
Janis Danisevskis
f3064ba0b3 Keystore 2.0: Update to canonical service name.
Bug: 179907868
Test: N/A
Change-Id: I74adab04bd84f120bc547011151ea77769b6bda9
2021-03-22 14:57:28 -07:00
Janis Danisevskis
8875f872de Keystore: Fix Device ID attestation test.
Test: atest android.keystore.cts.KeyAttestationTest#testDeviceIdAttestation
Bug: 182606921
Change-Id: Ie8dbc4a2829fb7f70188c5d903e748060c5869ce
2021-03-20 21:29:21 -07:00
Janis Danisevskis
8758b2ceaf Keystore 2.0: Fix infinit recursion.
Fix endless recursion when Cipher is initialized with
AndroidKeyStorePrivateKey.

Fixes: 183167349
Test: atest android.keystore.cts.AndroidKeyStoreTest#testKeyStore_Encrypting_RSA_NONE_NOPADDING
Change-Id: I5b4166fb1a4e298072f7156ba61a64966e86dc53
2021-03-19 08:09:34 +00:00
Treehugger Robot
be1b1d5550 Merge "Keystore 2.0: Fix diagnosing invalid key in CipherSpiBase." 2021-03-18 23:46:37 +00:00
Janis Danisevskis
0b66a19bdd Keystore 2.0: No longer install the legacy provider.
The legacy provider is obsolete now that all calling code has
been fixed.

Bug: 183100147
Bug: 183093711
Bug: 171305684
Test: N/A
Merged-In: I0d71d3c9cdd586a508827eb26120c872cb8643ea
Change-Id: I0d71d3c9cdd586a508827eb26120c872cb8643ea
2021-03-18 20:24:39 +00:00
Janis Danisevskis
0b858aef63 Keystore 2.0: Fix diagnosing invalid key in CipherSpiBase.
Bug: 183101158
Test: atest CtsLibcoreTestCases:com.android.org.conscrypt.javax.crypto.CipherBasicsTest#testAeadEncryption

Merged-In: Idc9c7dc2614a47818227a06fe76078f72c0c1f57
Change-Id: Idc9c7dc2614a47818227a06fe76078f72c0c1f57
2021-03-18 19:41:56 +00:00
Janis Danisevskis
53ed9207a7 Keystore 2.0: Remove hidden Keystore API from locksettings tests.
Test: N/A
Bug: 171305684
Change-Id: I6fd90c29dd1fb077c25f1bd428fb8adf9782330e
2021-03-15 18:33:46 -07:00
Hasini Gunasinghe
e92adf724b Keystore2: Integrate getState method of IKeystoreMaintenance AIDL.
Bug: 176123105
Test: TBD
Change-Id: I8bc6bf219f7c4bb3722c310debcc8a276d14ed98
2021-03-12 00:07:44 +00:00
Treehugger Robot
721f75ec5a Merge "Keystore 2.0: Rename KeystoreUserManagement KeystoreMaintenance" 2021-03-11 11:20:11 +00:00
Janis Danisevskis
7a46c3c1fd Merge "Modify AttestationUtils to use public Keystore API" 2021-03-11 06:47:41 +00:00
Janis Danisevskis
274a93e953 Keystore 2.0: Fix TODOs in public doc comments.
Bug: 174580379
Test: N/A
Change-Id: If893c408156b2481a22730de22f1a7ba391d88eb
2021-03-10 11:22:22 -08:00
Janis Danisevskis
7160506468 Keystore 2.0: Rename KeystoreUserManagement KeystoreMaintenance
Test: N/A
Change-Id: I252f75fc6d918029ef682c20edb3fb667ebaf8db
2021-03-08 09:27:41 -08:00
Shawn Willden
0306b1ced8 Modify AttestationUtils to use public Keystore API
AttestationUtils calls directly into keystore1 to generate ID
attesations.  This needs to change prior to keystore2 being enabled
and keystore1 deleted.  This CL changes the AttestationUtils to use
the public API (and one SystemAPI method) to generate ID attestations,
allowing the lower layers to handle the transition between keystore1
and keystore2.

Test: CtsKeystoreTestCases
Change-Id: I64a230b9983cc90767a60d6e7cf2abcf5dfb0108
2021-03-08 09:52:33 -07:00
Treehugger Robot
492ab3dd2c Merge "Keystore 2.0: Silence common error on operation abort." 2021-03-08 14:10:27 +00:00
Janis Danisevskis
421c5739ea Merge "Keystore 2.0: Make VPN Keystore 2.0 ready." 2021-03-05 02:57:34 +00:00
Janis Danisevskis
051d7668f7 Keystore 2.0: Silence common error on operation abort.
Test: N/A
Change-Id: I7c85ae881165bc77d836624bfe20251b971d4479
2021-03-04 15:48:12 -08:00
Shawn Willden
c7de4a237a Fix subject in self-signed certificates.
Bug: 180620122
Test: atest -c CtsKeystoreTestCases:android.keystore.cts.KeyPairGeneratorTest#testGenerate_EC_ModernSpec_Defaults
Change-Id: Ib74a3f0cea81faf741d49d868739cbedda77e8df
2021-03-04 12:21:17 -07:00
Janis Danisevskis
8cd7953577 Keystore 2.0: Make VPN Keystore 2.0 ready.
* Use public stable API to load certificates from keystore.
* Also use grants to allow racoon to use keystore keys without
  special exceptions in keystore.
* Use LegacyProfileStore instead of Keystore for storing VPN profiles.

Bug: 175068876
Bug: 171305607
Test: atest android.net.cts.Ikev2VpnTest
      atest android.net.cts.IpSecManagerTest
      atest com.android.server.connectivity.VpnTest
      atest com.android.server.ConnectivityServiceTest
Merged-In: I27975113896ea137260a9f94a34fb1c3ca173fe3
Change-Id: I27975113896ea137260a9f94a34fb1c3ca173fe3
2021-03-03 22:14:41 -08:00
Dmitry Dementyev
dbf8a7c1bd Merge "Migrate recoverablekeystore to KeyStore V2." 2021-02-26 06:13:35 +00:00
Janis Danisevskis
a51a74a8c5 Merge "Keystore 2.0: Clear Uid/Namesapce" 2021-02-26 03:04:30 +00:00
Dmitry Dementyev
16491e1316 Migrate recoverablekeystore to KeyStore V2.
Test: manual
Bug: 171305545
Change-Id: Id415be48cab6852df155b5b2dbaf941ef54cd5a4
2021-02-25 16:42:15 -08:00
Janis Danisevskis
d5dd5ebaed Keystore 2.0: Clear Uid/Namesapce
Implement uid/namespace clearing for Keystore 2.0.

Test: Verified that keys get deleted when an app gets uninstalled.
Change-Id: I1b0b65e977177a6e34c500b00b5070ec18be2671
2021-02-25 09:30:44 -08:00
Janis Danisevskis
7e06904734 Keystore 2.0: Add keystore engine grant string convenience functions.
This patch adds function for and end decoding grant identfiers as
understood by the keystore boringssl engine.

Test: N/A
Change-Id: I619d8f460163e6270e41da81ca549efb71138113
2021-02-23 14:42:13 -08:00
Janis Danisevskis
0cdf262ee5 Keystore 2.0: Remove attestKey from KeyChain.
KeyChain supports device id attestation through KeyGenParameterSpec now.
No need to call attest key individually. Also calling attest key
individually is no longer supported by Keystore 2.0 and KeyMint.

Also isBoundKeyAlgorithm returns true.

Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Bug: 171305387
Merged-In: I759fe245b48fe435153fded2c74c9ae99634c146
Change-Id: I759fe245b48fe435153fded2c74c9ae99634c146
2021-02-23 14:41:49 -08:00
Treehugger Robot
75025c5b62 Merge "Keystore 2.0: Fix correct handling of Uid/Namespace" 2021-02-22 23:35:21 +00:00
Janis Danisevskis
fa1a21957c Keystore 2.0: Fix correct handling of Uid/Namespace
AndroidKeyStoreKeyPairGeneratorSpi used the Uid as namespace which is
wrong, and ParcelableKeyGenParameterSpec inadvertently used the Uid as
namespace specifier during conversion.

Bug: 160623310
Test: com.android.keychain.tests.BasicKeyChainServiceTest#testGenerateKeyPairErrorsOnBadUid
Change-Id: I84b4c69c639e42922449e00a3708cef89b82f63e
2021-02-22 12:55:35 -08:00
Treehugger Robot
08bf2e8f49 Merge "Keystore 2.0: Revisite Authorization.java" 2021-02-20 19:26:58 +00:00
Hasini Gunasinghe
13dd61336f Integrate IKeystoreUserManager aidl with LockSettingsService.
This CL introduces the client side for IKeystoreUserManager aidl and
integrates it with the LockSettingsService.

Bug: 171305115
Test: TBD
Change-Id: I7560e98f95aaec6b85cdcfc01ba83aea0ccc52ae
2021-02-19 15:34:10 -08:00
Janis Danisevskis
377370cce8 Keystore 2.0: Revisite Authorization.java
Test: N/A
Change-Id: I4da26175741c5313aec17d30a3e534a2172d87b4
2021-02-19 15:31:15 -08:00
Shawn Willden
bffded442a Add support for app-generated attestation keys.
This allows apps to request that AndroidKeyStore generate attestation
keys that can be used to sign attestations of other keys that the app
generates or imports.

Bug: 163606833
Test: atest CtsKeystoreTests
Change-Id: I943a6922271cbe909cb3a9d67021663b5646aa70
2021-02-17 06:46:13 -07:00
Bram Bonné
6d3bd2dca6 Merge "Expand documentation for PURPOSE_AGREE_KEY" 2021-02-16 17:05:00 +00:00
Treehugger Robot
353a2c4fde Merge "Centralise logic for setting credential manager app" 2021-02-15 11:24:06 +00:00
Bram Bonné
92ad4e1bd5 Expand documentation for PURPOSE_AGREE_KEY
Bug: 180015526
Test: mmma -j .
Change-Id: Ie3847ff68c21588c4caed450f00006919f5d2769
2021-02-15 11:15:45 +01:00
Rubin Xu
944e30cf6c Merge "Add DPM.getKeyPairGrants()" 2021-02-14 22:22:47 +00:00
Treehugger Robot
acc78ee8eb Merge "Add KeyChain.createManageCredentialsIntent" 2021-02-14 21:28:40 +00:00
Rubin Xu
72ff9029c6 Add KeyChain.createManageCredentialsIntent
Missed from previous cherry-pick.

Test: make -j docs
Bug: 179180345
Merged-In: I1e57ed9c18a1ada463c55dbf17ce30e31aa7bad2
Change-Id: I1d88e11740a13490613962c944b528e6c2bd0fcb
2021-02-14 18:32:02 +00:00
Rubin Xu
e02debebcf Merge "Add KeyChainService credential management app APIs" 2021-02-14 17:06:48 +00:00
Rubin Xu
7ce00e0a16 Centralise logic for setting credential manager app
Bug: 179180345
Test: atest KeyChainTests
Test: m RunKeyChainRoboTests
Change-Id: I4290bccf5ae04de0d84c7091729e86704b937295
Merged-In: I4290bccf5ae04de0d84c7091729e86704b937295
2021-02-12 21:35:33 +00:00
Rubin Xu
ac5ee32091 Add DPM.getKeyPairGrants()
(Trimmed down version)

Bug: 179180345
Test: atest
com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testKeyManagement
Test: atest
com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegatedCertInstallerDirectly
Test: atest android.admin.cts.DevicePolicyManagerTest
Change-Id: Ieee1048b145fb8400eccbf32c054afc64b5d90c0
Merged-In: Ieee1048b145fb8400eccbf32c054afc64b5d90c0

Change-Id: Id1ab42ddbf04a3f6874ba5ce7eb937114d2194ef
2021-02-12 21:35:33 +00:00
Rubin Xu
0aa18af47d Add KeyChainService credential management app APIs
(Trimmed down version)

Bug: 179180345
Test: Manual Testing
      atest com.android.keychain.KeyChainServiceRoboTest

Change-Id: I00b7df27a92f6ee4f74546f892c83290fead1112
Merged-In: I00b7df27a92f6ee4f74546f892c83290fead1112
2021-02-12 21:35:33 +00:00
Janis Danisevskis
3faed136d5 Merge "Adding device ID attestation to KeyGenParameterSpec" 2021-02-11 20:03:01 +00:00