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

Unified Diff: tpm_init.cc

Issue 3116014: Add method to get random bytes from the TPM. (Closed) Base URL: http://src.chromium.org/git/tpm_init.git
Patch Set: Change int to size_t. 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 | « tpm_init.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tpm_init.cc
diff --git a/tpm_init.cc b/tpm_init.cc
index 92f1c7e86d9de0e18a4e4dd98226e7f0d420d47d..e792141d52060cd328641cea1406e2fb63b6d58e 100644
--- a/tpm_init.cc
+++ b/tpm_init.cc
@@ -28,6 +28,7 @@ class TpmInitTask : public PlatformThread::Delegate {
bool IsTpmEnabled();
bool GetTpmPassword(chromeos::Blob* password);
long GetInitializationMillis();
+ bool GetRandomData(int length, chromeos::Blob* data);
private:
scoped_ptr<tpm_init::Tpm> default_tpm_;
@@ -44,6 +45,10 @@ TpmInit::TpmInit()
TpmInit::~TpmInit() {
}
+bool TpmInit::GetRandomData(int length, chromeos::Blob* data) {
+ return tpm_init_->GetRandomData(length, data);
+}
+
bool TpmInit::StartInitializeTpm() {
tpm_init_->Init();
if (!PlatformThread::CreateNonJoinable(0, tpm_init_.get())) {
@@ -125,4 +130,8 @@ long TpmInitTask::GetInitializationMillis() {
return initialization_time_;
}
+bool TpmInitTask::GetRandomData(int length, chromeos::Blob* data) {
+ return tpm_->GetRandomData(length, data);
+}
+
} // namespace tpm_init
« no previous file with comments | « tpm_init.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698