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

Side by Side Diff: chrome/browser/chromeos/settings/owner_key_util.cc

Issue 382403002: Reduce log spam for linux-chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | chrome/common/logging_chrome.cc » ('j') | chrome/common/logging_chrome.cc » ('J')
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 "chrome/browser/chromeos/settings/owner_key_util.h" 5 #include "chrome/browser/chromeos/settings/owner_key_util.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "base/sys_info.h"
13 #include "chromeos/chromeos_paths.h" 14 #include "chromeos/chromeos_paths.h"
14 #include "crypto/rsa_private_key.h" 15 #include "crypto/rsa_private_key.h"
15 16
16 namespace chromeos { 17 namespace chromeos {
17 18
18 /////////////////////////////////////////////////////////////////////////// 19 ///////////////////////////////////////////////////////////////////////////
19 // PublicKey 20 // PublicKey
20 21
21 PublicKey::PublicKey() { 22 PublicKey::PublicKey() {
22 } 23 }
(...skipping 28 matching lines...) Expand all
51 52
52 OwnerKeyUtilImpl::OwnerKeyUtilImpl(const base::FilePath& key_file) 53 OwnerKeyUtilImpl::OwnerKeyUtilImpl(const base::FilePath& key_file)
53 : key_file_(key_file) {} 54 : key_file_(key_file) {}
54 55
55 OwnerKeyUtilImpl::~OwnerKeyUtilImpl() {} 56 OwnerKeyUtilImpl::~OwnerKeyUtilImpl() {}
56 57
57 bool OwnerKeyUtilImpl::ImportPublicKey(std::vector<uint8>* output) { 58 bool OwnerKeyUtilImpl::ImportPublicKey(std::vector<uint8>* output) {
58 // Get the file size (must fit in a 32 bit int for NSS). 59 // Get the file size (must fit in a 32 bit int for NSS).
59 int64 file_size; 60 int64 file_size;
60 if (!base::GetFileSize(key_file_, &file_size)) { 61 if (!base::GetFileSize(key_file_, &file_size)) {
61 LOG(ERROR) << "Could not get size of " << key_file_.value(); 62 LOG_IF(ERROR, base::SysInfo::IsRunningOnChromeOS())
63 << "Could not get size of " << key_file_.value();
62 return false; 64 return false;
63 } 65 }
64 if (file_size > static_cast<int64>(std::numeric_limits<int>::max())) { 66 if (file_size > static_cast<int64>(std::numeric_limits<int>::max())) {
65 LOG(ERROR) << key_file_.value() << "is " 67 LOG(ERROR) << key_file_.value() << "is "
66 << file_size << "bytes!!! Too big!"; 68 << file_size << "bytes!!! Too big!";
67 return false; 69 return false;
68 } 70 }
69 int32 safe_file_size = static_cast<int32>(file_size); 71 int32 safe_file_size = static_cast<int32>(file_size);
70 72
71 output->resize(safe_file_size); 73 output->resize(safe_file_size);
(...skipping 15 matching lines...) Expand all
87 const std::vector<uint8>& key, 89 const std::vector<uint8>& key,
88 PK11SlotInfo* slot) { 90 PK11SlotInfo* slot) {
89 return crypto::RSAPrivateKey::FindFromPublicKeyInfoInSlot(key, slot); 91 return crypto::RSAPrivateKey::FindFromPublicKeyInfoInSlot(key, slot);
90 } 92 }
91 93
92 bool OwnerKeyUtilImpl::IsPublicKeyPresent() { 94 bool OwnerKeyUtilImpl::IsPublicKeyPresent() {
93 return base::PathExists(key_file_); 95 return base::PathExists(key_file_);
94 } 96 }
95 97
96 } // namespace chromeos 98 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/common/logging_chrome.cc » ('j') | chrome/common/logging_chrome.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698