tpm2_capability.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: BSD-3-Clause */
  2. #ifndef LIB_TPM2_CAPABILITY_H_
  3. #define LIB_TPM2_CAPABILITY_H_
  4. #include <tss2/tss2_esys.h>
  5. /**
  6. * Invokes GetCapability to retrieve the current value of a capability from the
  7. * TPM.
  8. * @param context
  9. * Enhanced system api (ESAPI) context
  10. * @param capability
  11. * the capability being requested from the TPM
  12. * @param property
  13. * property
  14. * @param count
  15. * maximum number of values to return
  16. * @param capability_data
  17. * capability data structure to populate
  18. * @return
  19. * tool_rc indicating status.
  20. */
  21. tool_rc tpm2_capability_get(ESYS_CONTEXT *context, TPM2_CAP capability,
  22. UINT32 property, UINT32 count, TPMS_CAPABILITY_DATA **capability_data);
  23. /**
  24. * Attempts to find a vacant handle in the persistent handle namespace.
  25. * @param ctx
  26. * Enhanced System API (ESAPI) context
  27. * @param is_platform
  28. * true if the persistent handle should be in the persistent range allocated for
  29. * platform hierarchy, false otherwise.
  30. * @param vacant
  31. * the vacant handle found by the function if True returned
  32. * @return
  33. * tool_rc indicating status.
  34. */
  35. tool_rc tpm2_capability_find_vacant_persistent_handle(ESYS_CONTEXT *ctx,
  36. bool is_platform, TPMI_DH_PERSISTENT *vacant);
  37. #endif /* LIB_TPM2_CAPABILITY_H_ */