summaryrefslogtreecommitdiff
path: root/keystore/java/android/security/GenerateRkpKey.java
AgeCommit message (Collapse)Author
2021-08-13Fixing a condition that can cause deadlockMax Bires
Callbacks on ServiceConnection happen on the main UI thread for an application. Since the thread that calls bindService then immediately blocks to wait for the service to be connected, this will cause a deadlock if key operations are happening on the main UI thread. This bug has likely not been detected yet since key operations are not supposed to be performed on the main UI thread, however it was uncovered in a similar application during other testing. This fix ensures the ServiceConnection object's callbacks will be triggered from a separate thread from the calling thread. Bug: 196571032 Test: Apps that run key operations on the UI thread don't hang. Change-Id: I630a0ef2560a8ebd962de54c65e3d6277133a1cb
2021-07-20Fixing the race condition in GenerateRkpKeyMax Bires
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-09Revert "Fixing the race condition in GenerateRkpKey"Max Bires
This reverts commit d05498b9d8d30ca69eaafe920c5915ee472058eb. Reason for revert: Bugged on non-RKP systems. Bug: 190222116 Change-Id: Ie7d17d4251c381c1bae6a76cd9b0246c551f8042
2021-06-08Fixing the race condition in GenerateRkpKeyMax Bires
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-03-24Adding AIDL and functions for talking to RemoteProvisionerMax Bires
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