TSPI_TPM_GETPUBENDORSEMENTKEY(3)
π Tspi_TPM_GetPubEndorsementKey π
okay bestie, welcome to Tspi_TPM_GetPubEndorsementKey(3) β section 3, Library Functions Manual, straight out of the TCG Software Stack Developer's Reference. this one's giving β¨trusted computingβ¨ and honestly? it's a whole vibe. let's get into it π«Ά
β¨ NAME β¨
Tspi_TPM_GetPubEndorsementKey β make a TSS key object out of the TPM's public endorsement key π
πΈ SYNOPSIS πΈ
#include <tss/platform.h>
#include <tss/tcpa_defines.h>
#include <tss/tcpa_typedef.h>
#include <tss/tcpa_struct.h>
#include <tss/tss_typedef.h>
#include <tss/tss_structs.h>
#include <tss/tspi.h>
TSS_RESULT Tspi_TPM_GetPubEndorsementKey(TSS_HTPM hTPM, TSS_BOOL fOwnerAuthorized,
TSS_VALIDATION* pValidationData, TSS_HKEY* phEndorsementPubKey);
π¦ DESCRIPTION π¦
so what this function actually does: it goes and grabs the public endorsement key β the PubEK β from the TPM, then builds you a TSS key object for it, and hands you the handle for that object back through phEndorsementPubKey. very demure, very mindful, very TSS_HKEY. π
but here's the tea, and it's lowkey important β β different TPM chips validate the PubEK in different ways, which means application-side verification of the PubEK (aka calling this with a non-NULL pValidationData) is broken. like, genuinely broken. not a vibe.
so the move is: callTspi_TPM_GetPubEndorsementKeywith a NULLpValidationDataparameter and let the TSS verify the PubEK itself. let the TSS be the main character for once. periodt.
π PARAMETERS π
hTPM
this is the handle of the TPM object. you're basically telling the function which TPM we're talking to. π«Ά
fOwnerAuthorized
if it's TRUE, the TPM owner secret must be provided to get the public endorsement key. if it's FALSE, no TPM owner secret must be provided to get the public endorsement key. pick your fighter. π
pValidationData
if this is non-NULL, the application should set the pValidationData->rgbExternalData parameter to 20 bytes of random data before calling Tspi_TPM_GetPubEndorsementKey. then, once the command completes successfully, the structure will give you buffers containing the validation data and the buffer the validation data was computed from. cute, right? β¨
(but remember what we said up top β non-NULL here is the broken path. you've been warned, bestie π)
phEndorsementPubKey
this receives a handle to a key object representing the TPM's public endorsement key. this is the whole point of the function. slay. π
π RETURN CODES π
Tspi_TPM_GetPubEndorsementKey returns TSS_SUCCESS when everything goes right. otherwise, one of these shows up to ruin the mood:
TSS_E_INVALID_HANDLEβhTPMis not a valid handle. π©TSS_E_INTERNAL_ERRORβ an internal SW error has been detected. not me catching an L in the software layer πTSS_E_BAD_PARAMETERβ one or more parameters is bad. one of them is giving absolutely nothing.TPM_E_DISABLED_CMDβ reading of PubEK from TPM has been disabled. it's turned off, babes, nothing we can do π
π CONFORMING TO π
Tspi_TPM_GetPubEndorsementKey conforms to the Trusted Computing Group Software Specification version 1.1 Golden. iconic. no notes. β
π SEE ALSO π
and that's the whole page, bestie β TSS 1.1, dated 2004-05-25, from the Tspi_TPM_G...orsementKey(3) era of the manual. go forth and fetch that PubEK responsibly, mwah ππ§β¨
π¦ where this page comes from
- debian bookworm: libtspi-dev 0.3.15-0.3 Β· BSD-3-Clause
- debian trixie: libtspi-dev 0.3.15-0.4 Β· BSD-3-Clause
- epel 10: trousers-devel 0.3.15-11.el10_0 Β· BSD
- epel 9: trousers-devel 0.3.15-5.el9 Β· BSD
- fedora 43: trousers-devel 0.3.15-15.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-15.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-16.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-16.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: trousers-devel 0.3.15-17.fc44 Β· LicenseRef-Callaway-BSD
- fedora 44: trousers-devel 0.3.15-17.fc44 Β· LicenseRef-Callaway-BSD
- nixos 26.05: trousers 0.3.15
- nixpkgs unstable: netbsd-source 11.0
- nixpkgs unstable: trousers 0.3.15
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- ubuntu jammy: libtspi-dev 0.3.15-0.2 Β· BSD-3-Clause
- ubuntu noble: libtspi-dev 0.3.15-0.3build2 Β· BSD-3-Clause
- ubuntu questing: libtspi-dev 0.3.15-0.4
- ubuntu resolute: libtspi-dev 0.3.15-1 Β· BSD-3-Clause
- ubuntu stonking: libtspi-dev 0.3.15-1ubuntu2 Β· BSD-3-Clause
- Copyright (C) 2004, 2005 International Business Machines Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms