sys-primary-rsa-2K-aes128cfb.int.c 918 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: BSD-2-Clause */
  2. /***********************************************************************
  3. * Copyright (c) 2017-2018, Intel Corporation
  4. *
  5. * All rights reserved.
  6. ***********************************************************************/
  7. #ifdef HAVE_CONFIG_H
  8. #include <config.h>
  9. #endif
  10. #include <inttypes.h>
  11. #define LOGMODULE test
  12. #include "util/log.h"
  13. #include "sys-util.h"
  14. #include "test.h"
  15. int
  16. test_invoke (TSS2_SYS_CONTEXT *sys_context)
  17. {
  18. TSS2_RC rc;
  19. TPM2_HANDLE handle;
  20. rc = create_primary_rsa_2048_aes_128_cfb (sys_context, &handle);
  21. if (rc != TSS2_RC_SUCCESS) {
  22. LOG_ERROR("CreatePrimary failed with 0x%"PRIx32, rc);
  23. return 1;
  24. }
  25. rc = Tss2_Sys_FlushContext(sys_context, handle);
  26. if (rc != TSS2_RC_SUCCESS) {
  27. LOG_ERROR("Tss2_Sys_FlushContext failed with 0x%"PRIx32, rc);
  28. return 99; /* fatal error */
  29. }
  30. return 0;
  31. }