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

Commit 93a4d81f authored by Martin Brabham's avatar Martin Brabham Committed by android-build-team Robot
Browse files

Revert "[DO NOT MERGE] btif: Avoid a couple string copies"

This reverts commit d968f038.
(cherry picked from commit 4e2d849a6049204921e4f00b9eee3bbebc88fa39)

Change-Id: I8fd4f917befb06d4cdc59a1f004b84dbc4c3e46c
parent 61d135b7
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -82,9 +82,9 @@ static std::unique_ptr<config_t> btif_config_open(const char* filename, const ch
// Key attestation
static std::string hash_file(const char* filename);
static std::string read_checksum_file(const char* filename);
static void write_checksum_file(const char* filename, const std::string& hash);
static bool verify_hash(const std::string& current_hash,
                        const std::string& stored_hash);
static void write_checksum_file(const char* filename, const std::string hash);
static bool verify_hash(const std::string current_hash,
                        const std::string stored_hash);

static enum ConfigSource {
  NOT_LOADED,
@@ -611,15 +611,13 @@ static std::string read_checksum_file(const char* checksum_filename) {
  return output;
}

static void write_checksum_file(const char* checksum_filename,
                                const std::string& hash) {
static void write_checksum_file(const char* checksum_filename, std::string hash) {
  int result = btifKeystore.Encrypt(hash, checksum_filename, 0);
  if (result != 0) {
    LOG(ERROR) << "Failed writing checksum!";
  }
}

static bool verify_hash(const std::string& current_hash,
                        const std::string& stored_hash) {
static bool verify_hash(std::string current_hash, std::string stored_hash) {
  return current_hash.compare(stored_hash) == 0;
}