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

Unified Diff: secure_blob.h

Issue 3048029: Initial version of tpm_init, a library for taking ownership of the TPM. (Closed) Base URL: ssh://git@chromiumos-git/tpm_init.git
Patch Set: Minor fix to the error code check from TakeOwnership. Created 10 years, 5 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 | « main.cc ('k') | secure_blob.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: secure_blob.h
diff --git a/secure_blob.h b/secure_blob.h
new file mode 100644
index 0000000000000000000000000000000000000000..fff1a6f7219320164a282f278455bfd270d54743
--- /dev/null
+++ b/secure_blob.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef TPM_INIT_SECURE_BLOB_H_
+#define TPM_INIT_SECURE_BLOB_H_
+
+#include <chromeos/utility.h>
+
+namespace tpm_init {
+
+typedef unsigned char SecureBlobElement;
+
+// SecureBlob erases the contents on destruction. It does not guarantee erasure
+// on resize, assign, etc.
+class SecureBlob : public chromeos::Blob {
+ public:
+ SecureBlob();
+ SecureBlob(chromeos::Blob::const_iterator begin,
+ chromeos::Blob::const_iterator end);
+ explicit SecureBlob(int size);
+ SecureBlob(const unsigned char* from, int from_length);
+ SecureBlob(const char* from, int from_length);
+ virtual ~SecureBlob();
+
+ void resize(size_type sz);
+ void resize(size_type sz, const SecureBlobElement& x);
+
+ void clear_contents();
+
+ void* data();
+ const void* const_data() const;
+};
+
+} // tpm_init
+
+#endif // TPM_INIT_SECURE_BLOB_H_
« no previous file with comments | « main.cc ('k') | secure_blob.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698