aeerror.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * * Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * * Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in
  12. * the documentation and/or other materials provided with the
  13. * distribution.
  14. * * Neither the name of Intel Corporation nor the names of its
  15. * contributors may be used to endorse or promote products derived
  16. * from this software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. *
  30. */
  31. #ifndef _AE_ERROR_H_
  32. #define _AE_ERROR_H_
  33. typedef enum _ae_error_t{
  34. AE_SUCCESS = 0,
  35. AE_FAILURE = 1,
  36. AE_ENCLAVE_LOST = 2,
  37. OAL_PARAMETER_ERROR = 3,
  38. OAL_PATHNAME_BUFFER_OVERFLOW_ERROR = 4,
  39. OAL_FILE_ACCESS_ERROR = 5,
  40. OAL_CONFIG_FILE_ERROR = 6,
  41. OAL_NETWORK_UNAVAILABLE_ERROR = 7,
  42. OAL_NETWORK_BUSY = 8,
  43. OAL_NETWORK_RESEND_REQUIRED = 9,
  44. OAL_PROXY_SETTING_ASSIST = 10,
  45. OAL_THREAD_ERROR = 11,
  46. OAL_THREAD_TIMEOUT_ERROR = 12,
  47. AE_PSVN_UNMATCHED_ERROR = 13,
  48. AE_SERVER_NOT_AVAILABLE = 14,
  49. AE_INVALID_PARAMETER = 15,
  50. AE_READ_RAND_ERROR = 16,
  51. AE_OUT_OF_MEMORY_ERROR = 17,
  52. AE_INSUFFICIENT_DATA_IN_BUFFER = 18,
  53. /* QUOTING ENCLAVE ERROR CASES*/
  54. QE_UNEXPECTED_ERROR = 19,
  55. QE_PARAMETER_ERROR = 20,
  56. QE_EPIDBLOB_ERROR = 21,
  57. QE_REVOKED_ERROR = 22,
  58. QE_SIGRL_ERROR = 23,
  59. /* PROVISIONING ENCLAVE ERROR CASES*/
  60. PVE_UNEXPECTED_ERROR = 24,
  61. PVE_PARAMETER_ERROR = 25,
  62. PVE_EPIDBLOB_ERROR = 26,
  63. PVE_INSUFFICIENT_MEMORY_ERROR = 27,
  64. PVE_INTEGRITY_CHECK_ERROR = 28,
  65. PVE_SIGRL_INTEGRITY_CHECK_ERROR = 29,
  66. PVE_SERVER_REPORTED_ERROR = 30,
  67. PVE_PEK_SIGN_ERROR = 31,
  68. PVE_MSG_ERROR = 32,
  69. PVE_REVOKED_ERROR = 33,
  70. PVE_SESSION_OUT_OF_ORDER_ERROR = 34,
  71. PVE_SERVER_BUSY_ERROR = 35,
  72. PVE_PERFORMANCE_REKEY_NOT_SUPPORTED = 36,
  73. /* LICENSING ENCLAVE ERROR CASES*/
  74. LE_UNEXPECTED_ERROR = 37,
  75. LE_INVALID_PARAMETER = 38,
  76. LE_GET_LICENSE_KEY_ERROR = 39,
  77. LE_INVALID_ATTRIBUTE = 40,
  78. LE_INVALID_PRIVILEGE_ERROR = 41,
  79. LE_WHITELIST_UNINITIALIZED_ERROR = 42,
  80. LE_CALC_LIC_TOKEN_ERROR = 43,
  81. AESM_NLTP_NO_LTP_BLOB =178,
  82. AESM_NLTP_DONT_NEED_UPDATE_PAIR_LTP =179,
  83. AESM_NLTP_MAY_NEED_UPDATE_LTP =180,
  84. AESM_NLTP_OLD_EPID11_RLS =181,
  85. AESM_PCP_NEED_PSE_UPDATE =182,
  86. AESM_PCP_PSE_CERT_PROVISIONING_ATTESTATION_FAILURE_NEED_EPID_UPDATE =183,
  87. AESM_PCP_PSE_CERT_PROVISIONING_ATTESTATION_FAILURE_MIGHT_NEED_EPID_UPDATE =184,
  88. AESM_PCP_SIMPLE_PSE_CERT_PROVISIONING_ERROR =185,
  89. AESM_PCP_SIMPLE_EPID_PROVISION_ERROR =186,
  90. AESM_NPC_DONT_NEED_PSEP =187,
  91. AESM_NPC_NO_PSE_CERT =188,
  92. AESM_NPC_DONT_NEED_UPDATE_PSEP =189,
  93. AESM_NPC_MAY_NEED_UPDATE_PSEP =190,
  94. AESM_NEP_DONT_NEED_EPID_PROVISIONING =191,
  95. AESM_NEP_DONT_NEED_UPDATE_PVEQE =192,
  96. AESM_NEP_PERFORMANCE_REKEY =193,
  97. AESM_NEP_MAY_NEED_UPDATE =194,
  98. AESM_CP_ATTESTATION_FAILURE =195,
  99. AESM_LTP_PSE_CERT_REVOKED =196,
  100. AESM_LTP_SIMPLE_LTP_ERROR =197,
  101. AESM_PSE_PR_GET_PRIVRL_ERROR =198,
  102. AESM_NETWORK_TIMEOUT =199,
  103. AE_SERVICE_NOT_AVAILABLE =200,
  104. PSW_UPDATED_REQUIRED =201
  105. } ae_error_t;
  106. #define AE_FAILED(x) (AE_SUCCESS != (x))
  107. #define AE_SUCCEEDED(x) (AE_SUCCESS == (x))
  108. /* These definitions are usable to exit a loop*/
  109. #define BREAK_IF_TRUE(x, Sts, ErrCode) if (x) { Sts = ErrCode; break; }
  110. #define BREAK_IF_FALSE(x, Sts, ErrCode) if (!(x)) { Sts = ErrCode; break; }
  111. #define BREAK_IF_FAILED(x) if (AE_SUCCESS != (x)) { break; }
  112. #define BREAK_IF_FAILED_ERR(x, ErrCode) if (AE_SUCCESS != (x)) { x = ErrCode; break; }
  113. #endif/*_AE_ERROR_H_*/