aeerror.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. /*
  2. * Copyright (C) 2011-2018 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_EINITTOKEN_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. /* PSE ERROR CASES*/
  82. PSE_PAIRING_BLOB_SEALING_ERROR = 44,
  83. PSE_PAIRING_BLOB_UNSEALING_ERROR = 45,
  84. PSE_PAIRING_BLOB_INVALID_ERROR = 46,
  85. /* PSE_OP ERROR CASES*/
  86. PSE_OP_PARAMETER_ERROR = 47,
  87. PSE_OP_INTERNAL_ERROR = 48,
  88. PSE_OP_MAX_NUM_SESSION_REACHED = 49,
  89. PSE_OP_SESSION_INVALID = 50,
  90. PSE_OP_SERVICE_MSG_ERROR = 51,
  91. PSE_OP_EPHEMERAL_SESSION_INVALID = 52,
  92. PSE_OP_ERROR_EPH_SESSION_ESTABLISHMENT_INTEGRITY_ERROR = 53,
  93. PSE_OP_UNKNWON_REQUEST_ERROR = 54,
  94. PSE_OP_PSDA_BUSY_ERROR = 55,
  95. PSE_OP_LTPB_SEALING_OUT_OF_DATE = 56,
  96. // PSDA ERROR CODES
  97. AESM_PSDA_NOT_AVAILABLE = 57,
  98. AESM_PSDA_INTERNAL_ERROR = 58,
  99. AESM_PSDA_NEED_REPAIRING = 59,
  100. AESM_PSDA_LT_SESSION_INTEGRITY_ERROR = 60,
  101. AESM_PSDA_NOT_PROVISONED_ERROR = 61,
  102. AESM_PSDA_PROTOCOL_NOT_SUPPORTED = 62,
  103. AESM_PSDA_PLATFORM_KEYS_REVOKED = 63,
  104. AESM_PSDA_SESSION_LOST = 64,
  105. AESM_PSDA_WRITE_THROTTLED = 65,
  106. // PSE_Pr ERROR CASES
  107. PSE_PR_ERROR = 66,
  108. PSE_PR_PARAMETER_ERROR = 67,
  109. PSE_PR_ENCLAVE_EXCEPTION = 68,
  110. PSE_PR_CALL_ORDER_ERROR = 69,
  111. PSE_PR_ASN1DER_DECODING_ERROR = 70,
  112. PSE_PR_PAIRING_BLOB_SIZE_ERROR = 71,
  113. PSE_PR_BAD_POINTER_ERROR = 72,
  114. PSE_PR_SIGNING_CSR_ERROR = 73,
  115. PSE_PR_MSG_SIGNING_ERROR = 74,
  116. PSE_PR_INSUFFICIENT_MEMORY_ERROR = 75,
  117. PSE_PR_BUFFER_TOO_SMALL_ERROR = 76,
  118. PSE_PR_S3_DATA_ERROR = 77,
  119. PSE_PR_KEY_PAIR_GENERATION_ERROR = 78,
  120. PSE_PR_DERIVE_SMK_ERROR = 79,
  121. PSE_PR_CREATE_REPORT_ERROR = 80,
  122. PSE_PR_HASH_CALC_ERROR = 81,
  123. PSE_PR_HMAC_CALC_ERROR = 82,
  124. PSE_PR_ID_CALC_ERROR = 83,
  125. PSE_PR_HMAC_COMPARE_ERROR = 84,
  126. PSE_PR_GA_COMPARE_ERROR = 85,
  127. PSE_PR_TASK_INFO_ERROR = 86,
  128. PSE_PR_MSG_COMPARE_ERROR = 87,
  129. PSE_PR_GID_MISMATCH_ERROR = 88,
  130. PSE_PR_PR_CALC_ERROR = 89,
  131. PSE_PR_PARAM_CERT_SIZE_ERROR = 90,
  132. PSE_PR_CERT_SIZE_ERROR = 91,
  133. PSE_PR_NO_OCSP_RESPONSE_ERROR = 92,
  134. PSE_PR_X509_PARSE_ERROR = 93,
  135. PSE_PR_READ_RAND_ERROR = 94,
  136. PSE_PR_INTERNAL_ERROR = 95,
  137. PSE_PR_ENCLAVE_BRIDGE_ERROR = 96,
  138. PSE_PR_ENCLAVE_LOST_ERROR = 97,
  139. PSE_PR_PCH_EPID_UNKNOWN_ERROR = 98,
  140. PSE_PR_PCH_EPID_NOT_IMPLEMENTED = 99,
  141. PSE_PR_PCH_EPID_SIG_INVALID =100,
  142. PSE_PR_PCH_EPID_SIG_REVOKED_IN_PRIVRL =101,
  143. PSE_PR_PCH_EPID_NO_MEMORY_ERR =102,
  144. PSE_PR_PCH_EPID_BAD_ARG_ERR =103,
  145. PSE_PR_PCH_EPID_SIG_REVOKED_IN_VERIFIERRL=104,
  146. PSE_PR_PCH_EPID_DIVIDED_BY_ZERO_ERR =105,
  147. PSE_PR_PCH_EPID_MATH_ERR =106,
  148. PSE_PR_PCH_EPID_RAND_MAX_ITER_ERR =107,
  149. PSE_PR_PCH_EPID_UNDERFLOW_ERR =108,
  150. PSE_PR_PCH_EPID_HASH_ALGORITHM_NOT_SUPPORTED =109,
  151. PSE_PR_PCH_EPID_DUPLICATE_ERR =110,
  152. PSE_PR_PCH_EPID_SIG_REVOKED_IN_GROUPRL =111,
  153. PSE_PR_PCH_EPID_SIG_REVOKED_IN_SIGRL =112,
  154. PSE_PR_PCH_EPID_INCONSISTENT_BASENAME_SET_ERR =113,
  155. /* AESM PSE_Pr ERROR CASES*/
  156. AESM_PSE_PR_ERROR_GETTING_GROUP_ID_FROM_ME =114,
  157. AESM_PSE_PR_INIT_QUOTE_ERROR =115,
  158. AESM_PSE_PR_GET_QUOTE_ERROR =116,
  159. AESM_PSE_PR_INSUFFICIENT_MEMORY_ERROR =117,
  160. AESM_PSE_PR_BUFFER_TOO_SMALL =118,
  161. AESM_PSE_PR_MAX_SIGRL_ENTRIES_EXCEEDED =119,
  162. AESM_PSE_PR_MAX_PRIVRL_ENTRIES_EXCEEDED =120,
  163. AESM_PSE_PR_GET_SIGRL_ERROR =121,
  164. AESM_PSE_PR_GET_OCSPRESP_ERROR =122,
  165. AESM_PSE_PR_CERT_SAVE_ERROR =123,
  166. AESM_PSE_PR_CERT_LOAD_ERROR =124,
  167. AESM_PSE_PR_CERT_DELETE_ERROR =125,
  168. AESM_PSE_PR_PSDA_LOAD_ERROR =126,
  169. AESM_PSE_PR_PSDA_PROVISION_ERROR =127,
  170. AESM_PSE_PR_PSDA_NOT_PROVISIONED =128,
  171. AESM_PSE_PR_PSDA_GET_GROUP_ID =129,
  172. AESM_PSE_PR_PSDA_LTP_EXCHANGE_ERROR =130,
  173. AESM_PSE_PR_PSDA_LTP_S1_ERROR =131,
  174. AESM_PSE_PR_PERSISTENT_STORAGE_DELETE_ERROR =132,
  175. AESM_PSE_PR_PERSISTENT_STORAGE_OPEN_ERROR=133,
  176. AESM_PSE_PR_PERSISTENT_STORAGE_WRITE_ERROR=134,
  177. AESM_PSE_PR_PERSISTENT_STORAGE_READ_ERROR=135,
  178. AESM_PSE_PR_BAD_POINTER_ERROR =136,
  179. AESM_PSE_PR_CALL_ORDER_ERROR =137,
  180. AESM_PSE_PR_INTERNAL_ERROR =138,
  181. AESM_PRSE_HECI_INIT_ERROR =139,
  182. AESM_PSE_PR_LOAD_VERIFIER_CERT_ERROR =140,
  183. AESM_PSE_PR_EXCEPTION =141,
  184. AESM_PSE_PR_OCSP_RESPONSE_STATUS_MALFORMEDREQUEST =142,
  185. AESM_PSE_PR_OCSP_RESPONSE_STATUS_INTERNALERROR =143,
  186. AESM_PSE_PR_OCSP_RESPONSE_STATUS_TRYLATER=144,
  187. AESM_PSE_PR_OCSP_RESPONSE_STATUS_SIGREQUIRED =145,
  188. AESM_PSE_PR_OCSP_RESPONSE_STATUS_UNAUTHORIZED =146,
  189. AESM_PSE_PR_OCSP_RESPONSE_INTERNAL_ERROR =147,
  190. AESM_PSE_PR_OCSP_RESPONSE_NO_NONCE_ERROR =148,
  191. AESM_PSE_PR_OCSP_RESPONSE_NONCE_VERIFY_ERROR =149,
  192. AESM_PSE_PR_OCSP_RESPONSE_VERIFY_ERROR =150,
  193. AESP_PSE_PR_OCSP_RESPONSE_CERT_COUNT_ERROR =151,
  194. AESM_PSE_PR_ICLS_CLIENT_MISSING_ERROR =152,
  195. AESM_PSE_PR_NO_OCSP_RESPONSE_ERROR =153,
  196. AESM_PSE_PR_RL_RESP_HEADER_ERROR =154,
  197. AESM_PSE_PR_RL_SERVER_ERROR =155,
  198. AESM_PSE_PR_BACKEND_INVALID_GID =156,
  199. AESM_PSE_PR_BACKEND_GID_REVOKED =157,
  200. AESM_PSE_PR_BACKEND_INVALID_QUOTE =158,
  201. AESM_PSE_PR_BACKEND_INVALID_REQUEST =159,
  202. AESM_PSE_PR_BACKEND_UNKNOWN_PROTOCOL_RESPONSE =160,
  203. AESM_PSE_PR_BACKEND_SERVER_BUSY =161,
  204. AESM_PSE_PR_BACKEND_INTEGRITY_CHECK_FAIL =162,
  205. AESM_PSE_PR_BACKEND_INCORRECT_SYNTAX =163,
  206. AESM_PSE_PR_BACKEND_INCOMPATIBLE_VERSION =164,
  207. AESM_PSE_PR_BACKEND_TRANSACTION_STATE_LOST =165,
  208. AESM_PSE_PR_BACKEND_PROTOCOL_ERROR =166,
  209. AESM_PSE_PR_BACKEND_INTERNAL_ERROR =167,
  210. AESM_PSE_PR_BACKEND_UNKNOWN_GENERAL_RESPONSE =168,
  211. AESM_PSE_PR_BACKEND_MSG1_GENERATE =169,
  212. AESM_PSE_PR_BACKEND_MSG2_RESPONSE_HEADER_INTEGRITY =170,
  213. AESM_PSE_PR_BACKEND_MSG3_GENERATE =171,
  214. AESM_PSE_PR_BACKEND_MSG4_RESPONSE_HEADER_INTEGRITY =172,
  215. AESM_PSE_PR_BACKEND_MSG4_TLV_INTEGRITY =173,
  216. AESM_PSE_PR_BACKEND_MSG4_PLATFORM_INFO_BLOB_SIZE =174,
  217. AESM_PSE_PR_BACKEND_MSG4_LEAF_CERTIFICATE_SIZE =175,
  218. AESM_PSE_PR_BACKEND_MSG4_UNEXPECTED_TLV_TYPE =176,
  219. AESM_PSE_PR_BACKEND_INVALID_URL =177,
  220. AESM_PSE_PR_BACKEND_NOT_INITIALIZED =178,
  221. AESM_NLTP_NO_LTP_BLOB =179,
  222. AESM_NLTP_DONT_NEED_UPDATE_PAIR_LTP =180,
  223. AESM_NLTP_MAY_NEED_UPDATE_LTP =181,
  224. AESM_NLTP_OLD_EPID11_RLS =182,
  225. AESM_PCP_NEED_PSE_UPDATE =183,
  226. AESM_PCP_PSE_CERT_PROVISIONING_ATTESTATION_FAILURE_NEED_EPID_UPDATE =184,
  227. AESM_PCP_PSE_CERT_PROVISIONING_ATTESTATION_FAILURE_MIGHT_NEED_EPID_UPDATE =185,
  228. AESM_PCP_SIMPLE_PSE_CERT_PROVISIONING_ERROR =186,
  229. AESM_PCP_SIMPLE_EPID_PROVISION_ERROR =187,
  230. AESM_NPC_DONT_NEED_PSEP =188,
  231. AESM_NPC_NO_PSE_CERT =189,
  232. AESM_NPC_DONT_NEED_UPDATE_PSEP =190,
  233. AESM_NPC_MAY_NEED_UPDATE_PSEP =191,
  234. AESM_NEP_DONT_NEED_EPID_PROVISIONING =192,
  235. AESM_NEP_DONT_NEED_UPDATE_PVEQE =193,
  236. AESM_NEP_PERFORMANCE_REKEY =194,
  237. AESM_NEP_MAY_NEED_UPDATE =195,
  238. AESM_CP_ATTESTATION_FAILURE =196,
  239. AESM_LTP_PSE_CERT_REVOKED =197,
  240. AESM_LTP_SIMPLE_LTP_ERROR =198,
  241. AESM_PSE_PR_GET_PRIVRL_ERROR =199,
  242. AESM_NETWORK_TIMEOUT =200,
  243. PSW_UPDATE_REQUIRED =201,
  244. AESM_AE_OUT_OF_EPC =202,
  245. PVE_PROV_ATTEST_KEY_NOT_FOUND =203,
  246. PVE_INVALID_REPORT =204,
  247. PVE_XEGDSK_SIGN_ERROR =205,
  248. // PCE ERROR CODES
  249. PCE_UNEXPECTED_ERROR =206,
  250. PCE_INVALID_PRIVILEGE =207,
  251. PCE_INVALID_REPORT =208,
  252. LE_WHITE_LIST_QUERY_BUSY =209,
  253. AESM_AE_NO_DEVICE =210,
  254. EXTENDED_GROUP_NOT_AVAILABLE =211,
  255. // MORE PSE_OP ERROR CASES
  256. PSE_OP_ERROR_KDF_MISMATCH =212,
  257. LE_WHITE_LIST_ALREADY_UPDATED =213,
  258. } ae_error_t;
  259. #define AE_FAILED(x) (AE_SUCCESS != (x))
  260. #define AE_SUCCEEDED(x) (AE_SUCCESS == (x))
  261. /* These definitions are usable to exit a loop*/
  262. #define BREAK_IF_TRUE(x, Sts, ErrCode) if (x) { Sts = ErrCode; break; }
  263. #define BREAK_IF_FALSE(x, Sts, ErrCode) if (!(x)) { Sts = ErrCode; break; }
  264. #define BREAK_IF_FAILED(x) if (AE_SUCCESS != (x)) { break; }
  265. #define BREAK_IF_FAILED_ERR(x, ErrCode) if (AE_SUCCESS != (x)) { x = ErrCode; break; }
  266. #endif/*_AE_ERROR_H_*/