summaryrefslogtreecommitdiff
path: root/server/tpm_connection.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/tpm_connection.h')
-rw-r--r--server/tpm_connection.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/tpm_connection.h b/server/tpm_connection.h
index a0f8fe5..833a972 100644
--- a/server/tpm_connection.h
+++ b/server/tpm_connection.h
@@ -5,10 +5,11 @@
#ifndef TPM_MANAGER_SERVER_TPM_CONNECTION_H_
#define TPM_MANAGER_SERVER_TPM_CONNECTION_H_
+#include <string>
+
#include <base/macros.h>
#include <trousers/scoped_tss_type.h>
-
namespace tpm_manager {
class TpmConnection {
@@ -16,14 +17,18 @@ class TpmConnection {
TpmConnection() = default;
~TpmConnection() = default;
- // This method tries to get a handle to the TPM. Returns 0 on failure.
- TSS_HTPM GetTpm();
-
// This method returns a handle to the current Tpm context.
// Note: this method still retains ownership of the context. If this class
// is deleted, the context handle will be invalidated. Returns 0 on failure.
TSS_HCONTEXT GetContext();
+ // This method tries to get a handle to the TPM. Returns 0 on failure.
+ TSS_HTPM GetTpm();
+
+ // This method tries to get a handle to the TPM and with the given owner
+ // password. Returns 0 on failure.
+ TSS_HTPM GetTpmWithAuth(const std::string& owner_password);
+
private:
// This method connects to the Tpm. Returns true on success.
bool ConnectContextIfNeeded();