Botan 3.6.0
Crypto and TLS for C&
Botan::TPM2::detail::SessionHandle Class Referencefinal

#include <tpm2_session.h>

Public Member Functions

 operator ESYS_TR () &&noexcept
 
SessionHandleoperator= (const SessionHandle &)=delete
 
SessionHandleoperator= (SessionHandle &&)=delete
 
 SessionHandle ()=default
 
 SessionHandle (const SessionHandle &)=delete
 
 SessionHandle (SessionHandle &&)=delete
 
 ~SessionHandle ()
 

Friends

class Botan::TPM2::Session
 

Detailed Description

This wraps a Session object and ensures that the session's attributes are restored to their original state after they have been modified by a (failing) TSS2 library function.

This is a workaround for the fact that TSS2 library calls may modify the session's attributes and not reset them when the call fails.

Definition at line 62 of file tpm2_session.h.

Constructor & Destructor Documentation

◆ SessionHandle() [1/3]

Botan::TPM2::detail::SessionHandle::SessionHandle ( )
default

◆ SessionHandle() [2/3]

Botan::TPM2::detail::SessionHandle::SessionHandle ( const SessionHandle & )
delete

◆ SessionHandle() [3/3]

Botan::TPM2::detail::SessionHandle::SessionHandle ( SessionHandle && )
delete

◆ ~SessionHandle()

Botan::TPM2::detail::SessionHandle::~SessionHandle ( )
inline

Definition at line 159 of file tpm2_session.h.

159 {
160 if(m_session) {
161 m_session->get().set_attributes(m_original_attributes);
162 }
163}

Member Function Documentation

◆ operator ESYS_TR()

Botan::TPM2::detail::SessionHandle::operator ESYS_TR ( ) &&
nodiscardnoexcept

Definition at line 127 of file tpm2_session.cpp.

127 {
128 if(m_session) {
129 return m_session->get().transient_handle();
130 } else {
131 return ESYS_TR_NONE;
132 }
133}

◆ operator=() [1/2]

SessionHandle & Botan::TPM2::detail::SessionHandle::operator= ( const SessionHandle & )
delete

◆ operator=() [2/2]

SessionHandle & Botan::TPM2::detail::SessionHandle::operator= ( SessionHandle && )
delete

Friends And Related Symbol Documentation

◆ Botan::TPM2::Session

friend class Botan::TPM2::Session
friend

Definition at line 75 of file tpm2_session.h.


The documentation for this class was generated from the following files: