Commit 805d18e6 authored by Taras Antoshchuk's avatar Taras Antoshchuk Committed by Commit Bot

Fallback to software TPM if needed

Use software TPM implementation by default if
tpm_fallback=true is in build arguments

TEST=manual
BUG=b:146479130

Change-Id: Ibc6e17c97554ee6c685cedff9ca0b11bea738f2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2062995
Commit-Queue: Taras Antoshchuk <tantoshchuk@google.com>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Reviewed-by: default avatarPolina Bondarenko <pbond@chromium.org>
Auto-Submit: Taras Antoshchuk <tantoshchuk@google.com>
Cr-Commit-Position: refs/heads/master@{#746308}
parent d61c9147
...@@ -5432,6 +5432,10 @@ jumbo_static_library("browser") { ...@@ -5432,6 +5432,10 @@ jumbo_static_library("browser") {
if (is_android && notouch_build) { if (is_android && notouch_build) {
configs += [ ":notouch_config" ] configs += [ ":notouch_config" ]
} }
if (tpm_fallback) {
defines += [ "TPM_FALLBACK" ]
}
} }
config("notouch_config") { config("notouch_config") {
......
...@@ -4,4 +4,5 @@ ...@@ -4,4 +4,5 @@
declare_args() { declare_args() {
enable_kaleidoscope = false enable_kaleidoscope = false
tpm_fallback = false
} }
...@@ -181,6 +181,14 @@ void StartTPMSlotInitializationOnIOThread(const AccountId& account_id, ...@@ -181,6 +181,14 @@ void StartTPMSlotInitializationOnIOThread(const AccountId& account_id,
base::BindOnce(&GetTPMInfoForUserOnUIThread, account_id, username_hash)); base::BindOnce(&GetTPMInfoForUserOnUIThread, account_id, username_hash));
} }
bool IsTPMTokenEnabledForNSS() {
#if !defined(TPM_FALLBACK)
return crypto::IsTPMTokenEnabledForNSS();
#else
return false;
#endif
}
void StartNSSInitOnIOThread(const AccountId& account_id, void StartNSSInitOnIOThread(const AccountId& account_id,
const std::string& username_hash, const std::string& username_hash,
const base::FilePath& path) { const base::FilePath& path) {
...@@ -199,7 +207,7 @@ void StartNSSInitOnIOThread(const AccountId& account_id, ...@@ -199,7 +207,7 @@ void StartNSSInitOnIOThread(const AccountId& account_id,
crypto::WillInitializeTPMForChromeOSUser(username_hash); crypto::WillInitializeTPMForChromeOSUser(username_hash);
if (crypto::IsTPMTokenEnabledForNSS()) { if (IsTPMTokenEnabledForNSS()) {
if (crypto::IsTPMTokenReady( if (crypto::IsTPMTokenReady(
base::Bind(&StartTPMSlotInitializationOnIOThread, account_id, base::Bind(&StartTPMSlotInitializationOnIOThread, account_id,
username_hash))) { username_hash))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment