FapiTestgroup(3)
πΈ FapiTestgroup(3) πΈ
bestie welcome to the FAPI testing group chat β this is a page from the Library Functions Manual, and it's literally the whole FapiTestgroup situation. Buckle up, it's a long one π
β¨ NAME β¨
FapiTestgroup β Fapi-Testing, i.e. the vibe check for FAPI π
π¦ SYNOPSIS π¦
π§ Functions
int test_fapi_data_crypt (FAPI_CONTEXT *context)
int test_fapi_duplicate (FAPI_CONTEXT *context)
int test_fapi_ext_public_key (FAPI_CONTEXT *context)
int test_fapi_get_random (FAPI_CONTEXT *context)
int test_fapi_info (FAPI_CONTEXT *context)
int test_fapi_key_change_auth (FAPI_CONTEXT *context)
int test_fapi_key_create_ckda_sign (FAPI_CONTEXT *context)
int test_fapi_key_create_policies_sign (FAPI_CONTEXT *context)
int test_fapi_key_create_policy_authorize_nv (FAPI_CONTEXT *context)
int test_fapi_key_create_policy_authorize_sign (FAPI_CONTEXT *context)
int test_fapi_key_create_policy_nv_sign (FAPI_CONTEXT *context)
int test_fapi_key_create_policy_or_sign (FAPI_CONTEXT *context)
int test_fapi_key_create_policy_pcr_sign (FAPI_CONTEXT *context)
int test_fapi_key_create_policy_secret_nv_sign (FAPI_CONTEXT *context)
int test_fapi_key_create_policy_signed (FAPI_CONTEXT *context)
int test_fapi_key_create_sign (FAPI_CONTEXT *context)
int test_fapi_key_create_sign_password_provision (FAPI_CONTEXT *context)
int test_fapi_key_create_sign_policy_provision (FAPI_CONTEXT *context)
int test_fapi_nv_extend (FAPI_CONTEXT *context)
int test_fapi_nv_increment (FAPI_CONTEXT *context)
int test_fapi_nv_ordinary (FAPI_CONTEXT *context)
int test_fapi_nv_set_bits (FAPI_CONTEXT *context)
int test_fapi_nv_written_policy (FAPI_CONTEXT *context)
int test_fapi_pcr_test (FAPI_CONTEXT *context)
int test_fapi_platform_certificates (FAPI_CONTEXT *context)
int test_fapi_quote (FAPI_CONTEXT *context)
int test_fapi_unseal (FAPI_CONTEXT *context)
π Detailed Description π
This is the testing of FAPI functionality, no cap. The FAPI functions that get tested are listed right there in each of the testcase functions' descriptions β every single one, bestie, we're not skipping anybody π
π₯ Function Documentation π₯
π int test_fapi_data_crypt (FAPI_CONTEXT *context)
Tests the FAPI functions for encryption and decryption. Locking it down and opening it back up, basically β¨
Tested FAPI commands:
Fapi_Provision()Fapi_Import()Fapi_CreateKey()Fapi_SetSignCB()Fapi_Encrypt()Fapi_Decrypt()Fapi_Free()
Tested Policies:
PolicySigned
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_duplicate (FAPI_CONTEXT *context)
Tests the FAPI functions for key duplication. Twin keys, iconic behaviour π«Ά
Tested FAPI commands:
Fapi_Provision()Fapi_Import()Fapi_CreateKey()Fapi_ExportKey()Fapi_Delete()
Tested Policies:
PolicyDuplicationSelect
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_ext_public_key (FAPI_CONTEXT *context)
Tests the FAPI functions using an external public key for signature and quote verify without TPM. Yeah, no TPM at all, main character energy π
Tested FAPI commands:
Fapi_Import()Fapi_VerifySignature()Fapi_SetCertificate()Fapi_GetCertificate()Fapi_List()Fapi_VerifyQuote()Fapi_Delete()
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_get_random (FAPI_CONTEXT *context)
Tests the FAPI function FAPI_GetRandom and async invocations β the async girlies get their moment too π
Tested FAPI commands:
Fapi_Provision()Fapi_GetRandom_Async()Fapi_GetRandom_Finish()Fapi_GetPollHandles()Fapi_GetRandom()Fapi_Delete()
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_info (FAPI_CONTEXT *context)
Tests the FAPI functions for GetInfo. Just, like, asking the TPM how it's doing π
Tested FAPI commands:
Fapi_Provision()Fapi_GetInfo()Fapi_Delete()
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_key_change_auth (FAPI_CONTEXT *context)
Tests the FAPI function for changing key authorizations. Glow-up for your auth, honestly β¨
Also tested: setting of the authorization callback, and usage of the key with Fapi_Sign afterwards. Both of them. Together. Obsessed.
Tested FAPI commands:
Fapi_Provision()Fapi_CreateKey()Fapi_ChangeAuth()Fapi_SetAuthCB()Fapi_Sign()Fapi_Delete()
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_key_create_ckda_sign (FAPI_CONTEXT *context)
Tests the FAPI functions for key creation and usage with the noda and da flag. Flags, plural, we love to see it π
Tested FAPI commands:
Fapi_Provision()Fapi_CreateKey()Fapi_SetAuthCB()Fapi_Sign()Fapi_Delete()
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_key_create_policies_sign (FAPI_CONTEXT *context)
Tests several FAPI policies by usage of a signing key. Which test case will be executed is determined by the compiler switches: TEST_POLICY_PASSWORD, TEST_POLICY_AUTH_VALUE, TEST_POLICY_LOCALITY TEST_POLICY_PHYSICAL_PRESENCE, TEST_POLICY_COMMAND_CODE, TEST_POLICY_COUNTERTIMER.
iykyk β the compiler switch picks your fate π
Tested FAPI commands:
Fapi_Provision()Fapi_Import()Fapi_CreateKey()Fapi_SetAuthCB()Fapi_Sign()Fapi_Delete()
Tested Policies:
PolicyPasswordPolicyAuthValuePolicyLocalityPolicyPhysicalPresencePolicyCommandCodePolicyCounterTimer
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_key_create_policy_authorize_sign (FAPI_CONTEXT *context)
Tests the FAPI functions for PolicyAuthoirze with signing. (That's how it's spelled on the page, bestie, we're leaving it exactly as it is π«Ά)
Tested FAPI commands:
Fapi_Provision()Fapi_SetBranchCB()Fapi_Import()Fapi_CreateKey()Fapi_AuthorizePolicy()Fapi_Sign()Fapi_List()Fapi_Delete()
Tested Policies:
PolicyNameHashPolicyAuthorizePolicyCpHash(Not entered, only as alternative branch)
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_key_create_policy_nv_sign (FAPI_CONTEXT *context)
Tests the FAPI functions for NV writing and key usage. NV girlies rise πΈ
Tested FAPI commands:
Fapi_Provision()Fapi_CreateKey()Fapi_NvWrite()Fapi_Import()Fapi_Sign()Fapi_Delete()
Tested Policies:
PolicyNv
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_key_create_policy_or_sign (FAPI_CONTEXT *context)
Tests the FAPI for PolicyOr using signing. Pick a lane, any lane π
Tested FAPI commands:
Fapi_Provision()Fapi_Import()Fapi_CreateKey()Fapi_SetBranchCB()Fapi_Sign()Fapi_Delete()
Tested Policies:
PolicyOrPolicyPcr
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_key_create_policy_pcr_sign (FAPI_CONTEXT *context)
Tests the FAPI functions for PolicyPCR with key creation and usage. Note there's Fapi_Import() and Fapi_Delete() and then Fapi_Import() and Fapi_List() again β yes, really, that's the order, don't come for me π
Tested FAPI commands:
Fapi_Provision()Fapi_Import()Fapi_CreateKey()Fapi_Sign()Fapi_ExportPolicy()Fapi_Delete()Fapi_Import()Fapi_List()
Tested Policies:
PolicyPcr(withcurrentPCRsset)
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_key_create_policy_secret_nv_sign (FAPI_CONTEXT *context)
Tests the FAPI PolicySecret and PolicyAuthValue handling. Secrets AND auth, the duo we didn't know we needed π₯
Tested FAPI commands:
Fapi_Provision()Fapi_Import()Fapi_CreateNv()Fapi_CreateKey()Fapi_Sign()Fapi_SetAuthCB()Fapi_Delete()
Tested Policies:
PolicySecretPolicyAuthValue
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_key_create_policy_signed (FAPI_CONTEXT *context)
Tests the FAPI functions for key creation and usage with a PolicySigned. Signed, sealed, slayed π
Tested FAPI commands:
Fapi_Provision()Fapi_Import()Fapi_CreateKey()Fapi_SetSignCB()Fapi_Sign()Fapi_Delete()Fapi_List()
Tested Policies:
PolicySigned
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_key_create_sign (FAPI_CONTEXT *context)
Tests the FAPI functions for TpmBlobs and certificates. Blobs AND certs, highkey a lot going on π¦
Tested FAPI commands:
Fapi_Provision()Fapi_SetAuthCB()Fapi_CreateKey()Fapi_GetTpmBlobs()Fapi_Sign()Fapi_VerifySignature()Fapi_SetCertificate()Fapi_List()Fapi_ChangeAuth()Fapi_Delete()
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_key_create_sign_password_provision (FAPI_CONTEXT *context)
Tests the FAPI functions for key creation and usage with an SH password. Password girlies, this one's for you π
Tested FAPI commands:
Fapi_Provision()Fapi_SetAuthCB()Fapi_CreateKey()Fapi_GetTpmBlobs()Fapi_Sign()Fapi_SetCertificate()Fapi_List()Fapi_ChangeAuth()Fapi_Delete()
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_key_create_sign_policy_provision (FAPI_CONTEXT *context)
Tests the FAPI functions for key creation and usage. That's the whole description, bestie β sometimes less is more β¨
Tested FAPI commands:
Fapi_Provision()Fapi_SetAuthCB()Fapi_CreateKey()Fapi_GetTpmBlobs()Fapi_Sign()Fapi_SetCertificate()Fapi_List()Fapi_Delete()
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_nv_extend (FAPI_CONTEXT *context)
Tests the FAPI function FAPI_NvExtend. Extending, not replacing, keep up π
Tested FAPI commands:
Fapi_Provision()Fapi_CreateNv()Fapi_NvExtend()Fapi_Delete()Fapi_SetAuthCB()
Parameters:
- context β The
FAPI_CONTEXT.
Return values:
EXIT_FAILUREEXIT_SUCCESS
π int test_fapi_nv_increment (FAPI_CONTEXT *context)
Tests the FAPI function FAPI_NvIncrement. Numbers go up, that's the whole plot β
Tested FAPI commands:
Fapi_Provision()Fapi_Import()Fapi_CreateNv()Fapi_SetAuthCB()Fapi_ChangeAuth()Fapi_Delete()Fapi_NvIncrement()
Tested Policies: π
PolicyAuthValuePolicyCommandCode
Parameters
contextβ theFAPI_CONTEXT, bestie.
Return values
EXIT_FAILUREEXIT_SUCCESS
int test_fapi_nv_ordinary (FAPI_CONTEXT * context)
This one tests the FAPI NV functions, no cap. The tested FAPI commands are giving:
Fapi_Provision()Fapi_Import()Fapi_SetPolicyActionCB()Fapi_CreateNv()Fapi_NvWrite()Fapi_NvRead()Fapi_Delete()Fapi_SetDescription()Fapi_GetDescription()Fapi_SetAuthCB()
Tested Policies:
PolicyAction
Parameters
contextβ theFAPI_CONTEXT.
Return values
EXIT_FAILUREEXIT_SUCCESS
int test_fapi_nv_set_bits (FAPI_CONTEXT * context)
This one is here to test the FAPI function Fapi_NvSetBits β¨. The tested FAPI commands are:
Fapi_Provision()Fapi_CreateNv()Fapi_NvSetBits()Fapi_Delete()Fapi_SetAuthCB()
Parameters
contextβ theFAPI_CONTEXT.
Return values
EXIT_FAILUREEXIT_SUCCESS
int test_fapi_nv_written_policy (FAPI_CONTEXT * context)
This one tests the FAPI policy PolicyNvWritten β very specific, very demure. The tested FAPI commands are:
Fapi_Provision()Fapi_CreateNv()Fapi_SetAppData()Fapi_GetAppData()Fapi_NvWrite()Fapi_Delete()
Tested Policies:
PolicyNvWritten
Parameters
contextβ theFAPI_CONTEXT.
Return values
EXIT_FAILUREEXIT_SUCCESS
int test_fapi_pcr_test (FAPI_CONTEXT * context)
This one tests the FAPI function FAPI_PcrExtend and Read π₯. The tested FAPI commands are:
Fapi_Provision()Fapi_PcrExtend()Fapi_PcrRead()Fapi_Delete()
Parameters
contextβ theFAPI_CONTEXT.
Return values
EXIT_FAILUREEXIT_SUCCESS
int test_fapi_platform_certificates (FAPI_CONTEXT * context)
This one tests the FAPI functions for platform certificates β iconic certificate behavior tbh π. The tested FAPI commands are:
Fapi_Provision()Fapi_GetPlatformCertificates()Fapi_Delete()
Parameters
contextβ theFAPI_CONTEXT.
Return values
EXIT_FAILUREEXIT_SUCCESS
int test_fapi_quote (FAPI_CONTEXT * context)
This one tests the FAPI functions for quote commands β the whole quote pipeline is on main character energy here π. The tested FAPI commands are:
Fapi_Provision()Fapi_CreateKey()Fapi_PcrExtend()Fapi_Quote()Fapi_ExportKey()Fapi_Import()Fapi_PcrRead()Fapi_VerifyQuote()Fapi_List()Fapi_Delete()
Parameters
contextβ theFAPI_CONTEXT.
Return values
EXIT_FAILUREEXIT_SUCCESS
int test_fapi_unseal (FAPI_CONTEXT * context)
This one tests the FAPI functions for sealing β sealed with a kiss, literally π«Ά. The tested FAPI commands are:
Fapi_Provision()Fapi_CreateSeal()Fapi_Unseal()Fapi_Delete()
Parameters
contextβ theFAPI_CONTEXT.
Return values
EXIT_FAILUREEXIT_SUCCESS
π AUTHOR π
Generated automatically by Doxygen for tpm2-tss from the source code.
Cute footer sign-off: source tpm2-tss, version Version 4.1.5, page FapiTestgroup(3) β date included by reference, because we do not invent dates around here, bestie π
π¦ where this page comes from
- fedora 44: tpm2-tss-devel 4.1.5-1.fc44 Β· BSD-2-Clause
- fedora 44: tpm2-tss-devel 4.1.5-1.fc44 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms