FapiTestgroup3
Fapi-testing
Usage
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
Testing of FAPI functionality. The tested FAPI functions are listed in each of the testcase functions' descriptions.
Function Documentation
int test_fapi_data_crypt (FAPI_CONTEXT * context)
Test the FAPI functions for encryption and decryption.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
Tested Policies:
- •
-
PolicySigned
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_duplicate (FAPI_CONTEXT * context)
Test the FAPI functions for key duplication.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
Tested Policies:
- •
-
PolicyDuplicationSelect
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_ext_public_key (FAPI_CONTEXT * context)
Test the FAPI functions use an external public key for signature and quote verify without TPM.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_get_random (FAPI_CONTEXT * context)
Test the FAPI function FAPI_GetRandom and async invocations.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_info (FAPI_CONTEXT * context)
Test the FAPI functions for GetInfo.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_key_change_auth (FAPI_CONTEXT * context)
Test the FAPI function for changing key authorizations.
The setting of the authorization callback and usage of the key with Fapi_Sign afterwards is also tested.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_key_create_ckda_sign (FAPI_CONTEXT * context)
Test the FAPI functions for key creation and usage with noda and da flag.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_key_create_policies_sign (FAPI_CONTEXT * context)
Test several FAPI policies by usage of 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.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
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)
Test the FAPI functions for PolicyAuthoirze with signing.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
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)
Test the FAPI functions for NV writing and key usage.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
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)
Test the FAPI for PolicyOr using signing.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
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)
Test the FAPI functions for PolicyPCR with key creation and usage.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
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)
Test the FAPI PolicySecret and PolicyAuthValue handling.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
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)
Test the FAPI functions for key creation and usage with a PolicySigned.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
Tested Policies:
- •
-
PolicySigned
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_key_create_sign (FAPI_CONTEXT * context)
Test the FAPI functions for TpmBlobs and certificates.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_key_create_sign_password_provision (FAPI_CONTEXT * context)
Test the FAPI functions for key creation and usage with an SH password.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_key_create_sign_policy_provision (FAPI_CONTEXT * context)
Test the FAPI functions for key creation and usage.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_nv_extend (FAPI_CONTEXT * context)
Test the FAPI function FAPI_NvExtend.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_nv_increment (FAPI_CONTEXT * context)
Test the FAPI function FAPI_NvIncrement.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
Tested Policies:
•
|
PolicyAuthValue |
|---|---|
•
|
PolicyCommandCode |
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_nv_ordinary (FAPI_CONTEXT * context)
Test the FAPI NV functions.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
Tested Policies:
- •
-
PolicyAction
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_nv_set_bits (FAPI_CONTEXT * context)
Test the FAPI function Fapi_NvSetBits.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_nv_written_policy (FAPI_CONTEXT * context)
Test the FAPI policy PolicyNvWritten.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
Tested Policies:
- •
-
PolicyNvWritten
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_pcr_test (FAPI_CONTEXT * context)
Test the FAPI function FAPI_PcrExtend and Read.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_quote (FAPI_CONTEXT * context)
Test the FAPI functions for quote commands.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
•
|
|
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
int test_fapi_unseal (FAPI_CONTEXT * context)
Test the FAPI functions for sealing.
Tested FAPI commands:
•
|
|
|---|---|
•
|
|
•
|
|
•
|
|
Parameters
context The FAPI_CONTEXT.
Return values
EXIT_FAILURE
EXIT_SUCCESS
Releases
3 releases since Debian 12 (Bookworm); the text changed 2 times.