1041 Commits

Author SHA1 Message Date
TreeHugger Robot
7f85119309 Merge "Keystore 2.0 SPI: Add EC_CURVE tag on key generation." into sc-dev am: 214d129500
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15225383

Change-Id: I8a65bc5a7724830ecb5a0df28c35c4f1fa806a0d
2021-07-08 16:32:51 +00:00
Janis Danisevskis
5a3c880534 Keystore 2.0 SPI: Add EC_CURVE tag on key generation.
The KeyMint spec requires the specification of the EC_CURVE tag when
generating an EC key. This patch adds the correct curve tag parameter to
the parameter list.

Test: CtsVerifier Protected confirmation test.
Bug: 192908276
Change-Id: I2e7dd4868abda85d244e73592ff12d688f5c21fc
2021-07-08 08:48:46 -07:00
Max Bires
40f4b669c1 Merge "Fixing the race condition in GenerateRkpKey" am: 5023e1fb96 am: 7fc084200f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1736160

Change-Id: I274163d45ee758a5a520c78dd82d0babba9a7d1d
2021-07-01 14:57:34 +00:00
Max Bires
5023e1fb96 Merge "Fixing the race condition in GenerateRkpKey" 2021-07-01 14:20:37 +00:00
Janis Danisevskis
84e082d3da Keystore 2.0: Renaming the vpnstore interface.
Renaming the vpnstore interface to legacykeystore.

Bug: 190229655
Test: TBD
Merged-In: Icd304ef621f0de52d6ebc415a0628d63f827fbcd
Change-Id: Icd304ef621f0de52d6ebc415a0628d63f827fbcd
2021-06-30 12:29:29 -07:00
Janis Danisevskis
191b206410 Keystore 2.0: Renaming the vpnstore interface.
Renaming the vpnstore interface to legacykeystore.

Bug: 191373871
Test: TBD
Change-Id: Icd304ef621f0de52d6ebc415a0628d63f827fbcd
2021-06-30 09:45:54 -07:00
Victor Chang
49a5bb208c Update the java doc of AndroidKeyStoreProvider#getKeyStoreOperationHandle to support Signature object
Bug: 191661889
Test: m droid
Merged-In: Ie65dcfe96f3bb00cc9af4d49e4e1d1f57bde438a
Change-Id: Ie65dcfe96f3bb00cc9af4d49e4e1d1f57bde438a
(cherry picked from commit 507a653a6e35fd3bf5b9a5927e4c17307593bcae)
2021-06-21 17:38:21 +01:00
Victor Chang
507a653a6e Update the java doc of AndroidKeyStoreProvider#getKeyStoreOperationHandle to support Signature object
Test: m droid
Change-Id: Ie65dcfe96f3bb00cc9af4d49e4e1d1f57bde438a
2021-06-16 15:57:44 +01:00
Max Bires
5e43390b9b Fixing the race condition in GenerateRkpKey
This file was written on the assumption that bindService was
synchronous, which it isn't. This change adds a CountDownLatch to force
the class to wait for the binding to finish. If the relevant key
generation service is not present on the system, then this
functionality will just silently be skipped over.

Bug: 190222116
Test: atest RemoteProvisionerUnitTests
Change-Id: Ie34997a08aa743642c66a20c4b756cd47bff4af1
Merged-In: Ie34997a08aa743642c66a20c4b756cd47bff4af1
2021-06-13 21:50:36 +00:00
Max Bires
17f9f3e8b5 Merge "Revert "Fixing the race condition in GenerateRkpKey"" 2021-06-09 20:35:23 +00:00
Max Bires
b2a11d35e5 Revert "Fixing the race condition in GenerateRkpKey"
This reverts commit 0f62195535139026d35e831ccf329f8204781430.

Reason for revert: Breaks non-RKP systems

Bug: 190222116
Change-Id: I7e31a3045caa7b8bb0e34c8d1e266c104a627324
Merged-In: I7e31a3045caa7b8bb0e34c8d1e266c104a627324
2021-06-09 20:21:41 +00:00
Max Bires
8092f01ce1 Merge "Revert "Fixing the race condition in GenerateRkpKey"" into sc-dev 2021-06-09 20:21:15 +00:00
Max Bires
56318a568f Revert "Fixing the race condition in GenerateRkpKey"
This reverts commit d05498b9d8d30ca69eaafe920c5915ee472058eb.

