Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(564)

Side by Side Diff: chromeos/dbus/cryptohome_client.cc

Issue 13638022: Added an options parameter to TpmAttestationSignEnterpriseChallenge. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/dbus/cryptohome_client.h ('k') | chromeos/dbus/mock_cryptohome_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/dbus/cryptohome_client.h" 5 #include "chromeos/dbus/cryptohome_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chromeos/cryptohome/async_method_caller.h" 9 #include "chromeos/cryptohome/async_method_caller.h"
10 #include "chromeos/dbus/blocking_method_caller.h" 10 #include "chromeos/dbus/blocking_method_caller.h"
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 weak_ptr_factory_.GetWeakPtr(), 512 weak_ptr_factory_.GetWeakPtr(),
513 callback)); 513 callback));
514 } 514 }
515 515
516 // CryptohomeClient override. 516 // CryptohomeClient override.
517 virtual void TpmAttestationSignEnterpriseChallenge( 517 virtual void TpmAttestationSignEnterpriseChallenge(
518 AttestationKeyType key_type, 518 AttestationKeyType key_type,
519 const std::string& key_name, 519 const std::string& key_name,
520 const std::string& domain, 520 const std::string& domain,
521 const std::string& device_id, 521 const std::string& device_id,
522 AttestationChallengeOptions options,
522 const std::string& challenge, 523 const std::string& challenge,
523 const AsyncMethodCallback& callback) OVERRIDE { 524 const AsyncMethodCallback& callback) OVERRIDE {
524 dbus::MethodCall method_call( 525 dbus::MethodCall method_call(
525 cryptohome::kCryptohomeInterface, 526 cryptohome::kCryptohomeInterface,
526 cryptohome::kCryptohomeTpmAttestationSignEnterpriseChallenge); 527 cryptohome::kCryptohomeTpmAttestationSignEnterpriseChallenge);
527 dbus::MessageWriter writer(&method_call); 528 dbus::MessageWriter writer(&method_call);
528 bool is_user_specific = (key_type == USER_KEY); 529 bool is_user_specific = (key_type == USER_KEY);
529 writer.AppendBool(is_user_specific); 530 writer.AppendBool(is_user_specific);
530 writer.AppendString(key_name); 531 writer.AppendString(key_name);
531 writer.AppendString(domain); 532 writer.AppendString(domain);
532 writer.AppendString(device_id); 533 writer.AppendString(device_id);
534 bool include_signed_public_key = (options & INCLUDE_SIGNED_PUBLIC_KEY);
535 writer.AppendBool(include_signed_public_key);
533 writer.AppendString(challenge); 536 writer.AppendString(challenge);
534 proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, 537 proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
535 base::Bind(&CryptohomeClientImpl::OnAsyncMethodCall, 538 base::Bind(&CryptohomeClientImpl::OnAsyncMethodCall,
536 weak_ptr_factory_.GetWeakPtr(), 539 weak_ptr_factory_.GetWeakPtr(),
537 callback)); 540 callback));
538 } 541 }
539 542
540 // CryptohomeClient override. 543 // CryptohomeClient override.
541 virtual void TpmAttestationSignSimpleChallenge( 544 virtual void TpmAttestationSignSimpleChallenge(
542 AttestationKeyType key_type, 545 AttestationKeyType key_type,
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 const AsyncMethodCallback& callback) OVERRIDE { 1048 const AsyncMethodCallback& callback) OVERRIDE {
1046 ReturnAsyncMethodResult(callback, true); 1049 ReturnAsyncMethodResult(callback, true);
1047 } 1050 }
1048 1051
1049 // CryptohomeClient override. 1052 // CryptohomeClient override.
1050 virtual void TpmAttestationSignEnterpriseChallenge( 1053 virtual void TpmAttestationSignEnterpriseChallenge(
1051 AttestationKeyType key_type, 1054 AttestationKeyType key_type,
1052 const std::string& key_name, 1055 const std::string& key_name,
1053 const std::string& domain, 1056 const std::string& domain,
1054 const std::string& device_id, 1057 const std::string& device_id,
1058 AttestationChallengeOptions options,
1055 const std::string& challenge, 1059 const std::string& challenge,
1056 const AsyncMethodCallback& callback) OVERRIDE { 1060 const AsyncMethodCallback& callback) OVERRIDE {
1057 ReturnAsyncMethodResult(callback, true); 1061 ReturnAsyncMethodResult(callback, true);
1058 } 1062 }
1059 1063
1060 // CryptohomeClient override. 1064 // CryptohomeClient override.
1061 virtual void TpmAttestationSignSimpleChallenge( 1065 virtual void TpmAttestationSignSimpleChallenge(
1062 AttestationKeyType key_type, 1066 AttestationKeyType key_type,
1063 const std::string& key_name, 1067 const std::string& key_name,
1064 const std::string& challenge, 1068 const std::string& challenge,
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 // static 1127 // static
1124 CryptohomeClient* CryptohomeClient::Create(DBusClientImplementationType type, 1128 CryptohomeClient* CryptohomeClient::Create(DBusClientImplementationType type,
1125 dbus::Bus* bus) { 1129 dbus::Bus* bus) {
1126 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 1130 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
1127 return new CryptohomeClientImpl(bus); 1131 return new CryptohomeClientImpl(bus);
1128 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); 1132 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
1129 return new CryptohomeClientStubImpl(); 1133 return new CryptohomeClientStubImpl();
1130 } 1134 }
1131 1135
1132 } // namespace chromeos 1136 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/cryptohome_client.h ('k') | chromeos/dbus/mock_cryptohome_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698