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

Unified Diff: tpm.h

Issue 3118014: Update TPM initialization to better handle errors. (Closed) Base URL: http://src.chromium.org/git/tpm_init.git
Patch Set: Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tpm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tpm.h
diff --git a/tpm.h b/tpm.h
index 2a9606853b7fa27a11ee4e6090a91e3dd581e232..559c053d879551bfab1996ce11271d26fb4b0d78 100644
--- a/tpm.h
+++ b/tpm.h
@@ -61,6 +61,9 @@ class Tpm {
// currently being taken (such as on a separate thread).
bool IsOwned() const { return is_owned_; }
+ // Returns whether or not the SRK is available
+ bool IsSrkAvailable() const { return is_srk_available_; }
+
// Runs the TPM initialization sequence. This may take a long time due to the
// call to Tspi_TPM_TakeOwnership.
bool InitializeTpm();
@@ -87,19 +90,15 @@ class Tpm {
// entry in /sys/class/misc
bool IsOwnedCheckViaSysfs();
- // Returns whether or not the TPM is disabled using a call to
- // Tspi_TPM_GetCapability
- //
- // Parameters
- // context_handle - The context handle for the TPM session
- bool IsDisabledCheckViaContext(TSS_HCONTEXT context_handle);
-
- // Returns whether or not the TPM is owned using a call to
+ // Returns whether or not the TPM is enabled and owned using a call to
// Tspi_TPM_GetCapability
//
// Parameters
// context_handle - The context handle for the TPM session
- bool IsOwnedCheckViaContext(TSS_HCONTEXT context_handle);
+ // enabled (OUT) - Whether the TPM is enabled
+ // owned (OUT) - Whether the TPM is owned
+ void IsEnabledOwnedCheckViaContext(TSS_HCONTEXT context_handle,
+ bool* enabled, bool* owned);
// Attempts to create the endorsement key in the TPM
//
@@ -126,7 +125,8 @@ class Tpm {
// context_handle - The context handle for the TPM session
// max_timeout_tries - The maximum number of attempts to make if the call
// times out, which it may occasionally do
- bool TakeOwnership(TSS_HCONTEXT context_handle, int max_timeout_tries);
+ bool TakeOwnership(TSS_HCONTEXT context_handle, int max_timeout_tries,
+ const SecureBlob& owner_password);
// Zeros the SRK password (sets it to an empty string)
//
@@ -144,6 +144,16 @@ class Tpm {
bool UnrestrictSrk(TSS_HCONTEXT context_handle,
const SecureBlob& owner_password);
+ // Changes the owner password
+ //
+ // Parameters
+ // context_handle - The context handle for the TPM session
+ // previous_owner_password - The previous owner password for the TPM
+ // owner_password - The owner password for the TPM
+ bool ChangeOwnerPassword(TSS_HCONTEXT context_handle,
+ const SecureBlob& previous_owner_password,
+ const SecureBlob& owner_password);
+
// Gets a handle to the TPM from the specified context
//
// Parameters
@@ -162,6 +172,12 @@ class Tpm {
const SecureBlob& owner_password,
TSS_HTPM* tpm_handle);
+ // Test the TPM auth by calling Tspi_TPM_GetStatus
+ //
+ // Parameters
+ // tpm_handle = The TPM handle
+ bool TestTpmAuth(TSS_HTPM tpm_handle);
+
// The context handle for this TPM session
TSS_HCONTEXT context_handle_;
@@ -185,6 +201,9 @@ class Tpm {
// Indicates if the TPM is owned
bool is_owned_;
+ // Indicates if the SRK is available
+ bool is_srk_available_;
+
DISALLOW_COPY_AND_ASSIGN(Tpm);
};
« no previous file with comments | « no previous file | tpm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698