Commit 54e29ca2 authored by Leo Lai's avatar Leo Lai Committed by Commit Bot

remove TpmAttestationDeleteKey(sByPrefix)? APIs

Now we are using AttestationClient directly instead of passing through
CryptohomeClient.

BUG=b:158955123
TEST=build ok.

Change-Id: Ibd93c72f8a5eb46a9d346d6ef381bcb3a8cbb811
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2497389
Commit-Queue: Leo Lai <cylai@google.com>
Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821276}
parent b82690a8
...@@ -754,39 +754,6 @@ class CryptohomeClientImpl : public CryptohomeClient { ...@@ -754,39 +754,6 @@ class CryptohomeClientImpl : public CryptohomeClient {
CallBoolMethod(&method_call, std::move(callback)); CallBoolMethod(&method_call, std::move(callback));
} }
// CryptohomeClient override.
void TpmAttestationDeleteKeysByPrefix(
attestation::AttestationKeyType key_type,
const cryptohome::AccountIdentifier& id,
const std::string& key_prefix,
DBusMethodCallback<bool> callback) override {
dbus::MethodCall method_call(
cryptohome::kCryptohomeInterface,
cryptohome::kCryptohomeTpmAttestationDeleteKeys);
dbus::MessageWriter writer(&method_call);
bool is_user_specific = (key_type == attestation::KEY_USER);
writer.AppendBool(is_user_specific);
writer.AppendString(id.account_id());
writer.AppendString(key_prefix);
CallBoolMethod(&method_call, std::move(callback));
}
// CryptohomeClient override.
void TpmAttestationDeleteKey(attestation::AttestationKeyType key_type,
const cryptohome::AccountIdentifier& id,
const std::string& key_name,
DBusMethodCallback<bool> callback) override {
dbus::MethodCall method_call(
cryptohome::kCryptohomeInterface,
cryptohome::kCryptohomeTpmAttestationDeleteKey);
dbus::MessageWriter writer(&method_call);
bool is_user_specific = (key_type == attestation::KEY_USER);
writer.AppendBool(is_user_specific);
writer.AppendString(id.account_id());
writer.AppendString(key_name);
CallBoolMethod(&method_call, std::move(callback));
}
// CryptohomeClient override. // CryptohomeClient override.
void TpmGetVersion(DBusMethodCallback<TpmVersionInfo> callback) override { void TpmGetVersion(DBusMethodCallback<TpmVersionInfo> callback) override {
dbus::MethodCall method_call( dbus::MethodCall method_call(
......
...@@ -481,29 +481,6 @@ class COMPONENT_EXPORT(CRYPTOHOME_CLIENT) CryptohomeClient { ...@@ -481,29 +481,6 @@ class COMPONENT_EXPORT(CRYPTOHOME_CLIENT) CryptohomeClient {
const std::string& payload, const std::string& payload,
DBusMethodCallback<bool> callback) = 0; DBusMethodCallback<bool> callback) = 0;
// Deletes certified keys as specified by |key_type| and |key_prefix|. The
// |callback| will be called when the operation completes. If the operation
// succeeds, the callback |result| parameter will be true. If |key_type| is
// KEY_USER, a |id| must be provided. Otherwise |id| is ignored.
// All keys where the key name has a prefix matching |key_prefix| will be
// deleted. All meta-data associated with the key, including certificates,
// will also be deleted.
virtual void TpmAttestationDeleteKeysByPrefix(
attestation::AttestationKeyType key_type,
const cryptohome::AccountIdentifier& id,
const std::string& key_prefix,
DBusMethodCallback<bool> callback) = 0;
// Deletes certified keys as specified by |key_type| and |key_name|. The
// |callback| will be called when the operation completes. If the operation
// succeeds, the callback |result| parameter will be true. If |key_type| is
// KEY_USER, a |id| must be provided. Otherwise |id| is ignored.
// Note that if the key does not exist, the operation will still succeed.
virtual void TpmAttestationDeleteKey(attestation::AttestationKeyType key_type,
const cryptohome::AccountIdentifier& id,
const std::string& key_name,
DBusMethodCallback<bool> callback) = 0;
// Asynchronously gets the underlying TPM version information and passes it to // Asynchronously gets the underlying TPM version information and passes it to
// the given callback. // the given callback.
virtual void TpmGetVersion(DBusMethodCallback<TpmVersionInfo> callback) = 0; virtual void TpmGetVersion(DBusMethodCallback<TpmVersionInfo> callback) = 0;
......
...@@ -519,24 +519,6 @@ void FakeCryptohomeClient::TpmAttestationSetKeyPayload( ...@@ -519,24 +519,6 @@ void FakeCryptohomeClient::TpmAttestationSetKeyPayload(
FROM_HERE, base::BindOnce(std::move(callback), result)); FROM_HERE, base::BindOnce(std::move(callback), result));
} }
void FakeCryptohomeClient::TpmAttestationDeleteKeysByPrefix(
attestation::AttestationKeyType key_type,
const cryptohome::AccountIdentifier& cryptohome_id,
const std::string& key_prefix,
DBusMethodCallback<bool> callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), true));
}
void FakeCryptohomeClient::TpmAttestationDeleteKey(
attestation::AttestationKeyType key_type,
const cryptohome::AccountIdentifier& cryptohome_id,
const std::string& key_name,
DBusMethodCallback<bool> callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), true));
}
void FakeCryptohomeClient::TpmGetVersion( void FakeCryptohomeClient::TpmGetVersion(
DBusMethodCallback<TpmVersionInfo> callback) { DBusMethodCallback<TpmVersionInfo> callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask( base::ThreadTaskRunnerHandle::Get()->PostTask(
......
...@@ -168,16 +168,6 @@ class COMPONENT_EXPORT(CRYPTOHOME_CLIENT) FakeCryptohomeClient ...@@ -168,16 +168,6 @@ class COMPONENT_EXPORT(CRYPTOHOME_CLIENT) FakeCryptohomeClient
const std::string& key_name, const std::string& key_name,
const std::string& payload, const std::string& payload,
DBusMethodCallback<bool> callback) override; DBusMethodCallback<bool> callback) override;
void TpmAttestationDeleteKeysByPrefix(
attestation::AttestationKeyType key_type,
const cryptohome::AccountIdentifier& cryptohome_id,
const std::string& key_prefix,
DBusMethodCallback<bool> callback) override;
void TpmAttestationDeleteKey(
attestation::AttestationKeyType key_type,
const cryptohome::AccountIdentifier& cryptohome_id,
const std::string& key_name,
DBusMethodCallback<bool> callback) override;
void TpmGetVersion(DBusMethodCallback<TpmVersionInfo> callback) override; void TpmGetVersion(DBusMethodCallback<TpmVersionInfo> callback) override;
void GetKeyDataEx( void GetKeyDataEx(
const cryptohome::AccountIdentifier& cryptohome_id, const cryptohome::AccountIdentifier& cryptohome_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment