aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUtkarsh Sanghi <usanghi@google.com>2015-10-21 16:19:07 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-10-21 16:19:07 +0000
commitecb0a2a4cea6ceb2e8c0d587a95f5229a2be1f99 (patch)
treebe498a3390db947c3d6ab1ec212c89665da7f76f
parente4eff114cb9b4a79573820865e109a50f0e2e0c4 (diff)
parent5499a0e04e12b6280d826a2ca91e99227aa0ba05 (diff)
downloadtrunks-ecb0a2a4cea6ceb2e8c0d587a95f5229a2be1f99.tar.gz
Merge "trunks: Add ptr() method to ScopedKeyHandle"
-rw-r--r--scoped_key_handle.cc4
-rw-r--r--scoped_key_handle.h6
2 files changed, 9 insertions, 1 deletions
diff --git a/scoped_key_handle.cc b/scoped_key_handle.cc
index ab66c15..e8b4800 100644
--- a/scoped_key_handle.cc
+++ b/scoped_key_handle.cc
@@ -61,6 +61,10 @@ void ScopedKeyHandle::reset() {
reset(kInvalidHandle);
}
+TPM_HANDLE* ScopedKeyHandle::ptr() {
+ return &handle_;
+}
+
TPM_HANDLE ScopedKeyHandle::get() const {
return handle_;
}
diff --git a/scoped_key_handle.h b/scoped_key_handle.h
index aa0a4bd..ddd38cc 100644
--- a/scoped_key_handle.h
+++ b/scoped_key_handle.h
@@ -49,8 +49,12 @@ class TRUNKS_EXPORT ScopedKeyHandle {
// is injected.
virtual void reset();
+ // This method returns a pointer to the handle associated with this class.
+ // This method does not transfer ownership.
+ virtual TPM_HANDLE* ptr();
+
// This method returns the handle currectly associated with the class.
- // This method does not transfew ownership, therefore the handle returned
+ // This method does not transfer ownership, therefore the handle returned
// might be stale.
virtual TPM_HANDLE get() const;