| Index: chrome/browser/chromeos/login/owner_key_utils.cc
|
| diff --git a/chrome/browser/chromeos/login/owner_key_utils.cc b/chrome/browser/chromeos/login/owner_key_utils.cc
|
| index 47d952935f0b8c529451dfa6739b49a88202fc3d..ea58a54ac3f10524dfe76bf7abdbdfa4cc67a143 100644
|
| --- a/chrome/browser/chromeos/login/owner_key_utils.cc
|
| +++ b/chrome/browser/chromeos/login/owner_key_utils.cc
|
| @@ -20,6 +20,8 @@
|
| #include "base/nss_util.h"
|
| #include "base/scoped_ptr.h"
|
| #include "base/string_util.h"
|
| +#include "chrome/browser/chromeos/cros/cros_library.h"
|
| +#include "chrome/browser/chromeos/cros/login_library.h"
|
|
|
| using base::RSAPrivateKey;
|
|
|
| @@ -41,11 +43,11 @@ OwnerKeyUtils::~OwnerKeyUtils() {}
|
| class OwnerKeyUtilsImpl : public OwnerKeyUtils {
|
| public:
|
| OwnerKeyUtilsImpl();
|
| - virtual ~OwnerKeyUtilsImpl();
|
|
|
| RSAPrivateKey* GenerateKeyPair();
|
|
|
| - bool ExportPublicKeyViaDbus(RSAPrivateKey* pair);
|
| + bool ExportPublicKeyViaDbus(RSAPrivateKey* pair,
|
| + LoginLibrary::Delegate<bool>* d);
|
|
|
| bool ExportPublicKeyToFile(RSAPrivateKey* pair, const FilePath& key_file);
|
|
|
| @@ -56,6 +58,9 @@ class OwnerKeyUtilsImpl : public OwnerKeyUtils {
|
|
|
| FilePath GetOwnerKeyFilePath();
|
|
|
| + protected:
|
| + virtual ~OwnerKeyUtilsImpl();
|
| +
|
| private:
|
| // The file outside the owner's encrypted home directory where her
|
| // key will live.
|
| @@ -93,7 +98,9 @@ RSAPrivateKey* OwnerKeyUtilsImpl::GenerateKeyPair() {
|
| return RSAPrivateKey::CreateSensitive(kKeySizeInBits);
|
| }
|
|
|
| -bool OwnerKeyUtilsImpl::ExportPublicKeyViaDbus(RSAPrivateKey* pair) {
|
| +bool OwnerKeyUtilsImpl::ExportPublicKeyViaDbus(
|
| + RSAPrivateKey* pair,
|
| + LoginLibrary::Delegate<bool>* d) {
|
| DCHECK(pair);
|
| bool ok = false;
|
|
|
| @@ -103,7 +110,9 @@ bool OwnerKeyUtilsImpl::ExportPublicKeyViaDbus(RSAPrivateKey* pair) {
|
| return false;
|
| }
|
|
|
| - // TODO(cmasone): send the data over dbus.
|
| + if (CrosLibrary::Get()->EnsureLoaded())
|
| + ok = CrosLibrary::Get()->GetLoginLibrary()->SetOwnerKey(to_export, d);
|
| +
|
| return ok;
|
| }
|
|
|
|
|