Skip to content
Snippets Groups Projects
  1. Jan 17, 2024
    • Eric Biggers's avatar
      Fix UnlockedDeviceRequired with weak unlock methods · cd7f4fad
      Eric Biggers authored
      Starting in Android 12, unlocking the device with a class 1
      ("convenience") biometric, class 2 ("weak") biometric, or a trust agent
      unexpectedly doesn't allow the use of UnlockedDeviceRequired keys.  The
      cause of this bug is that the cryptographic protection that Keystore now
      applies to UnlockedDeviceRequired keys incorrectly assumes that the
      device can only be unlocked using LSKF or via a biometric that
      participates in Keystore (has a SID and uses HardwareAuthTokens).
      Actually, Keyguard also allows the device to be unlocked using weaker
      biometrics that do not particiate in Keystore, if they are enrolled.
      Similarly, there are also cases where a trust agent can actively unlock
      the device, e.g. unlocking a phone using a paired watch.
      
      In combination with the Keystore changes in
      I1b0d9ec4f9e31dc91642e865045766bd17e34cad, this CL fixes the bug by
      making Keystore retain the UnlockedDeviceRequired super keys in memory
      if a weak unlock method is enabled at device lock time.  This does mean
      that UnlockedDeviceRequired is enforced only logically when a weak
      unlock method is enabled, but this is the best we can do in this case.
      
      Note: a future CL will take into account the progressive expiration of
      unlock methods while the device is locked and upgrade the security of
      UnlockedDeviceRequired accordingly.  The present CL focuses just on
      choosing the correct protection at lock time, fixing a user-visible bug.
      
      Test: Ran the following automated tests with and without the
            fix_unlocked_device_required_keys_v2 flag enabled:
                atest com.android.server.locksettings \
                && atest TrustManagerServiceTest \
                && atest TrustTests \
                && atest -p --include-subdirs system/security/keystore2 \
                && atest CtsKeystoreTestCases
      
      Test: Manually tested each combination of biometric setup: none,
            fingerprint, face, and fingerprint+face.  Locked the device, then
            verified via logcat that Keystore protected the
            UnlockedDeviceRequired keys in the expected way, then verified
            that UnlockedDeviceRequired keys cannot be used (even in the case
            where the super keys were not protected).  Unlocked device using
            weakest method available, then verified that
            UnlockedDeviceRequired keys can be used.  To check whether
            UnlockedDeviceRequired keys can be used or not, used the CTS
            method mentioned in the Test of https://r.android.com/2878769.
      
            Also, enabled Extend Unlock with a bluetooth device, and verified
            that it's not counted as an unlock method.
      
            Also, verified that if Lockdown mode is triggered, the
            UnlockedDeviceRequired keys are fully protected.
      
      Bug: 296464083
      Change-Id: I34dc49f1338e94755e96c1cf84de0638dc70d311
      cd7f4fad
  2. Dec 06, 2023
    • Eran Messeri's avatar
      Revert^2 "MGF1 Digest setter: Handle case of flag off" · e8e91b50
      Eran Messeri authored
      This reverts commit 468c8fe6.
      Additionally, this adds a guard for reading the flag: If
      the calling app does not have the right permission to read the device
      configuration, the code will assume it is not set.
      
      Reason for revert: Fixed flag reading code
      
      Bug: 314744703
      Test: atest CtsWebkitTestCases:android.webkit.cts.WebViewSslTest#testProceedClientCertRequestKeyWithAndroidKeystoreKey
      Change-Id: I29c58bc8c5960c0ab9af70f93440bd9a1db12dc7
      e8e91b50
    • Eric Biggers's avatar
      Split Keystore's onLockScreenEvent into onDevice{Unlocked,Locked} · c22ce02b
      Eric Biggers authored
      Currently Keystore is notified of the device being unlocked and locked
      for each user via onLockScreenEvent(lockScreenEvent, userId, password,
      unlockingSids), where lockScreenEvent is UNLOCK or LOCK.  This is a bit
      confusing because the password parameter is only meaningful for UNLOCK,
      and the unlockingSids parameter is only meaningful for LOCK.  This
      problem will get worse when we add a parameter that tells Keystore
      whether unlocking via a weak biometric or trust agent is possible, as
      that will be another parameter that is only meaningful for LOCK.
      
      Therefore, this CL splits onLockScreenEvent into two methods
      onDeviceUnlocked and onDeviceLocked, each with the appropriate
      parameters.  No actual change in behavior intended.  This change does
      make TrustManagerService no longer call getBiometricSids() for unlocks,
      so technically that is a slight difference; however, for UNLOCK events
      Keystore ignored the SID list, so this just eliminates unnecessary work.
      
      Bug: 296464083
      Test: atest -p --include-subdirs system/security/keystore2 \
            && atest CtsKeystoreTestCases \
            && atest TrustTests \
            && atest com.android.server.locksettings
      Flag: N/A, straightforward refactoring
      Change-Id: Ibfaa22ba27d13248c9c4c69a4d2efb2231792c31
      c22ce02b
  3. Nov 30, 2023
    • Nick Wille's avatar
      Revert "MGF1 Digest setter: Handle case of flag off" · 468c8fe6
      Nick Wille authored
      This reverts commit e0c8ad86.
      
      Reason for revert: 314140771
      
      Change-Id: Ied1f3042aee8ac8642237a4cdcfa75be7a02e7e8
      468c8fe6
    • Eran Messeri's avatar
      MGF1 Digest setter: Handle case of flag off · e0c8ad86
      Eran Messeri authored
      In case the MGF1 Digest setter flag is turned off (that is, it is not
      possible to specify MGF1 Digests using the new API introduced), then the
      old behaviour has to take place.
      
      The old behaviour was to set all primary digests specified, as MGF1 Digests.
      This behaviour has been added when the flag isn't set.
      
      Bug: 308378912
      Bug: 308069562
      Test: atest CtsKeystoreTestCases:android.keystore.cts.CipherTest#testKatBasicWithDifferentProviders CtsKeystoreWycheproofTestCases:RsaOaepTest
      Change-Id: I5d4541ce952e1bad7c8fdd55a00176274b0b66f3
      e0c8ad86
  4. Nov 27, 2023
    • Shaquille Johnson's avatar
      Update exception thrown for keystore · 40a8d1f7
      Shaquille Johnson authored
      When the keystore service is not available or
      not initialized we do not want to crash the service.
      So we throw and Exception that KeystoreService
      is not availble when it should be possibly in an
      incorrect state.
      
      Test: atest CtsKeystoreTestCases
      Bug: 304758094
      Change-Id: If73856deb27b9f11a9b77f0ba32c3b4037332759
      40a8d1f7
  5. Nov 15, 2023
    • Eran Messeri's avatar
      Make MGF1 Digest setter NotNull · e0f6c088
      Eran Messeri authored
      The MGF1 Digest setter should not accept a null vararg. It should not
      take in null at all.
      
      Bug: 302280420
      Test: m
      Change-Id: I9db395d09e2fd0e609cd9019f3d3aedbb3244ef3
      e0f6c088
  6. Nov 13, 2023
    • Eric Biggers's avatar
      LockSettingsService: fix UnlockedDeviceRequired to work without LSKF · 9fece1ec
      Eric Biggers authored
      The security improvements to Keystore's UnlockedDeviceRequired key
      protection in Android 12 regressed its behavior by making it no longer
      work for unsecured users, e.g. users with a Swipe lock screen.  One of
      the things that broke it is that Keystore started superencrypting
      UnlockedDeviceRequired keys, yet Keystore unnecessarily ties
      superencryption to the existence of the user's LSKF.  That is, Keystore
      creates a user's super keys only when an LSKF is set, and Keystore
      deletes all super keys and superencrypted keys when the LSKF is removed.
      
      To fix this, we're first making each user's Keystore super keys have the
      same lifetime as the user's synthetic password (and always be encrypted
      by it), which is very similar to how the CE storage key works starting
      in Android 14.  Second, when a user's LSKF is removed, we're making
      Keystore delete *only* the user's auth-bound keys.
      
      This change implements the LockSettingsService side of the fix.  This
      includes the following parts:
      
      - When initializing a user's synthetic password, LockSettingsService now
        initializes the user's Keystore super keys.
      
      - When upgrading to a build including this fix, LockSettingsService now
        does a one-time migration where it initializes the super keys for
        unsecured users.  This is necessary to handle existing users.
      
      - When removing a user's LSKF, LockSettingsService now calls the new
        onUserLskfRemoved method of Keystore to delete auth-bound keys only.
      
      - Finally, when an unsecured user's CE storage is unlocked,
        LockSettingsService now unlocks the user's Keystore super keys too.
      
      Due to trunk-stable, these changes are actually behind a flag for now.
      
      Bug: 296464083
      Test: see If12824369fbad4a90e5cd0427e792655fd233b96
      Change-Id: Ib92a439c2c27cef54c28189dfb5beef68756528e
      9fece1ec
  7. Nov 02, 2023
    • Eran Messeri's avatar
      Clarifying the KM challenge size · 83a90a4d
      Eran Messeri authored
      KeyMint handles challenges up to 128 bytes. Document this in the
      KeyGenParameterSpec Builder.
      
      Bug: 307714384
      Test: m
      Change-Id: Ib2082edd12828649225c42de56e176540e997467
      83a90a4d
  8. Nov 01, 2023
    • James Willcox's avatar
      Add BiometricManager.getLastAuthenticationTime() · 8f0b73b7
      James Willcox authored
      This obtains the time (via SystemClock.elapsedRealtime()) when the
      user last authenticated using any of the passed authenticators.
      
      Test: manual, atest AuthServiceTest, CTS
      Bug: 303839446
      Change-Id: Id22bee7b05271ce38816f932b3696cb450ab025d
      8f0b73b7
  9. Oct 09, 2023
    • Eric Biggers's avatar
      Remove KeyStore#state() · c230e33f
      Eric Biggers authored
      Remove AndroidKeyStoreMaintenance#getState() and both overloads of
      KeyStore#state().  None of these are used by platform code anymore.
      
      The two KeyStore#state() methods do have @UnsupportedAppUsage, as do two
      values of the State enum: UNLOCKED and LOCKED.  However, there is a
      clear public API equivalent for apps that may be checking these states:
      UserManager#isUserUnlocked().  Therefore, according to the policy on
      unsupported usage of internal APIs, we can remove these internal APIs.
      
      Also, the non-SDK dashboard has no runtime results for either method,
      and only one static analysis result which is from unused code in one
      app.  This is consistent with these methods being entirely unused.
      
      Part of the motivation for removing these internal APIs is that upcoming
      changes to the lifetime of keystore superencryption keys would change
      the behavior of getState.  So it seems like a good time to remove this
      unused/unsupported code instead of wasting time maintaining it.
      
      Bug: 296464083
      Test: atest -p --include-subdirs system/security/keystore2
      Change-Id: Iff821bbdeac5ee0653c9c71867fd53d38cb4d48f
      c230e33f
    • Tri Vo's avatar
      docs: Clarify when certificate is self-signed · 23ff57a6
      Tri Vo authored
      Test: m
      Change-Id: I4a9fe5ff53ce3a7eaf02011df2d19b17111b7b8b
      23ff57a6
  10. Oct 06, 2023
  11. Sep 28, 2023
  12. Sep 22, 2023
    • Eran Messeri's avatar
      MGF1 Digest: Add separate setter · d61656c5
      Eran Messeri authored
      Add a separate setter for the digests used by the MGF1 mask generation
      function (for RSA OAEP operations).
      
      Previously the MGF1 digests were specified according to the primary
      digests specification, which is not accurate enough.
      
      With the new setter:
      * If the user does not explicitly specify MGF1 digests, then the
        default (SHA-1) will be specified in the tag passed to Keystore.
      * If the user does explicitly specify MGF1 digests, only those
        digests will be specified in the tag passed to Keystore.
        The SHA-1 digest will not be added.
      
      Bug: 284140060
      Test: atest android.security.keystore.KeyGenParameterSpecTest android.security.ParcelableKeyGenParameterSpecTest
      Test: atest CtsKeystoreTestCases:android.keystore.cts.CipherTest#testKatBasicWithDifferentProviders
      Change-Id: I1521e9b4399ece33c2d17b79133543d490d3b377
      d61656c5
  13. Sep 14, 2023
  14. Sep 13, 2023
  15. Aug 22, 2023
  16. Aug 15, 2023
  17. Aug 11, 2023
    • Eric Biggers's avatar
      Update owners for keystore related files · 5cd51fe5
      Eric Biggers authored
      - Make core/java/android/security/keystore/OWNERS include
        keystore/OWNERS instead of duplicating it
      
      - Make core/tests/coretests/src/android/security/keystore/ owned by
        keystore/OWNERS instead of no one
      
      - Make core/java/android/security/Confirmation*.java owned by
        keystore/OWNERS instead of an individual person
      
      - Remove core/java/android/security/keystore/recovery/OWNERS, as it was
        redundant with OWNERS of its parent directory
      
      - Remove Xoogler jdanis@
      
      Change-Id: I64c1c624dcc92fbf20a6d4fb667cf47240edf4d5
      5cd51fe5
  18. Aug 09, 2023
    • Jaeyoon Lee's avatar
      Insert DEFAULT_MGF1_DIGEST SHA-1 on MGF_DIGEST tag when ImportWrappedKey · 8cbd940d
      Jaeyoon Lee authored
      
      SecureKeyImport is failed because of MGF_DIGEST tag mismatch.
      wrapping key has MGF_DIGEST tag when generate or import key
      but importWrappedKey logic does not have MGF_DIGEST tag on WrappedKeyEntry
      So MGF_DIGEST tat mismatch error occur when decrypt wrapped key using wrapping key
      
      Insert SHA-1 value on MGF_DIGEST tag because ImportWrappedKey should have spcified format
      that keymint is compulsorily checking main digest SHA-256 and MGF digest SHA-1.
      
      And MGF_DIGEST tag will add only wrappingkey has MGF_DIGEST value
      in order not to affect keys generated prior to Android14.
      
      Bug: 277853193
      Test: android.keystore.cts.ImportWrappedKeyTest#testKeyStore_ImportWrappedKey
      Change-Id: Id7229a763e3041ffbe73989a2bb24306b7beb7a5
      Signed-off-by: default avatarJaeyoon Lee <joyful.lee@samsung.corp-partner.google.com>
      8cbd940d
  19. Jul 18, 2023
    • Eran Messeri's avatar
      Revert "Fix Rsa-Oaep operation begin on T+GSI build" · eed83858
      Eran Messeri authored
      This reverts commit dde5ebaa.
      
      Reason for revert: Will re-introduce http://b/278157584
      
      Even though KeyMint v2 supports the MGF_DIGEST tag, it does not include it in the key characteristics. This would not be a problem for keys generated on an Android U device with KeyMint v2 but it will be a problem on a device that was upgraded to Android U where keys were generated before the upgrade (so the MGF_DIGEST tag was not added).
      Because we have no way of knowing if the MGF_DIGEST tag was specified when the key was created on KeyMint implementations older than v3, we should not add the tag on begin().
      
      Change-Id: I7b34799b95eb2ff054ec4d090ccbd93e6442dcfe
      eed83858
  20. Jul 10, 2023
    • Prashant Patil's avatar
      Fix Rsa-Oaep operation begin on T+GSI build · dde5ebaa
      Prashant Patil authored
      Mixed build of Android T + U GSI misses to add RSA_OAEP_MGF_DIGEST in
      key begin operation parameters and hence RSA cipher operation fails.
      This was due to Keymint 200 implementation in Android T supported
      RSA_OAEP_MGF_DIGEST tag but did not included into key characteristics and
      the check in AndroidKeyStoreRSACipherSpi fails on Android T + U GSI
      builds.
      
      To fix this issue additional condition added to check if key
      characteristics do not have RSA_OAEP_MGF_DIGEST tag but the KeyMint
      version is 200 then it has to include in operation parameters.
      
      Bug: 289859292
      Bug: 289749312
      Bug: 287891167
      Bug: 287532460
      Test: atest  CtsKeystoreWycheproofTestCases:com.google.security.wycheproof.RsaOaepTest
      Test: atest CtsKeystoreTestCases:android.keystore.cts.CipherTest#testKatBasicWithDifferentProviders
      (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d8b18413ade6ba13817caae52abdffc609a92d89)
      Merged-In: I13ca50a45e733276d1451d17904780eff86bf296
      Change-Id: I13ca50a45e733276d1451d17904780eff86bf296
      dde5ebaa
  21. Jun 21, 2023
    • Eran Messeri's avatar
      Update documentation regarding auth-bound keys. · 2fd15b0b
      Eran Messeri authored
      When a key requires user authentication and one of the authentication
      methods permitted is the device's screen lock credentials, the
      root SID is added as an authenticator, and change of biometrics
      enrollment will not invalidate the key.
      
      Bug: 275900161
      Test: m docs
      Change-Id: I180f28883a5ac62e8bfa0b0596396085ff676637
      2fd15b0b
  22. Jun 06, 2023
    • Eran Messeri's avatar
      Do not add the MGF Digest tag for upgraded keys · 00698c83
      Eran Messeri authored
      If a key does not have the MGF_DIGEST tag in its key characteristics,
      do not include the MGF_DIGEST tag for it (even if the algorithm string
      specifies it).
      
      This fixes an issue with keys that were generated on Android 13, where
      the MGF_DIGEST tag was not propagated from the SPI layer. Such keys will
      not have the MGF_DIGEST tag and so it will not be added by the SPI layer
      even if the algorithm string specifies it. This maintains Android 13's
      (incorrect) behaviour of ignoring the MGF Digest specification, but is
      necessary to use those keys (otherwise KeyMint will error out
      on begin() due to an incompatible MGF digest specification).
      
      Bug: 278157584
      Test: atest CtsKeystoreWycheproofTestCases:com.google.security.wycheproof.RsaOaepTest
      Merged-In: I0f1fa7983f9c771bec3196c6a617eb7044ac2e79
      Change-Id: I6a4c15ca04aa78c2191d47394811ba9338ee7f0b
      00698c83
  23. Apr 28, 2023
    • Eran Messeri's avatar
      Do not add the MGF Digest tag for upgraded keys · d9ef4882
      Eran Messeri authored
      If a key does not have the MGF_DIGEST tag in its key characteristics,
      do not include the MGF_DIGEST tag for it (even if the algorithm string
      specifies it).
      
      This fixes an issue with keys that were generated on Android 13, where
      the MGF_DIGEST tag was not propagated from the SPI layer. Such keys will
      not have the MGF_DIGEST tag and so it will not be added by the SPI layer
      even if the algorithm string specifies it. This maintains Android 13's
      (incorrect) behaviour of ignoring the MGF Digest specification, but is
      necessary to use those keys (otherwise KeyMint will error out
      on begin() due to an incompatible MGF digest specification).
      
      Bug: 278157584
      Test: atest CtsKeystoreWycheproofTestCases:com.google.security.wycheproof.RsaOaepTest
      (cherry picked from https://android-review.googlesource.com/q/commit:05d046390769a8ba6f113ea6b191d9addf183627)
      Merged-In: I0f1fa7983f9c771bec3196c6a617eb7044ac2e79
      Change-Id: I0f1fa7983f9c771bec3196c6a617eb7044ac2e79
      d9ef4882
  24. Apr 27, 2023
    • Prashant Patil's avatar
      Keystore: Added missing error codes · b15ca79b
      Prashant Patil authored
      All error codes defined in ErrorCode.aidl file are expected to be
      mapped in KeymasterDefs.java file, excluding -62 which is handled by
      Keystore and not required to define on Jaya layer.
      So missing error codes from KeymasterDefs are added and also categorized
      in KeyStoreException class.
      
      Bug: 206432492
      Test: atest CtsKeystoreTestCases:android.keystore.cts.KeyStoreExceptionTest
      Change-Id: I9df69e03379d0437457037e16de76feb27ea8aaf
      b15ca79b
  25. Apr 26, 2023
    • Eran Messeri's avatar
      Do not add the MGF Digest tag for upgraded keys · 05d04639
      Eran Messeri authored
      If a key does not have the MGF_DIGEST tag in its key characteristics,
      do not include the MGF_DIGEST tag for it (even if the algorithm string
      specifies it).
      
      This fixes an issue with keys that were generated on Android 13, where
      the MGF_DIGEST tag was not propagated from the SPI layer. Such keys will
      not have the MGF_DIGEST tag and so it will not be added by the SPI layer
      even if the algorithm string specifies it. This maintains Android 13's
      (incorrect) behaviour of ignoring the MGF Digest specification, but is
      necessary to use those keys (otherwise KeyMint will error out
      on begin() due to an incompatible MGF digest specification).
      
      Bug: 278157584
      Test: atest CtsKeystoreWycheproofTestCases:com.google.security.wycheproof.RsaOaepTest
      Change-Id: I0f1fa7983f9c771bec3196c6a617eb7044ac2e79
      05d04639
  26. Apr 14, 2023
  27. Apr 03, 2023
    • Seth Moore's avatar
      Remove the GenerateRkpKey service · 651ffe62
      Seth Moore authored
      With the move to rkpd, we no longer need to make calls from framework
      into the remote provisioner to tell it that a key was consumed.
      
      Bug: 274823784
      Test: atest KeystoreTests
      Test: atest CtsKeystoreTestCases:android.keystore.cts.KeyAttestationTest
      Change-Id: I510d471a980c62e5798e459729f73c231321d2a9
      651ffe62
  28. Mar 20, 2023
    • Eran Messeri's avatar
      Batch fetching of key descriptors from Keystore · 17ad506f
      Eran Messeri authored
      Change interaction with Keystore2 in the following manner:
      * Return an enumerator over the entries in Keystore2 rather than
        attempting to get all of them into one single data structure.
      * Use a new Keystore2 method for getting the count of entries
        rather than count the size of the array returned.
      
      The enumerator reads a batch of key descriptors from Keystore2.
      Once the batch has been exhausted, the enumerator added asks
      Keystore2 for the next batch of keys starting with the last
      alias it has processed, until it receives an empty array.
      
      Bug: 222287335
      Test: atest KeystoreTests
      Change-Id: I309b3188df998825557a3c5e6d777b1c0807a924
      17ad506f
  29. Mar 14, 2023
  30. Mar 13, 2023
    • Prashant Patil's avatar
      Keystore: Attestation fix for AOSP and GSI builds · fb32aac1
      Prashant Patil authored
      Device ID attestation was failing in AOSP and GSI images due to
      properties mismatch in Build.java and actual device properties.
      (For example, the value of Build.DEVICE on a Raven device running
      an AOSP build would be 'aosp_raven', but KeyMint was provisioned
      with the value 'raven'.)
      
      To fix above issue, properties ro.product.*_for_attestation were
      introduced in AOSP build files (eg. aosp_raven.mk) only. But this
      was not sufficient for both AOSP and GSI. The same solution does
      not work for GSI images: GSI images are generic and so we cannot
      set device-specific properties in them.
      
      So, if ro.product.*_for_attestation properties are empty or unknown,
      they are read from ro.product.vendor because these values are not
      changed after flashing GSI images also. This fix will work for
      both AOSP and GSI images. Device ID properties preferences for
      eg. Build.BRAND_FOR_ATTESTATION = ro.product.brand_for_attestation ->
      ro.product.vendor.brand -> UNKNOWN.
      
      Bug: 268294752
      Bug: 110779648
      Bug: 259376922
      Test: atest VtsAidlKeyMintTargetTest:PerInstance/NewKeyGenerationTest#EcdsaAttestationIdTags/0_android_hardware_security_keymint_IKeyMintDevice_default
      Test: atest VtsAidlKeyMintTargetTest:PerInstance/NewKeyGenerationTest#EcdsaAttestationIdTags/1_android_hardware_security_keymint_IKeyMintDevice_strongbox
      Test: atest CtsKeystoreTestCases:android.keystore.cts.KeyAttestationTest CtsKeystoreTestCases:DeviceOwnerKeyManagementTest
      Change-Id: I574eca430cd2022cb9c270ca23ad33f6e5423cd4
      fb32aac1
  31. Feb 06, 2023
    • Prashant Patil's avatar
      Keystore: Attestation fix in non AOSP builds · d7e1bc71
      Prashant Patil authored
      After adding attestation properties for AOSP/GSI builds their comparison
      in Spi layer missed one condition. If these values were not set they were assigned
      as Build.UNKNOWN. Hence additional check is added in Spi layer.
      
      Bug: 267643193
      Test: atest CtsKeystoreTestCases:android.keystore.cts.KeyAttestationTest CtsKeystoreTestCases:DeviceOwnerKeyManagementTest
      Change-Id: I5b3ef0a308bbb12bc4cac2efcf04468f65db1ef8
      d7e1bc71
  32. Jan 27, 2023
    • Seth Moore's avatar
      Add support for new OUT_OF_KEYS_* errors · 9ae19e50
      Seth Moore authored
      This is the first in a set of changes that get RKP error data directly
      from keystore.
      
      Starting with Android U, we get detailed RKP error information directly
      in the ResponseCode from keystore. This means mRkpStatus and related
      logic can be removed after AOSP fully switches over to using rkpd
      from the old RemoteProvisioner.
      
      Test: RkpdAppUnitTests
      Bug: 264888027
      Change-Id: I32e128cca51b2d7dfdd67824ecb100f4e1cd4341
      9ae19e50
  33. Dec 31, 2022
    • Eran Messeri's avatar
      Handle unparsable public keys · 10770c15
      Eran Messeri authored
      Handle the case where a KeyMint implementation produced an invalid
      X.509 certificate that is the container for the generated key's public
      portion.
      
      There's not much for the caller to do other than re-generate the key.
      
      Bug: 261788762
      Test: Not tested yet.
      Change-Id: Ia883df4f5e29a7d75929d37a68b015e857b90560
      10770c15
  34. Dec 15, 2022
    • Prashant Patil's avatar
      Keystore: Attestation fix in AOSP builds · a2e8c0d6
      Prashant Patil authored
      Alternet device properties used for attestation on AOSP and GSI builds.
      Attestation ids were different in AOSP/GSI builds than provisioned ids
      in keymint. Hence additional properties used to make these ids identical
      to provisioned ids.
      
      Bug: 110779648
      Bug: 259376922
      Test: atest VtsAidlKeyMintTargetTest:PerInstance/NewKeyGenerationTest#EcdsaAttestationIdTags/0_android_hardware_security_keymint_IKeyMintDevice_default
      Test: atest VtsAidlKeyMintTargetTest:PerInstance/NewKeyGenerationTest#EcdsaAttestationIdTags/1_android_hardware_security_keymint_IKeyMintDevice_strongbox
      Test: atest CtsKeystoreTestCases:android.keystore.cts.KeyAttestationTest CtsKeystoreTestCases:DeviceOwnerKeyManagementTest
      
      Change-Id: Idd87314b8e5a95de3daac0ea4ff4dffd4c4c6f63
      a2e8c0d6
  35. Dec 05, 2022
    • Shaquille Johnson's avatar
      Update Keystore with new fields for API V3 · 3144d8c1
      Shaquille Johnson authored
      We are adding the error codes ERROR_DEVICE_UNREGISTERED and
      ERROR_DEVICE_POTENTIALLY_VULNERABLE to reflect the new changes
      described in go/surface-rkp-status.
      
      Test: Unit test and Cts test added to KeystoreExceptionTest and run using atest CtsKeystoreTestCases
      Change-Id: Ie93814aaa5422e323d5a643e10e9fe4a51c07560
      3144d8c1
  36. Dec 01, 2022
    • Eran Messeri's avatar
      ID attestation: Pass second IMEIs to Keystore · 4594638a
      Eran Messeri authored
      To support attestation of a second IMEI, when ID attestation (with IMEI)
      is requested, pass in the 2nd IMEI as a SECOND_IMEI KeyMint tag.
      
      Bug: 244732345
      Test: atest android.keystore.cts.DeviceOwnerKeyManagementTest
      Change-Id: I19a3733746fa6a35c6225f0c60fd9f4b51a62ab1
      4594638a
Loading