diff options
author | Utkarsh Sanghi <usanghi@google.com> | 2015-10-21 16:19:07 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-10-21 16:19:07 +0000 |
commit | ecb0a2a4cea6ceb2e8c0d587a95f5229a2be1f99 (patch) | |
tree | be498a3390db947c3d6ab1ec212c89665da7f76f | |
parent | e4eff114cb9b4a79573820865e109a50f0e2e0c4 (diff) | |
parent | 5499a0e04e12b6280d826a2ca91e99227aa0ba05 (diff) | |
download | trunks-ecb0a2a4cea6ceb2e8c0d587a95f5229a2be1f99.tar.gz |
Merge "trunks: Add ptr() method to ScopedKeyHandle"
-rw-r--r-- | scoped_key_handle.cc | 4 | ||||
-rw-r--r-- | scoped_key_handle.h | 6 |
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; |