diff options
author | Utkarsh Sanghi <usanghi@chromium.org> | 2015-08-31 12:18:55 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-09-01 19:19:12 -0700 |
commit | 565f88fe8ebdabefe07e5d5cb65ae9bcab509368 (patch) | |
tree | a24cb29a35fd131ccbf91ac90adcd518c89d8463 /server/tpm_status_impl.h | |
parent | c8573194d35f6b6c5033aedbef1ef5b07771792b (diff) | |
download | tpm_manager-565f88fe8ebdabefe07e5d5cb65ae9bcab509368.tar.gz |
tpm_manager: Move Tpm1.2 context connection to its own class
TpmStatusImpl and TpmInitializerImpl both need to connect to the Tpm
using Trousers. This code is now abstracted out into a TpmConnection
class.
BUG=chromium:521635
TEST=tpm_manager_client --status on a DUT with Tpm1.2
Change-Id: Ie1eda50fddfc6354fd8bfd43965f044d52f9d1fd
Reviewed-on: https://chromium-review.googlesource.com/296431
Commit-Ready: Utkarsh Sanghi <usanghi@chromium.org>
Tested-by: Utkarsh Sanghi <usanghi@chromium.org>
Reviewed-by: Utkarsh Sanghi <usanghi@chromium.org>
Diffstat (limited to 'server/tpm_status_impl.h')
-rw-r--r-- | server/tpm_status_impl.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/server/tpm_status_impl.h b/server/tpm_status_impl.h index ca38342..cbc3c88 100644 --- a/server/tpm_status_impl.h +++ b/server/tpm_status_impl.h @@ -7,13 +7,15 @@ #include "tpm_manager/server/tpm_status.h" +#include <memory> #include <string> #include <base/macros.h> -#include <trousers/scoped_tss_type.h> #include <trousers/tss.h> #include <trousers/trousers.h> // NOLINT(build/include_alpha) +#include <tpm_manager/server/tpm_connection.h> + namespace tpm_manager { class TpmStatusImpl : public TpmStatus { @@ -40,12 +42,8 @@ class TpmStatusImpl : public TpmStatus { uint32_t sub_capability, std::string* data, TSS_RESULT* tpm_result); - // This method tries to get a handle to the TPM. Returns 0 on failure. - TSS_HTPM GetTpm(); - // This method connects to the Tpm. Returns true on success. - bool ConnectContext(); - trousers::ScopedTssContext context_; + TpmConnection tpm_connection_; bool is_enabled_{false}; bool is_owned_{false}; bool is_enable_initialized_{false}; |