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_FAILURE
  • EXIT_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_FAILURE
  • EXIT_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_FAILURE
  • EXIT_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_FAILURE
  • EXIT_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_FAILURE
  • EXIT_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_FAILURE
  • EXIT_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_FAILURE
  • EXIT_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:

  • PolicyPassword
  • PolicyAuthValue
  • PolicyLocality
  • PolicyPhysicalPresence
  • PolicyCommandCode
  • PolicyCounterTimer

Parameters:

  • context β€” The FAPI_CONTEXT.

Return values:

  • EXIT_FAILURE
  • EXIT_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:

  • PolicyNameHash
  • PolicyAuthorize
  • PolicyCpHash (Not entered, only as alternative branch)

Parameters:

  • context β€” The FAPI_CONTEXT.

Return values:

  • EXIT_FAILURE
  • EXIT_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_FAILURE
  • EXIT_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:

  • PolicyOr
  • PolicyPcr

Parameters:

  • context β€” The FAPI_CONTEXT.

Return values:

  • EXIT_FAILURE
  • EXIT_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 (with currentPCRs set)

Parameters:

  • context β€” The FAPI_CONTEXT.

Return values:

  • EXIT_FAILURE
  • EXIT_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:

  • PolicySecret
  • PolicyAuthValue

Parameters:

  • context β€” The FAPI_CONTEXT.

Return values:

  • EXIT_FAILURE
  • EXIT_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_FAILURE
  • EXIT_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_FAILURE
  • EXIT_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_FAILURE
  • EXIT_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_FAILURE
  • EXIT_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_FAILURE
  • EXIT_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: πŸ’…

  • PolicyAuthValue
  • PolicyCommandCode

Parameters

  • context β€” the FAPI_CONTEXT, bestie.

Return values

  • EXIT_FAILURE
  • EXIT_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 β€” the FAPI_CONTEXT.

Return values

  • EXIT_FAILURE
  • EXIT_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 β€” the FAPI_CONTEXT.

Return values

  • EXIT_FAILURE
  • EXIT_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 β€” the FAPI_CONTEXT.

Return values

  • EXIT_FAILURE
  • EXIT_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 β€” the FAPI_CONTEXT.

Return values

  • EXIT_FAILURE
  • EXIT_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 β€” the FAPI_CONTEXT.

Return values

  • EXIT_FAILURE
  • EXIT_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 β€” the FAPI_CONTEXT.

Return values

  • EXIT_FAILURE
  • EXIT_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 β€” the FAPI_CONTEXT.

Return values

  • EXIT_FAILURE
  • EXIT_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