Expose the two new API calls TPMLIB_Get/SetState

Expose the two new API calls TPMLIB_GetState() and TPMLIB_SetState().
Fix one parameter in the TPMLIB_GetState() call.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
This commit is contained in:
Stefan Berger 2018-05-11 16:05:28 -04:00
parent 51f7c2f0b7
commit ec672b4e37
5 changed files with 26 additions and 18 deletions

View File

@ -154,7 +154,7 @@ TPM_RESULT TPMLIB_ValidateState(enum TPMLIB_StateType st,
TPM_RESULT TPMLIB_SetState(enum TPMLIB_StateType st,
const unsigned char *buffer, uint32_t buflen);
TPM_RESULT TPMLIB_GetState(enum TPMLIB_StateType st,
const unsigned char **buffer, uint32_t *buflen);
unsigned char **buffer, uint32_t *buflen);
#ifdef __cplusplus
}

View File

@ -154,7 +154,7 @@ TPM_RESULT TPMLIB_ValidateState(enum TPMLIB_StateType st,
TPM_RESULT TPMLIB_SetState(enum TPMLIB_StateType st,
const unsigned char *buffer, uint32_t buflen);
TPM_RESULT TPMLIB_GetState(enum TPMLIB_StateType st,
const unsigned char **buffer, uint32_t *buflen);
unsigned char **buffer, uint32_t *buflen);
#ifdef __cplusplus
}

View File

@ -1,4 +1,4 @@
.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.31)
.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
@ -46,7 +46,7 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
@ -54,20 +54,16 @@
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{
. if \nF \{
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
.if !\nF .nr F 0
.if \nF>0 \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{
. nr % 0
. nr F 2
. \}
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
@ -133,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "TPMLIB_SetState 3"
.TH TPMLIB_SetState 3 "2018-05-10" "libtpms" ""
.TH TPMLIB_SetState 3 "2018-05-11" "libtpms" ""
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@ -153,7 +149,7 @@ TPMLIB_GetState \- Get the TPM's volatile, permanent, or save state
const unsigned char *buffer, uint32_t buflen);\fR
.PP
\&\fB\s-1TPM_RESULT\s0 TPMLIB_GetState(enum TPMLIB_StateType st,
const unsigned char **buffer, uint32_t *buflen);\fR
unsigned char **buffer, uint32_t *buflen);\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fB\f(BITPMLIB_SetState()\fB\fR function allows to set either one of the state blobs of

View File

@ -16,7 +16,7 @@ B<TPM_RESULT TPMLIB_SetState(enum TPMLIB_StateType st,
const unsigned char *buffer, uint32_t buflen);>
B<TPM_RESULT TPMLIB_GetState(enum TPMLIB_StateType st,
const unsigned char **buffer, uint32_t *buflen);>
unsigned char **buffer, uint32_t *buflen);>
=head1 DESCRIPTION

View File

@ -154,6 +154,18 @@ char *TPMLIB_GetInfo(enum TPMLIB_InfoFlags flags)
return tpm_iface[0]->GetInfo(flags);
}
TPM_RESULT TPMLIB_SetState(enum TPMLIB_StateType st,
const unsigned char *buffer, uint32_t buflen)
{
return tpm_iface[0]->SetState(st, buffer, buflen);
}
TPM_RESULT TPMLIB_GetState(enum TPMLIB_StateType st,
unsigned char **buffer, uint32_t *buflen)
{
return tpm_iface[0]->GetState(st, buffer, buflen);
}
TPM_RESULT TPM_IO_Hash_Start(void)
{
return tpm_iface[0]->HashStart();