pal_security.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* Copyright (C) 2014 Stony Brook University
  2. This file is part of Graphene Library OS.
  3. Graphene Library OS is free software: you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public License
  5. as published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. Graphene Library OS is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. #ifndef PAL_SECURITY_H
  14. #define PAL_SECURITY_H
  15. #include "pal.h"
  16. #include "sgx_arch.h"
  17. typedef char PAL_SEC_STR[255];
  18. struct pal_sec {
  19. /* host credentials */
  20. PAL_NUM instance_id;
  21. PAL_IDX ppid, pid, uid, gid;
  22. /* enclave information */
  23. sgx_target_info_t aesm_targetinfo;
  24. sgx_measurement_t mr_enclave;
  25. sgx_measurement_t mr_signer;
  26. sgx_attributes_t enclave_attributes;
  27. /* remaining heap usable by application */
  28. PAL_PTR heap_min, heap_max;
  29. /* executable name, addr and size */
  30. PAL_SEC_STR exec_name;
  31. PAL_PTR exec_addr;
  32. PAL_NUM exec_size;
  33. PAL_SEC_STR manifest_name;
  34. /* child's stream and cargo FDs created and sent over by parent */
  35. PAL_IDX stream_fd;
  36. PAL_IDX cargo_fd;
  37. /* additional information */
  38. PAL_SEC_STR pipe_prefix;
  39. /* Need to pass in the number of cores */
  40. PAL_NUM num_cpus;
  41. #ifdef DEBUG
  42. PAL_BOL in_gdb;
  43. #endif
  44. #if PRINT_ENCLAVE_STAT == 1
  45. PAL_NUM start_time;
  46. #endif
  47. };
  48. #ifdef IN_ENCLAVE
  49. extern struct pal_sec pal_sec;
  50. #endif
  51. #define GRAPHENE_TEMPDIR "/tmp/graphene"
  52. #define GRAPHENE_PIPEDIR (GRAPHENE_TEMPDIR "/pipes")
  53. #define PROC_INIT_FD 255
  54. #endif /* PAL_SECURITY_H */