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

Side by Side Diff: chrome/browser/chromeos/login/quick_unlock/pin_storage.cc

Issue 2289393002: Disable pin unlock for m53 only. (Closed)
Patch Set: Created 4 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 | « no previous file | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/quick_unlock/pin_storage.h" 5 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "chrome/common/pref_names.h" 9 #include "chrome/common/pref_names.h"
10 #include "chromeos/login/auth/key.h" 10 #include "chromeos/login/auth/key.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 std::string PinStorage::PinSalt() const { 98 std::string PinStorage::PinSalt() const {
99 return pref_service_->GetString(prefs::kQuickUnlockPinSalt); 99 return pref_service_->GetString(prefs::kQuickUnlockPinSalt);
100 } 100 }
101 101
102 std::string PinStorage::PinSecret() const { 102 std::string PinStorage::PinSecret() const {
103 return pref_service_->GetString(prefs::kQuickUnlockPinSecret); 103 return pref_service_->GetString(prefs::kQuickUnlockPinSecret);
104 } 104 }
105 105
106 bool PinStorage::IsPinAuthenticationAvailable() const { 106 bool PinStorage::IsPinAuthenticationAvailable() const {
107 return IsPinSet() && unlock_attempt_count() < kMaximumUnlockAttempts && 107 return false;
108 HasStrongAuth() && TimeSinceLastStrongAuth() < kStrongAuthTimeout;
109 } 108 }
110 109
111 bool PinStorage::TryAuthenticatePin(const std::string& pin) { 110 bool PinStorage::TryAuthenticatePin(const std::string& pin) {
112 if (!IsPinAuthenticationAvailable()) 111 if (!IsPinAuthenticationAvailable())
113 return false; 112 return false;
114 113
115 AddUnlockAttempt(); 114 AddUnlockAttempt();
116 return ComputeSecret(pin, PinSalt()) == PinSecret(); 115 return ComputeSecret(pin, PinSalt()) == PinSecret();
117 } 116 }
118 117
119 } // namespace chromeos 118 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698