TSS2_TCTI_TABRMD_INIT(3)
π TSS2_TCTI_TABRMD_INIT π
okay bestie, gather round, because this one is literally the page for Tss2_Tcti_Tabrmd_Init β the initialization function for the tpm2-abrmd TCTI library, straight out of the TPM2 Software Stack manual. it's giving "hello, let me set up your whole connection to the daemon" energy and we're obsessed π
β¨ SYNOPSIS β¨
so Tss2_Tcti_Tabrmd_Init() is the function you call to spin up a TCTI context that talks to tpm2-abrmd(8). it's the intro, the meet-cute, the "hey let's be mutuals" of your TPM journey π¦
first, the include β don't forget it, she's required:
#include <tcti/tcti-tabrmd.h>
and here's the signature, character for character, no cap:
TSS2_RC Tss2_Tcti_Tabrmd_Init (TSS2_TCTI_CONTEXT *tcti_context, size_t
*size, const char *conf);
πΈ DESCRIPTION πΈ
Tss2_Tcti_Tabrmd_Init() tries to initialize a caller allocated tcti_context of size size, using the configuration specified in the configuration string conf.
now, plot twist: since the tcti_context has to be a buffer you the caller allocated, you gotta know how big the TCTI library needs it to be. and here's the cute two-step β the minimum size of this context can be discovered by passing NULL for the tcti_context and a non-NULL size parameter. the initialization function will then populate the size parameter with the minimum size of the tcti_context buffer. then the caller may allocate a buffer of this size (or larger π) and call tss2_Tcti_Tabrmd_Init () again, handing over the newly allocated tcti_context and the size of this context in the size parameter.
this pattern? common to all TCTI initialization functions. it's a whole family tradition fr fr. we give you an example of this pattern using Tss2_Tcti_Tabrmd_Init() down in the section titled EXAMPLE, so don't stress π
the conf parameter is a string of key / value pairs describing the desired connection properties for the TCTI. if the caller provides a NULL conf string, then defaults that correspond to the defaults for the tpm2-abrmd(8) will be used. this is the same as providing the conf string:
"bus_name=com.intel.tss2.Tabrmd,bus_type=system"
keys and values are separated by the = character, while each key / value pair is separated by the , character. the supported keys and values are:
bus_nameβ the dbus name owned by the daemon. see thetpm2-abrmd(8)--dbus-nameoption. πbus_typeβ the bus type used for the connection with the daemon. the value associated with this key may be either"system"or"session". β¨
once initialized, the TCTI context returned exposes the Trusted Computing Group (TCG) defined API for the lowest level communication with the TPM. using this API the caller can exchange (send / receive) TPM2 command and response buffers with the tpm2-abrmd(8). in nearly all cases however, the caller will initialize a context using this function before passing the context to a higher level API like the System API (SAPI), and then never touch it again. set it and forget it, main character energy π
for a more thorough discussion of the TCTI API see the βTSS System Level API and TPM Command Transmission Interface Specificationβ specification as published by the TCG: https://trustedcomputinggroup.org/tss-system-level-api-tpm-command-transmission-interface-specification/
π«Ά RETURN VALUE π«Ά
a successful call to Tss2_Tcti_Tabrmd_Init() will return TSS2_RC_SUCCESS β
an unsuccessful call will produce a response code described in section ERRORS. yeah, go read it, it's right there.
π ERRORS π
TSS2_TCTI_RC_BAD_VALUEis returned if thesizeparameter isNULL.TSS2_TCTI_RC_NO_CONNECTIONis returned when communication with thetpm2-abrmd(8)fails. πTSS2_TCTI_RC_GENERAL_FAILUREis returned for all other errors.
π§ EXAMPLE π§
here's the whole glow-up in code, copied exactly, no edits, bestie:
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <tcti/tcti-tabrmd.h>
TSS2_RC rc;
TSS2_TCTI_CONTEXT *tcti_context;
size_t size;
rc = tss2_tcti_tabrmd_init (NULL, &size, NULL,
if (rc != TSS2_RC_SUCCESS) {
fprintf (stderr, "Failed to get allocation size for tabrmd TCTI "
" context: 0x%" PRIx32 "0, rc);
exit (EXIT_FAILURE);
}
tcti_context = calloc (1, size);
if (tcti_context == NULL) {
fprintf (stderr, "Allocation for TCTI context failed: %s0,
strerror (errno));
exit (EXIT_FAILURE);
}
rc = tss2_tcti_tabrmd_init (tcti_context, &size, NULL);
if (rc != TSS2_RC_SUCCESS) {
fprintf (stderr, "Failed to initialize tabrmd TCTI context: "
"0x%" PRIx32 "0, rc);
free (tcti_context);
exit (EXIT_FAILURE);
}
exit (EXIT_SUCCESS);
π AUTHOR π
Philip Tricca <philip.b.tricca@intel.com> β shoutout to the icon who wrote this π
π SEE ALSO π
tcti-tabrmd(7)tpm2-abrmd(8)
iykyk, go read those next.
π COLOPHON π
this page is part of the 3.0.0 release of Intel's TPM2 Access Broker & Resource Management Daemon. a description of the project, information about reporting bugs, and the latest version of this page can be found at https://github.com/01org/tpm2-abrmd/.
and that's the whole thing, bestie β dated APRIL 2018, from the fine folks at Intel, and she's serving TSS2_TCTI_TABRMD_INIT(3) realness. slay, periodt π
β¨π¦
π¦ where this page comes from
- alpine 3.24: tpm2-abrmd-doc 3.0.0-r1 Β· BSD-2-Clause
- arch rolling: tpm2-abrmd 3.0.0-2 Β· BSD-2-Clause
- centos-stream 10: tpm2-abrmd 3.0.0-7.el10 Β· BSD-2-Clause
- debian bookworm: libtss2-tcti-tabrmd-dev 3.0.0-1 Β· BSD-2-Clause
- debian trixie: libtss2-tcti-tabrmd-dev 3.0.0-1.2 Β· BSD-2-Clause
- fedora 43: tpm2-abrmd 3.0.0-8.fc43 Β· BSD-2-Clause
- fedora 43: tpm2-abrmd 3.0.0-8.fc43 Β· BSD-2-Clause
- fedora 44: tpm2-abrmd 3.0.0-9.fc44 Β· BSD-2-Clause
- fedora 44: tpm2-abrmd 3.0.0-9.fc44 Β· BSD-2-Clause
- nixos 26.05: tpm2-abrmd 3.0.0
- opensuse-leap 16.0: tpm2.0-abrmd-devel 3.0.0-160000.2.2 Β· BSD-2-Clause
- opensuse-leap 16.0: tpm2.0-abrmd-devel 3.0.0-160000.2.2 Β· BSD-2-Clause
- opensuse-leap 16.0: tpm2.0-abrmd-devel 3.0.0-160000.2.2 Β· BSD-2-Clause
- opensuse-leap 16.0: tpm2.0-abrmd-devel 3.0.0-160000.2.2 Β· BSD-2-Clause
- ubuntu noble: libtss2-tcti-tabrmd-dev 3.0.0-1ubuntu2 Β· BSD-2-Clause
- ubuntu questing: libtss2-tcti-tabrmd-dev 3.0.0-1.2
- ubuntu resolute: libtss2-tcti-tabrmd-dev 3.0.0-1.2build1 Β· BSD-2-Clause
- ubuntu stonking: libtss2-tcti-tabrmd-dev 3.0.0-1.2build1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms