sgx_quote.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. /**
  32. * File: sgx_quote.h
  33. * Description: Definition for quote structure.
  34. *
  35. * Quote structure and all relative structure will be defined in this file.
  36. */
  37. #ifndef _SGX_QUOTE_H_
  38. #define _SGX_QUOTE_H_
  39. #include "sgx_report.h"
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. #pragma pack(push, 1)
  44. typedef uint8_t sgx_epid_group_id_t[4];
  45. typedef struct _spid_t
  46. {
  47. uint8_t id[16];
  48. } sgx_spid_t;
  49. typedef struct _basename_t
  50. {
  51. uint8_t name[32];
  52. } sgx_basename_t;
  53. typedef struct _quote_nonce
  54. {
  55. uint8_t rand[16];
  56. } sgx_quote_nonce_t;
  57. typedef enum
  58. {
  59. SGX_UNLINKABLE_SIGNATURE,
  60. SGX_LINKABLE_SIGNATURE
  61. } sgx_quote_sign_type_t;
  62. typedef struct _quote_t
  63. {
  64. uint16_t version; /* 0 */
  65. uint16_t sign_type; /* 2 */
  66. sgx_epid_group_id_t epid_group_id; /* 4 */
  67. sgx_isv_svn_t qe_svn; /* 8 */
  68. sgx_isv_svn_t pce_svn; /* 10 */
  69. uint32_t xeid; /* 12 */
  70. sgx_basename_t basename; /* 16 */
  71. sgx_report_body_t report_body; /* 48 */
  72. uint32_t signature_len; /* 432 */
  73. uint8_t signature[]; /* 436 */
  74. } sgx_quote_t;
  75. #define SGX_PLATFORM_INFO_SIZE 101
  76. typedef struct _platform_info
  77. {
  78. uint8_t platform_info[SGX_PLATFORM_INFO_SIZE];
  79. } sgx_platform_info_t;
  80. typedef struct _update_info_bit
  81. {
  82. int ucodeUpdate;
  83. int csmeFwUpdate;
  84. int pswUpdate;
  85. } sgx_update_info_bit_t;
  86. #pragma pack(pop)
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90. #endif