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

Side by Side Diff: components/login/secure_module_util.cc

Issue 2856683002: cros: Replace "TPM" with "secure module" for machines without TPM. (Closed)
Patch Set: Use IO thread to check files. Created 3 years, 7 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
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/login/secure_module_util.h"
6
7 #include "base/bind.h"
8 #include "base/callback.h"
9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h"
11
12 namespace login {
13
14 namespace {
15
16 // If either of these two files exist, then we are using Cr50 and not using TPM.
17 constexpr char kCr50UsedIndicatorFile1[] =
18 "/opt/google/cr50/firmware/cr50.bin.prod";
19 constexpr char kCr50UsedIndicatorFile2[] = "/etc/init/cr50-update.conf";
20
21 SecureModuleUsed g_secure_module_used = SecureModuleUsed::UNQUERIED;
22
23 } // namespace
24
25 SecureModuleUsed GetSecureModuleUsed() {
26 return g_secure_module_used;
27 }
28
29 void QuerySecureModuleUsed() {
30 if (base::PathExists(base::FilePath(kCr50UsedIndicatorFile1)) ||
31 base::PathExists(base::FilePath(kCr50UsedIndicatorFile2))) {
32 g_secure_module_used = SecureModuleUsed::CR50;
33 return;
34 }
35
36 g_secure_module_used = SecureModuleUsed::TPM;
37 }
38
39 } // namespace secure_module_util
OLDNEW
« components/login/BUILD.gn ('K') | « components/login/secure_module_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698