Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d279c86 authored by Martin Brabham's avatar Martin Brabham
Browse files

btif: Short circuit NIAP key attestation check

Ensure the check always passes so bluetooth is stable.
There is a vendor code issue with keymaster having random HAL errors (-1).
Revert this change after the keystore issues are resolved.
b/130045583
b/130163310

Bug: 129759834
Test: atest net_test_btif
Change-Id: I65c13eb4638799ca73bc2d3d8d07cdf14a8624c7
parent e3ffb1da
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -60,7 +60,16 @@ static const char* TIME_STRING_FORMAT = "%Y-%m-%d %H:%M:%S";

constexpr int kBufferSize = 400 * 10;  // initial file is ~400B

static bool use_key_attestation() { return getuid() == AID_BLUETOOTH; }
static bool override_use_key_attestation() {
  char key_attestation[PROPERTY_VALUE_MAX] = {0};
  osi_property_get("persist.bluetooth.use_key_attestation", key_attestation, "false");
  return strncmp(key_attestation, "true", 4) == 0;
}

static bool use_key_attestation() {
  // Short circuiting until keystore issue is fixed
  return getuid() == AID_BLUETOOTH /* remove if keystore fixed */ && override_use_key_attestation();
}

#define BT_CONFIG_METRICS_SECTION "Metrics"
#define BT_CONFIG_METRICS_SALT_256BIT "Salt256Bit"