Skip to content

Commit

Permalink
Keystore: Disable StrongBox usage for now.
Browse files Browse the repository at this point in the history
StrongBox is unfortunately broken on some older devices so we need a
way to have the application to specify whether to use it or not,
depending on e.g. make/model of the device. A future update will make
this configurable. See Issue #259 for details.

Test: Manually tested.
  • Loading branch information
davidz25 committed Apr 10, 2023
1 parent c9bcbed commit 45662cd
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1310,12 +1310,15 @@ Collection<X509Certificate> getAuthKeysNeedingCertification() {
.setDigests(KeyProperties.DIGEST_SHA256, KeyProperties.DIGEST_SHA512);

boolean isStrongBoxBacked = false;
/* Disable StrongBox usage for now, see Issue #259 for details
*
PackageManager pm = mContext.getPackageManager();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P &&
pm.hasSystemFeature(PackageManager.FEATURE_STRONGBOX_KEYSTORE)) {
isStrongBoxBacked = true;
builder.setIsStrongBoxBacked(true);
}
*/
kpg.initialize(builder.build());
kpg.generateKeyPair();
Log.i(TAG, "AuthKey created, strongBoxBacked=" + isStrongBoxBacked);
Expand Down

0 comments on commit 45662cd

Please sign in to comment.