fake_cryptohome_client.cc revision c2e0dbddbe15c98d52c4786dac06cb8952a8ae6d
1// Copyright (c) 2013 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#include "chromeos/dbus/fake_cryptohome_client.h" 6 7#include "base/bind.h" 8#include "base/message_loop.h" 9 10namespace chromeos { 11 12namespace { 13 14// A fake system salt. GetSystemSalt copies it to the given buffer. 15const char kStubSystemSalt[] = "stub_system_salt"; 16 17} // namespace 18 19FakeCryptohomeClient::FakeCryptohomeClient() { 20} 21 22FakeCryptohomeClient::~FakeCryptohomeClient() { 23} 24 25void FakeCryptohomeClient::TpmIsBeingOwned( 26 const BoolDBusMethodCallback& callback) { 27} 28 29bool FakeCryptohomeClient::Unmount(bool* success) { 30 return false; 31} 32 33void FakeCryptohomeClient::AsyncCheckKey(const std::string& username, 34 const std::string& key, 35 const AsyncMethodCallback& callback) { 36} 37 38bool FakeCryptohomeClient::InstallAttributesIsInvalid(bool* is_invalid) { 39 return false; 40} 41 42void FakeCryptohomeClient::TpmAttestationGetKeyPayload( 43 attestation::AttestationKeyType key_type, 44 const std::string& key_name, 45 const DataMethodCallback& callback) { 46} 47 48void FakeCryptohomeClient::AsyncTpmAttestationFinishCertRequest( 49 const std::string& pca_response, 50 attestation::AttestationKeyType key_type, 51 const std::string& key_name, 52 const AsyncMethodCallback& callback) { 53} 54 55void FakeCryptohomeClient::TpmIsEnabled( 56 const BoolDBusMethodCallback& callback) { 57} 58 59void FakeCryptohomeClient::AsyncTpmAttestationEnroll( 60 const std::string& pca_response, 61 const AsyncMethodCallback& callback) { 62} 63 64void FakeCryptohomeClient::AsyncMigrateKey( 65 const std::string& username, 66 const std::string& from_key, 67 const std::string& to_key, 68 const AsyncMethodCallback& callback) { 69} 70 71void FakeCryptohomeClient::IsMounted(const BoolDBusMethodCallback& callback) { 72 MessageLoop::current()->PostTask(FROM_HERE, 73 base::Bind(callback, 74 DBUS_METHOD_CALL_SUCCESS, true)); 75} 76 77bool FakeCryptohomeClient::InstallAttributesGet(const std::string& name, 78 std::vector<uint8>* value, 79 bool* successful) { 80 return false; 81} 82 83void FakeCryptohomeClient::AsyncMount(const std::string& username, 84 const std::string& key, int flags, 85 const AsyncMethodCallback& callback) { 86} 87 88void FakeCryptohomeClient::AsyncMountGuest( 89 const AsyncMethodCallback& callback) { 90} 91 92bool FakeCryptohomeClient::CallTpmIsBeingOwnedAndBlock(bool* owning) { 93 return false; 94} 95 96void FakeCryptohomeClient::Pkcs11IsTpmTokenReady( 97 const BoolDBusMethodCallback& callback) { 98} 99 100void FakeCryptohomeClient::TpmClearStoredPassword( 101 const VoidDBusMethodCallback& callback) { 102} 103 104void FakeCryptohomeClient::TpmCanAttemptOwnership( 105 const VoidDBusMethodCallback& callback) { 106} 107 108bool FakeCryptohomeClient::GetSystemSalt(std::vector<uint8>* salt) { 109 salt->assign(kStubSystemSalt, 110 kStubSystemSalt + arraysize(kStubSystemSalt) - 1); 111 return true; 112} 113 114void FakeCryptohomeClient::TpmGetPassword( 115 const StringDBusMethodCallback& callback) { 116} 117 118bool FakeCryptohomeClient::InstallAttributesFinalize(bool* successful) { 119 return false; 120} 121 122void FakeCryptohomeClient::SetAsyncCallStatusHandlers( 123 const AsyncCallStatusHandler& handler, 124 const AsyncCallStatusWithDataHandler& data_handler) { 125} 126 127bool FakeCryptohomeClient::CallTpmIsEnabledAndBlock(bool* enabled) { 128 return false; 129} 130 131bool FakeCryptohomeClient::InstallAttributesSet( 132 const std::string& name, 133 const std::vector<uint8>& value, 134 bool* successful) { 135 return false; 136} 137 138bool FakeCryptohomeClient::InstallAttributesIsFirstInstall( 139 bool* is_first_install) { 140 return false; 141} 142 143void FakeCryptohomeClient::TpmAttestationGetCertificate( 144 attestation::AttestationKeyType key_type, 145 const std::string& key_name, 146 const DataMethodCallback& callback) { 147} 148 149void FakeCryptohomeClient::InstallAttributesIsReady( 150 const BoolDBusMethodCallback& callback) { 151 MessageLoop::current()->PostTask(FROM_HERE, 152 base::Bind(callback, 153 DBUS_METHOD_CALL_SUCCESS, true)); 154} 155 156void FakeCryptohomeClient::TpmAttestationGetPublicKey( 157 attestation::AttestationKeyType key_type, 158 const std::string& key_name, 159 const DataMethodCallback& callback) { 160} 161 162void FakeCryptohomeClient::TpmAttestationSignSimpleChallenge( 163 attestation::AttestationKeyType key_type, 164 const std::string& key_name, 165 const std::string& challenge, 166 const AsyncMethodCallback& callback) { 167} 168 169void FakeCryptohomeClient::Pkcs11GetTpmTokenInfo( 170 const Pkcs11GetTpmTokenInfoCallback& callback) { 171} 172 173void FakeCryptohomeClient::TpmIsOwned(const BoolDBusMethodCallback& callback) { 174} 175 176void FakeCryptohomeClient::TpmAttestationIsPrepared( 177 const BoolDBusMethodCallback& callback) { 178} 179 180void FakeCryptohomeClient::TpmIsReady(const BoolDBusMethodCallback& callback) { 181} 182 183void FakeCryptohomeClient::AsyncTpmAttestationCreateEnrollRequest( 184 const AsyncMethodCallback& callback) { 185} 186 187void FakeCryptohomeClient::ResetAsyncCallStatusHandlers() { 188} 189 190void FakeCryptohomeClient::TpmAttestationDoesKeyExist( 191 attestation::AttestationKeyType key_type, 192 const std::string& key_name, 193 const BoolDBusMethodCallback& callback) { 194} 195 196bool FakeCryptohomeClient::CallTpmIsOwnedAndBlock(bool* owned) { 197 return false; 198} 199 200void FakeCryptohomeClient::AsyncRemove(const std::string& username, 201 const AsyncMethodCallback& callback) { 202} 203 204void FakeCryptohomeClient::TpmAttestationSetKeyPayload( 205 attestation::AttestationKeyType key_type, 206 const std::string& key_name, 207 const std::string& payload, 208 const BoolDBusMethodCallback& callback) { 209} 210 211void FakeCryptohomeClient::GetSanitizedUsername( 212 const std::string& username, 213 const StringDBusMethodCallback& callback) { 214} 215 216void FakeCryptohomeClient::TpmAttestationSignEnterpriseChallenge( 217 attestation::AttestationKeyType key_type, 218 const std::string& key_name, 219 const std::string& domain, 220 const std::string& device_id, 221 attestation::AttestationChallengeOptions options, 222 const std::string& challenge, 223 const AsyncMethodCallback& callback) { 224} 225 226void FakeCryptohomeClient::TpmAttestationIsEnrolled( 227 const BoolDBusMethodCallback& callback) { 228} 229 230void FakeCryptohomeClient::TpmAttestationRegisterKey( 231 attestation::AttestationKeyType key_type, 232 const std::string& key_name, 233 const AsyncMethodCallback& callback) { 234} 235 236bool FakeCryptohomeClient::CallTpmClearStoredPasswordAndBlock() { 237 return false; 238} 239 240void FakeCryptohomeClient::AsyncTpmAttestationCreateCertRequest( 241 int options, 242 const AsyncMethodCallback& callback) { 243} 244 245} // namespace chromeos 246