Reason for revert: Bugged on non-RKP systems.

Bug: 190222116
Change-Id: Ie7d17d4251c381c1bae6a76cd9b0246c551f8042
2021-06-09 19:54:48 +00:00
Max Bires
d1de4cc6e4 Merge "Fixing the race condition in GenerateRkpKey" 2021-06-09 17:48:32 +00:00
TreeHugger Robot
825d39e0f1 Merge "Fixing the race condition in GenerateRkpKey" into sc-dev 2021-06-08 20:28:28 +00:00
Max Bires
d05498b9d8 Fixing the race condition in GenerateRkpKey
This file was written on the assumption that bindService was
synchronous, which it isn't. This change adds a CountDownLatch to force
the class to wait for the binding to finish.

Bug: 190222116
Test: atest RemoteProvisionerUnitTests
Change-Id: I917a61da612f21f9a0f783bea5d24270d4e1db42
2021-06-08 20:28:06 +00:00
Seth Moore
d57dabcc94 Check for invalid device attestation parameters
Previous releases explicitly check for invalid inputs. These checks
were removed with the move to keystore2 -- add them back.

Remove old prepareAttestationArguments* methods, as they are no
longer referenced.

Bug: 188741672
Test: com.google.android.gts.security.DeviceIdAttestationHostTest
Change-Id: I4eeec8367ebdfad527395206ab9e89b409e02631
Merged-In: I4eeec8367ebdfad527395206ab9e89b409e02631
2021-06-08 12:40:38 -07:00
Seth Moore
c0133d7c47 Check for invalid device attestation parameters
Previous releases explicitly check for invalid inputs. These checks
were removed with the move to keystore2 -- add them back.

Remove old prepareAttestationArguments* methods, as they are no
longer referenced.

Fixes: 188741672
Test: com.google.android.gts.security.DeviceIdAttestationHostTest
Change-Id: I4eeec8367ebdfad527395206ab9e89b409e02631
2021-06-07 16:44:06 -07:00
Max Bires
0f62195535 Fixing the race condition in GenerateRkpKey
This file was written on the assumption that bindService was
synchronous, which it isn't. This change adds a CountDownLatch to force
the class to wait for the binding to finish.

Bug: 190222116
Test: atest RemoteProvisionerUnitTests
Change-Id: I917a61da612f21f9a0f783bea5d24270d4e1db42
Merged-In: I917a61da612f21f9a0f783bea5d24270d4e1db42
2021-06-07 18:30:51 +00:00
Joshua Duong
d10df9336a Merge "Use keymasterSwEnforcedUserAuthenticators if keymasterHwEnforcedUserAuthenticators is zero." am: 3b2decbb34 am: bc9360ea4e am: 791f088436
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1705645

Change-Id: Ieea062bd379150daf14406376e2e26b9499832fe
2021-05-13 20:57:24 +00:00
Joshua Duong
3b2decbb34 Merge "Use keymasterSwEnforcedUserAuthenticators if keymasterHwEnforcedUserAuthenticators is zero." 2021-05-13 20:16:08 +00:00
Treehugger Robot
29d875d690 Merge changes If663677b,I387d90ea am: ea4a93a946 am: da769ac79d am: 574db828e3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1706425

Change-Id: I261fe4c6a0d926486052fdd2a812f709c419f78f
2021-05-13 15:23:50 +00:00
Treehugger Robot
ea4a93a946 Merge changes If663677b,I387d90ea
* changes:
  Fixed KeyGenParameterSpecTest
  Keystore 2.0 SPI: Fix NPE in getUniqueAliases.
2021-05-13 14:20:44 +00:00
Treehugger Robot
5ac4488fec Merge "Keystore 2.0 SPI: Silence warning about blocking calls to Keystore." am: fa8d51d5a6 am: ad73e362f0 am: 41d04381e9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1706447

Change-Id: I3247db1b8db8691705a3a7856d696a84f0fd1413
2021-05-13 03:00:40 +00:00
Janis Danisevskis
bebe5b7c52 Fixed KeyGenParameterSpecTest
Test: atest KeystoreTests
Change-Id: If663677b01738025dca01bf209b634c1d04c6be4
2021-05-12 17:29:26 -07:00
Janis Danisevskis
738e422b00 Keystore 2.0 SPI: Fix NPE in getUniqueAliases.
getUniqueAliases may return a null if an error occurred. This would lead
to a NPE in engineAliases.

