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

Unified Diff: chrome/browser/chromeos/login/owner_key_utils.cc

Issue 3141031: [Chrome OS] Wire up ownership API from libcros (Closed)
Patch Set: address davemoore comments Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
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;
}
« no previous file with comments | « chrome/browser/chromeos/login/owner_key_utils.h ('k') | chrome/browser/chromeos/login/owner_key_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698