tpm_sealdata(3)
π tpm_sealdata(3) β Library Functions Manual π
okay bestie, welcome to the TPM Management corner of the library. we're doing tpmUnsealFile, tpmUnsealShred, and tpmUnsealStrerror today and honestly? these three carry the whole unseal arc. π«Ά
β¨ NAME β¨
tpmUnsealFile, tpmUnsealShred, tpmUnsealStrerror β unseal routines
like. the unseal girlies. that's the name. periodt. π
π SYNOPSIS π
#include <tpm_unseal/tpm_unseal.h>
int tpmUnsealFile(char* file, char** data, int* size);
void tpmUnsealShred(char* data, int size);
char* tpmUnsealStrerror(int rc);
look at those signatures. so clean. so iconic. β¨
π¦ DESCRIPTION π¦
so the whole tpmUnseal family exists for one reason and one reason only: getting you access to a piece of sensitive data that's been sealed to the TPM configuration of a given system. and it only lets you in if the conditions are right, which means:
- the SRK has not changed, and
- the PCRs (if any) that were specified at seal time are of the appropriate value.
that's it. that's the vibe check. no right conditions, no data. π
π tpmUnsealFile π
this one returns the contents of the file, unsealed, into the data buffer.
β οΈ bestie listen to me. the memory at *data must be freed by the caller. that's on you. not the library. you. don't make it weird. π
π§ tpmUnsealShred π§
this one zeroes and frees the memory for you. it's giving responsible. it's giving cleanup crew. it's giving "i got you, bestie." π
πΈ tpmUnsealStrerror πΈ
this one takes the return code from tpmUnsealFile and converts it into a human comprehensible string, using an internal errno variable. so instead of staring at a sad little negative number like ποΈπποΈ you get actual words. slay.
π Return Value π
tpmUnsealFileβ returns0on success and a negative number on error. π«tpmUnsealStrerrorβ returns the error string on success, and the empty string on an error. yes, the error function can error. iconic behaviour honestly. π
π SEE ALSO π
tpm_sealdata(1)β the origin story. go read it. iykyk. π
π REPORTING BUGS π
found a bug? don't sit on it, bestie, report it to:
<trousers-users@lists.sourceforge.net>
they're lovely. they'll help. fr fr. π«Ά
and that's the whole page!! TPM Management, dated 2005-08-10 β yes she's an elder but she ate and left no crumbs. go unseal something responsibly, and remember: free your memory. literally. π β¨π
π¦ where this page comes from
- debian bookworm: libtpm-unseal-dev 1.3.9.2-0.1 Β· CPL
- debian trixie: libtpm-unseal-dev 1.3.9.2-0.2 Β· CPL
- epel 10: tpm-tools-devel 1.3.9-19.el10_0 Β· CPL-1.0
- epel 9: tpm-tools-devel 1.3.9-13.el9 Β· CPL
- nixos 26.05: tpm-tools 1.3.9.2
- nixpkgs unstable: netbsd-source 11.0
- nixpkgs unstable: tpm-tools 1.3.9.2
- opensuse-leap 16.0: tpm-tools-devel 1.3.9.2-160000.2.2 Β· IPL-1.0
- opensuse-leap 16.0: tpm-tools-devel 1.3.9.2-160000.2.2 Β· IPL-1.0
- opensuse-leap 16.0: tpm-tools-devel 1.3.9.2-160000.2.2 Β· IPL-1.0
- opensuse-leap 16.0: tpm-tools-devel 1.3.9.2-160000.2.2 Β· IPL-1.0
- ubuntu jammy: libtpm-unseal-dev 1.3.9.1-0.2ubuntu4
- ubuntu noble: libtpm-unseal-dev 1.3.9.2-0.2build2 Β· CPL
- ubuntu questing: libtpm-unseal-dev 1.3.9.2-0.2build2
- ubuntu resolute: libtpm-unseal-dev 1.3.9.2-0.2build3 Β· CPL
- ubuntu stonking: libtpm-unseal-dev 1.3.9.2-0.2build4 Β· CPL
- Copyright (C) 2005, 2006 International Business Machines Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms