Botan 3.6.1
Crypto and TLS for C&
|
#include <botan/ffi.h>
#include <botan/internal/ffi_pkey.h>
#include <botan/internal/ffi_rng.h>
#include <botan/internal/ffi_util.h>
Go to the source code of this file.
Functions | |
int | botan_tpm2_ctx_destroy (botan_tpm2_ctx_t ctx) |
int | botan_tpm2_ctx_enable_crypto_backend (botan_tpm2_ctx_t ctx, botan_rng_t rng) |
int | botan_tpm2_ctx_init (botan_tpm2_ctx_t *ctx_out, const char *tcti_nameconf) |
int | botan_tpm2_ctx_init_ex (botan_tpm2_ctx_t *ctx_out, const char *tcti_name, const char *tcti_conf) |
int | botan_tpm2_rng_init (botan_rng_t *rng_out, botan_tpm2_ctx_t ctx, botan_tpm2_session_t s1, botan_tpm2_session_t s2, botan_tpm2_session_t s3) |
int | botan_tpm2_session_destroy (botan_tpm2_session_t session) |
int | botan_tpm2_supports_crypto_backend () |
int | botan_tpm2_unauthenticated_session_init (botan_tpm2_session_t *session_out, botan_tpm2_ctx_t ctx) |
int botan_tpm2_ctx_destroy | ( | botan_tpm2_ctx_t | ctx | ) |
Frees all resouces of a TPM2 context
ctx | TPM2 context |
Definition at line 149 of file ffi_tpm2.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
int botan_tpm2_ctx_enable_crypto_backend | ( | botan_tpm2_ctx_t | ctx, |
botan_rng_t | rng ) |
Enable Botan's TSS2 crypto backend that replaces the cryptographic functions required for the communication with the TPM with implementations provided by Botan instead of using TSS' defaults OpenSSL or mbedTLS. Note that the provided rng
should not be dependent on the TPM and the caller must ensure that it remains usable for the lifetime of the ctx
.
ctx | TPM2 context |
rng | random number generator to be used by the crypto backend |
Definition at line 126 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::safe_get().
int botan_tpm2_ctx_init | ( | botan_tpm2_ctx_t * | ctx_out, |
const char * | tcti_nameconf ) |
Initialize a TPM2 context
ctx_out | output TPM2 context |
tcti_nameconf | TCTI config (may be nullptr) |
Definition at line 66 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan::TPM2::Context::create(), and Botan_FFI::ffi_guard_thunk().
int botan_tpm2_ctx_init_ex | ( | botan_tpm2_ctx_t * | ctx_out, |
const char * | tcti_name, | ||
const char * | tcti_conf ) |
Initialize a TPM2 context
ctx_out | output TPM2 context |
tcti_name | TCTI name (may be nullptr) |
tcti_conf | TCTI config (may be nullptr) |
Definition at line 92 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan::TPM2::Context::create(), and Botan_FFI::ffi_guard_thunk().
int botan_tpm2_rng_init | ( | botan_rng_t * | rng_out, |
botan_tpm2_ctx_t | ctx, | ||
botan_tpm2_session_t | s1, | ||
botan_tpm2_session_t | s2, | ||
botan_tpm2_session_t | s3 ) |
Initialize a random number generator object via TPM2
rng_out | rng object to create |
ctx | TPM2 context |
s1 | the first session to use (optional, may be nullptr) |
s2 | the second session to use (optional, may be nullptr) |
s3 | the third session to use (optional, may be nullptr) |
Definition at line 158 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
int botan_tpm2_session_destroy | ( | botan_tpm2_session_t | session | ) |
Create an unauthenticated session for use with TPM2
session | the session object to destroy |
Definition at line 197 of file ffi_tpm2.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
int botan_tpm2_supports_crypto_backend | ( | ) |
Checks if Botan's TSS2 crypto backend can be used in this build
Definition at line 58 of file ffi_tpm2.cpp.
References Botan::TPM2::Context::supports_botan_crypto_backend().
int botan_tpm2_unauthenticated_session_init | ( | botan_tpm2_session_t * | session_out, |
botan_tpm2_ctx_t | ctx ) |
Create an unauthenticated session for use with TPM2
session_out | the session object to create |
ctx | TPM2 context |
Definition at line 179 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::TPM2::Session::unauthenticated_session().