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

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

Issue 6538098: [Chrome OS] Owner keys are generated outside Chrome now; handle appropriately (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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 a47722cf77865ff1725b569d24ee6fd89543e975..c4725ee507c884720815d65897980db4b43ef950 100644
--- a/chrome/browser/chromeos/login/owner_key_utils.cc
+++ b/chrome/browser/chromeos/login/owner_key_utils.cc
@@ -40,13 +40,6 @@ class OwnerKeyUtilsImpl : public OwnerKeyUtils {
public:
OwnerKeyUtilsImpl();
- RSAPrivateKey* GenerateKeyPair();
-
- bool ExportPublicKeyViaDbus(RSAPrivateKey* pair,
- LoginLibrary::Delegate* d);
-
- bool ExportPublicKeyToFile(RSAPrivateKey* pair, const FilePath& key_file);
-
bool ImportPublicKey(const FilePath& key_file,
std::vector<uint8>* output);
@@ -65,14 +58,13 @@ class OwnerKeyUtilsImpl : public OwnerKeyUtils {
protected:
virtual ~OwnerKeyUtilsImpl();
+ bool ExportPublicKeyToFile(RSAPrivateKey* pair, const FilePath& key_file);
+
private:
// The file outside the owner's encrypted home directory where her
// key will live.
static const char kOwnerKeyFile[];
- // Key generation parameters.
- static const uint16 kKeySizeInBits;
-
DISALLOW_COPY_AND_ASSIGN(OwnerKeyUtilsImpl);
};
@@ -87,35 +79,10 @@ OwnerKeyUtils* OwnerKeyUtils::Create() {
// static
const char OwnerKeyUtilsImpl::kOwnerKeyFile[] = "/var/lib/whitelist/owner.key";
-// We're generating and using 2048-bit RSA keys.
-// static
-const uint16 OwnerKeyUtilsImpl::kKeySizeInBits = 2048;
-
OwnerKeyUtilsImpl::OwnerKeyUtilsImpl() {}
OwnerKeyUtilsImpl::~OwnerKeyUtilsImpl() {}
-RSAPrivateKey* OwnerKeyUtilsImpl::GenerateKeyPair() {
- return RSAPrivateKey::CreateSensitive(kKeySizeInBits);
-}
-
-bool OwnerKeyUtilsImpl::ExportPublicKeyViaDbus(RSAPrivateKey* pair,
- LoginLibrary::Delegate* d) {
- DCHECK(pair);
- bool ok = false;
-
- std::vector<uint8> to_export;
- if (!pair->ExportPublicKey(&to_export)) {
- LOG(ERROR) << "Formatting key for export via dbus failed!";
- return false;
- }
-
- if (CrosLibrary::Get()->EnsureLoaded())
- ok = CrosLibrary::Get()->GetLoginLibrary()->SetOwnerKeyAsync(to_export, d);
-
- return ok;
-}
-
bool OwnerKeyUtilsImpl::ExportPublicKeyToFile(RSAPrivateKey* pair,
const FilePath& key_file) {
DCHECK(pair);
« 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