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

Side by Side Diff: tpm.h

Issue 3236009: Add additional status APIs for the TPM. (Closed) Base URL: http://git.chromium.org/git/tpm_init.git
Patch Set: Created 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tpm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009-2010 The Chromium OS 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 // Tpm - class for handling init TPM initialization for Chrome OS 5 // Tpm - class for handling init TPM initialization for Chrome OS
6 6
7 #include <base/lock.h> 7 #include <base/lock.h>
8 #include <base/logging.h> 8 #include <base/logging.h>
9 #include <base/scoped_ptr.h> 9 #include <base/scoped_ptr.h>
10 #include <chromeos/utility.h> 10 #include <chromeos/utility.h>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 bool IsEnabled() const { return !is_disabled_; } 57 bool IsEnabled() const { return !is_disabled_; }
58 58
59 // Returns whether or not the TPM is owned. This method call returns a cached 59 // Returns whether or not the TPM is owned. This method call returns a cached
60 // result because querying the TPM directly will block if ownership is 60 // result because querying the TPM directly will block if ownership is
61 // currently being taken (such as on a separate thread). 61 // currently being taken (such as on a separate thread).
62 bool IsOwned() const { return is_owned_; } 62 bool IsOwned() const { return is_owned_; }
63 63
64 // Returns whether or not the SRK is available 64 // Returns whether or not the SRK is available
65 bool IsSrkAvailable() const { return is_srk_available_; } 65 bool IsSrkAvailable() const { return is_srk_available_; }
66 66
67 // Returns whether or not the TPM is being owned
68 bool IsBeingOwned() const { return is_being_owned_; }
69
67 // Runs the TPM initialization sequence. This may take a long time due to the 70 // Runs the TPM initialization sequence. This may take a long time due to the
68 // call to Tspi_TPM_TakeOwnership. 71 // call to Tspi_TPM_TakeOwnership.
69 bool InitializeTpm(); 72 bool InitializeTpm();
70 73
71 // Gets random bytes from the TPM 74 // Gets random bytes from the TPM
72 // 75 //
73 // Parameters 76 // Parameters
74 // length - The number of bytes to get 77 // length - The number of bytes to get
75 // data (OUT) - The random data from the TPM 78 // data (OUT) - The random data from the TPM
76 bool GetRandomData(size_t length, chromeos::Blob* data); 79 bool GetRandomData(size_t length, chromeos::Blob* data);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 207
205 // Indicates if the TPM is disabled 208 // Indicates if the TPM is disabled
206 bool is_disabled_; 209 bool is_disabled_;
207 210
208 // Indicates if the TPM is owned 211 // Indicates if the TPM is owned
209 bool is_owned_; 212 bool is_owned_;
210 213
211 // Indicates if the SRK is available 214 // Indicates if the SRK is available
212 bool is_srk_available_; 215 bool is_srk_available_;
213 216
217 // Indicates if the TPM is being owned
218 bool is_being_owned_;
219
214 DISALLOW_COPY_AND_ASSIGN(Tpm); 220 DISALLOW_COPY_AND_ASSIGN(Tpm);
215 }; 221 };
216 222
217 } // namespace tpm_init 223 } // namespace tpm_init
218 224
219 #endif // TPM_INIT_TPM_H_ 225 #endif // TPM_INIT_TPM_H_
OLDNEW
« 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