This patch makes getUniqueAliases return an empty HashSet instead.

Test: atest KeystoreTests

Change-Id: I387d90ea851a8b9c18bb2b20d1a0bfc1ab76c99f
2021-05-12 17:29:26 -07:00
Janis Danisevskis
04d5622233 Keystore 2.0 SPI: Silence warning about blocking calls to Keystore.
Test: N/A
Bug: 184108046
Change-Id: I7401b88e5055cb781113656021f3ec274d1951a4
2021-05-12 16:53:14 -07:00
Joshua Duong
299345bb8e Use keymasterSwEnforcedUserAuthenticators if keymasterHwEnforcedUserAuthenticators is zero.
Bug: 186562600

Test: atest android.appsecurity.cts.AuthBoundKeyTest#useInvalidatedAuthBoundKey
Change-Id: I52a9c04b3e000416fb141d90d8d1f034348499de
2021-05-12 08:30:05 -07:00
Seth Moore
7ac158fda8 Merge "Don't re-wrap DeviceIdAttestationExceptions" am: 27bc799e7e am: 02359c00d6 am: 85d779c4a4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1698089

Change-Id: I9aefcc9b3b93a37437885d7e6fb1a8d9734b3dd1
2021-05-07 03:37:24 +00:00
Seth Moore
c73fe01f16 Don't re-wrap DeviceIdAttestationExceptions
Instead of always wrapping errors in a DeviceIdAttestationException,
check to see if the underlying cause was originally a
DeviceIdAttestationException. If so, unwrap the cause and just re-throw
that, preserving the original error.

Bug: 183827468
Test: GtsGmsCoreSecurityTestApp
Change-Id: Iab78ccaff91dd1de615e1d2b18f709027aecd59e
2021-05-05 17:41:38 -07:00
Paul Crowley
0809d53d07 Merge changes from topic "biometric-unlocked-required" am: c36995ec84 am: cf5f4d6cbf am: 9c975f2335
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1671106

Change-Id: I2c7e8050ca82f81ca865a76bd11a39d82eb09dcc
2021-04-28 20:26:08 +00:00
Paul Crowley
336b5db809 Tell keystore which SIDs can unlock this user
If biometric unlock is enabled, we tell keystore at lock time so that
a key can be set up in KM which unlocks UNLOCKED_DEVICE_REQUIRED keys
based on auth tokens carrying those SIDs. This also has the effect that
if there is no biometric unlock, UNLOCKED_DEVICE_REQUIRED keys have
full cryptographic protection, per NIAP requirements.

Test: aosp/1686345
Bug: 163866361
Change-Id: Ia4d01faa998c76b2b33ad3520730466ac59e6d8d
2021-04-27 10:34:33 -07:00
Treehugger Robot
a5c88fd6ee Merge "Keystore 2.0 SPI: Fix engineDoFinal with null input." am: 06df6d84eb am: 3310a9a81f am: eaca45fcf3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1680128

Change-Id: I2ad6bfc44915687bc24c0ec60ebf99244f4758b1
2021-04-23 18:26:33 +00:00
Treehugger Robot
06df6d84eb Merge "Keystore 2.0 SPI: Fix engineDoFinal with null input." 2021-04-23 17:53:34 +00:00
Pavel Grafov
f8cd83ff2d Merge "Make sure DPC knows if revoke fails" into sc-dev 2021-04-22 16:13:34 +00:00
Janis Danisevskis
70cf430ede Keystore 2.0 SPI: Fix engineDoFinal with null input.
AndroidKeyStoreCipherSpiBase.engineDoFinal may get called with a null
input argument. In the case where we forward the operation to the
default provider doFinal() needs to be called instead of
doFinal(byte[], int, int).

Bug: 183913233
Test: atest android.keystore.cts.CipherTest#testEncryptsAndDecryptsUsingCipherStreams
Change-Id: Ia3afaf281be7c8e5493ac8e4155a7aa02d1d37f0
2021-04-22 14:55:45 +00:00
Nikita Iashchenko
8798556669 Merge "Remove usage of Math.randomLongInternal" am: c931f43bcd am: 267fc8b764 am: 7716e67ea3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682025

