pal_security.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* -*- mode:c; c-file-style:"k&r"; c-basic-offset: 4; tab-width:4; indent-tabs-mode:nil; mode:auto-fill; fill-column:78; -*- */
  2. /* vim: set ts=4 sw=4 et tw=78 fo=cqt wm=0: */
  3. /* Copyright (C) 2014 Stony Brook University
  4. This file is part of Graphene Library OS.
  5. Graphene Library OS is free software: you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public License
  7. as published by the Free Software Foundation, either version 3 of the
  8. License, or (at your option) any later version.
  9. Graphene Library OS is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. #ifndef PAL_SECURITY_H
  16. #define PAL_SECURITY_H
  17. #include "pal.h"
  18. #include "sgx_arch.h"
  19. typedef char PAL_SEC_STR[255];
  20. struct pal_sec {
  21. /* host credentials */
  22. PAL_NUM instance_id;
  23. PAL_IDX ppid, pid, uid, gid;
  24. /* file name of enclave image */
  25. PAL_PTR enclave_addr;
  26. PAL_SEC_STR enclave_image;
  27. /* enclave information */
  28. sgx_arch_hash_t mrenclave;
  29. sgx_arch_hash_t mrsigner;
  30. sgx_arch_attributes_t enclave_attributes;
  31. /* remaining heap usable by application */
  32. PAL_PTR heap_min, heap_max;
  33. /* executable name, addr and size */
  34. PAL_SEC_STR exec_name;
  35. PAL_IDX exec_fd;
  36. PAL_PTR exec_addr;
  37. PAL_NUM exec_size;
  38. /* manifest name, addr and size */
  39. PAL_SEC_STR manifest_name;
  40. PAL_IDX manifest_fd;
  41. PAL_PTR manifest_addr;
  42. PAL_NUM manifest_size;
  43. /* need three proc fds if it has a parent */
  44. PAL_IDX proc_fds[3];
  45. /* additional information */
  46. PAL_SEC_STR pipe_prefix;
  47. PAL_IDX mcast_port, mcast_srv, mcast_cli;
  48. #ifdef DEBUG
  49. PAL_BOL in_gdb;
  50. #endif
  51. #if PRINT_ENCLAVE_STAT == 1
  52. PAL_NUM start_time;
  53. #endif
  54. };
  55. #ifdef IN_ENCLAVE
  56. extern struct pal_sec pal_sec;
  57. #endif
  58. #define GRAPHENE_TEMPDIR "/tmp/graphene"
  59. #define GRAPHENE_PIPEDIR GRAPHENE_TEMPDIR "/pipes"
  60. #define PROC_INIT_FD 255
  61. #define MCAST_GROUP "239.0.0.1"
  62. #endif /* PAL_SECURITY_H */