pal_security.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. /* enclave information */
  25. sgx_arch_hash_t mrenclave;
  26. sgx_arch_hash_t mrsigner;
  27. sgx_arch_attributes_t enclave_attributes;
  28. /* remaining heap usable by application */
  29. PAL_PTR heap_min, heap_max;
  30. /* executable name, addr and size */
  31. PAL_SEC_STR exec_name;
  32. PAL_PTR exec_addr;
  33. PAL_NUM exec_size;
  34. PAL_SEC_STR manifest_name;
  35. /* need three proc fds if it has a parent */
  36. PAL_IDX proc_fds[3];
  37. /* additional information */
  38. PAL_SEC_STR pipe_prefix;
  39. PAL_IDX mcast_port, mcast_srv, mcast_cli;
  40. #ifdef DEBUG
  41. PAL_BOL in_gdb;
  42. #endif
  43. #if PRINT_ENCLAVE_STAT == 1
  44. PAL_NUM start_time;
  45. #endif
  46. };
  47. #ifdef IN_ENCLAVE
  48. extern struct pal_sec pal_sec;
  49. #endif
  50. #define GRAPHENE_TEMPDIR "/tmp/graphene"
  51. #define GRAPHENE_PIPEDIR (GRAPHENE_TEMPDIR "/pipes")
  52. #define PROC_INIT_FD 255
  53. #define MCAST_GROUP "239.0.0.1"
  54. #endif /* PAL_SECURITY_H */