1 | =head1 NAME
|
---|
2 |
|
---|
3 | TPMLIB_SetState - Set the TPM's volatile, permanent, or save state
|
---|
4 |
|
---|
5 | TPMLIB_GetState - Get the TPM's volatile, permanent, or save state
|
---|
6 |
|
---|
7 | =head1 LIBRARY
|
---|
8 |
|
---|
9 | TPM library (libtpms, -ltpms)
|
---|
10 |
|
---|
11 | =head1 SYNOPSIS
|
---|
12 |
|
---|
13 | B<#include <libtpms/tpm_library.h>>
|
---|
14 |
|
---|
15 | B<TPM_RESULT TPMLIB_SetState(enum TPMLIB_StateType st,
|
---|
16 | const unsigned char *buffer, uint32_t buflen);>
|
---|
17 |
|
---|
18 | B<TPM_RESULT TPMLIB_GetState(enum TPMLIB_StateType st,
|
---|
19 | unsigned char **buffer, uint32_t *buflen);>
|
---|
20 |
|
---|
21 | =head1 DESCRIPTION
|
---|
22 |
|
---|
23 | The B<TPMLIB_SetState()> function allows to set either one of the state blobs of
|
---|
24 | the TPM. The passed state blob is tested for whether it can be accepted and a TPM
|
---|
25 | error code is returned in case it cannot be accepted. In case of acceptance, the
|
---|
26 | state blob will be passed to the TPM upon B<TPM_MainInit()>. Setting a state blob
|
---|
27 | hides a file that may contain the same type of blob and would be read otherwise.
|
---|
28 | It is required to call this function with a NULL pointer for the buffer parameter
|
---|
29 | to hide a state blob in a file.
|
---|
30 |
|
---|
31 | It is only possible to set the state blobs after B<TPMLIB_ChooseTPMVersion()>
|
---|
32 | has been called. All state blobs are cleared when a different version of TPM is
|
---|
33 | chosen using B<TPMLIB_ChooseTPMVersion> or when a call to B<TPMLIB_SetState()>
|
---|
34 | fails because a state blob could not be accepted.
|
---|
35 |
|
---|
36 | The order in which state blobs are set is important. The first state blob has
|
---|
37 | to be the one representing the TPM's permanent state. Only after that either
|
---|
38 | the volatile or save state blobs can be set.
|
---|
39 |
|
---|
40 | The B<TPMLIB_GetState()> function allows to get the current state of the TPM.
|
---|
41 | For as long as the TPM has not been started, this function either returns the state
|
---|
42 | blob previously set with B<TPMLIB_SetState()> or the state is read from a file.
|
---|
43 | Once the TPM has been start the state of the running TPM is returned.
|
---|
44 |
|
---|
45 | The B<TPMLIB_STATE_SAVE_STATE> (save state) type of TPM state can be set with this
|
---|
46 | function. The same state blob will be returned until TPM_Startup(ST_STATE) has been
|
---|
47 | called, after which an empty blob will be returned. This blob can also only be
|
---|
48 | read after TPM_SaveState() has been sent to the TPM.
|
---|
49 |
|
---|
50 | =head1 SEE ALSO
|
---|
51 |
|
---|
52 | B<TPMLIB_ChooseTPMVersion>(3), B<TPMLIB_MainInit>(3), B<TPMLIB_Terminate>(3)
|
---|
53 |
|
---|
54 | =cut
|
---|