Change-Id: I67913263f9bfb5380d915e716f19511db847a339
2021-04-22 10:10:54 +00:00
Nikita Iashchenko
c931f43bcd Merge "Remove usage of Math.randomLongInternal" 2021-04-22 09:10:52 +00:00
Treehugger Robot
9271023eed Merge "Keystore 2.0: Add namespace locksettings." am: 6bcd65c99e am: 965c7e3c91 am: c40e1d5131
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1676196

Change-Id: Ifa0aafc8c2f5d412e2336c55db027277d94ca84e
2021-04-21 17:02:29 +00:00
Rubin Xu
5c81a3b1b4 Merge "Keystore 2.0: Add key migration API." am: d42f1be8eb am: a48b43ec42 am: 87a312952c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1676925

Change-Id: Id028c5a629cd6a5c58604af4bff12c5779e38911
2021-04-21 17:02:03 +00:00
Treehugger Robot
6bcd65c99e Merge "Keystore 2.0: Add namespace locksettings." 2021-04-21 15:53:32 +00:00
Rubin Xu
d42f1be8eb Merge "Keystore 2.0: Add key migration API." 2021-04-21 15:52:17 +00:00
Pavel Grafov
67f11e65ca Make sure DPC knows if revoke fails
Bug: 183098396
Test: atest MixedDeviceOwnerTest#testKeyManagement
Change-Id: I89b51a1fb4be3b53eb46a7c194924b5255cd262b
2021-04-21 15:48:45 +01:00
Nikita Iashchenko
1bc8a1f886 Remove usage of Math.randomLongInternal
As a part of internal libcore API cleanup some of the functions
previously exposed are getting removed from public surface.
Math#randomLongInternal is a wrapper around java.util.Random and has no
specific implications so its usages are get refactored.

Bug: 154796679
Test: m droid
Change-Id: I29e0e9307fbaf9c1ac018b83014efb2d3dd74479
2021-04-21 14:10:43 +00:00
Alex Johnston
c271813dcf Cred mng app URI documentation
* Add URI matching documentation

Bug: 177979648
Test: build docs
Change-Id: I44d40e919cce1b4f955f562b1cf6cbad450b4b58
2021-04-21 13:50:35 +01:00
Janis Danisevskis
52e19940b1 Keystore 2.0: Add namespace locksettings.
This namespace is required by LocksettingsService to protect the
synthetic password key from removal when the user removes the
credentials or wipes AID_SYSTEM app data.

Bug: 184664830
Test: N/A
Change-Id: Ie752a75d2cb2ebf1f4e5814bc2cbc807cc754c21
2021-04-20 15:32:56 +00:00
Janis Danisevskis
e5ae08e49d Merge "Fix operation auth bound keys." am: b3671c4ab5 am: f941d3fb5b am: 0992040e48
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1677200

Change-Id: Ie4972c2b9da95515b3e98f66af716e7d1fcf156c
2021-04-17 07:09:40 +00:00
Janis Danisevskis
8c97d4fe79 Fix operation auth bound keys.
CryptoObject still called the legacy AndroidKeystoreProvider which did
not return the correct operation handle for per operation auth bound
keys.

Bug: 184804041
Bug: 185181377
Test: CtsVerifier->Security->Biometric Tests->2a Strong Biometrics +
      Crypto
Merged-In: I0bceff0425e7ef32c394f33deda3c78f729c0c6c
Change-Id: I0bceff0425e7ef32c394f33deda3c78f729c0c6c
2021-04-16 12:55:33 -07:00
Janis Danisevskis
cbe7e963ab Keystore 2.0: Add key migration API.
The key migration API is required by locksettingsservice to move the
synthetic password key out of AID_SYSTEM to protect it from deletion
when the user removes credentials from AID_SYSTEM.

Bug: 184664830
Test: N/A
Change-Id: I8d0ffb79870affc8ac055574b6f808a984aa5e52
2021-04-16 14:21:40 +01:00
Treehugger Robot
41069eb17e Merge "Keystore 2.0 SPI: Make getAttestationIds return an empty array." am: 1f82f476c0 am: cf64e636a8 am: 1a4f20ceac
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1664321

Change-Id: I8c1146a0b86cfca21bf9f3e837b4315cca3d5f86
2021-04-08 18:14:54 +00:00