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

Side by Side Diff: chrome/browser/chromeos/login/owner_key_utils.cc

Issue 3278001: [Chrome OS] more of the ownership api (Closed)
Patch Set: fix MockLoginLibrary Created 10 years, 3 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
« no previous file with comments | « chrome/browser/chromeos/cros/mock_login_library.h ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/chromeos/login/owner_key_utils.h" 5 #include "chrome/browser/chromeos/login/owner_key_utils.h"
6 6
7 #include <keyhi.h> // SECKEY_CreateSubjectPublicKeyInfo() 7 #include <keyhi.h> // SECKEY_CreateSubjectPublicKeyInfo()
8 #include <pk11pub.h> 8 #include <pk11pub.h>
9 #include <prerror.h> // PR_GetError() 9 #include <prerror.h> // PR_GetError()
10 #include <secder.h> // DER_Encode() 10 #include <secder.h> // DER_Encode()
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 DCHECK(pair); 116 DCHECK(pair);
117 bool ok = false; 117 bool ok = false;
118 118
119 std::vector<uint8> to_export; 119 std::vector<uint8> to_export;
120 if (!pair->ExportPublicKey(&to_export)) { 120 if (!pair->ExportPublicKey(&to_export)) {
121 LOG(ERROR) << "Formatting key for export via dbus failed!"; 121 LOG(ERROR) << "Formatting key for export via dbus failed!";
122 return false; 122 return false;
123 } 123 }
124 124
125 if (CrosLibrary::Get()->EnsureLoaded()) 125 if (CrosLibrary::Get()->EnsureLoaded())
126 ok = CrosLibrary::Get()->GetLoginLibrary()->SetOwnerKey(to_export, d); 126 ok = CrosLibrary::Get()->GetLoginLibrary()->SetOwnerKeyAsync(to_export, d);
127 127
128 return ok; 128 return ok;
129 } 129 }
130 130
131 bool OwnerKeyUtilsImpl::ExportPublicKeyToFile(RSAPrivateKey* pair, 131 bool OwnerKeyUtilsImpl::ExportPublicKeyToFile(RSAPrivateKey* pair,
132 const FilePath& key_file) { 132 const FilePath& key_file) {
133 DCHECK(pair); 133 DCHECK(pair);
134 bool ok = false; 134 bool ok = false;
135 int safe_file_size = 0; 135 int safe_file_size = 0;
136 136
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 RSAPrivateKey* OwnerKeyUtilsImpl::FindPrivateKey( 206 RSAPrivateKey* OwnerKeyUtilsImpl::FindPrivateKey(
207 const std::vector<uint8>& key) { 207 const std::vector<uint8>& key) {
208 return RSAPrivateKey::FindFromPublicKeyInfo(key); 208 return RSAPrivateKey::FindFromPublicKeyInfo(key);
209 } 209 }
210 210
211 FilePath OwnerKeyUtilsImpl::GetOwnerKeyFilePath() { 211 FilePath OwnerKeyUtilsImpl::GetOwnerKeyFilePath() {
212 return FilePath(OwnerKeyUtilsImpl::kOwnerKeyFile); 212 return FilePath(OwnerKeyUtilsImpl::kOwnerKeyFile);
213 } 213 }
214 214
215 } // namespace chromeos 215 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros/mock_login_library.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698