diff --git a/.drone.yml b/.drone.yml index d9fd407c..cd81ae34 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,14 +3,14 @@ name: RSA-sgx-xargo-1604-sw steps: - name: sim-compile - image: baiduxlab/sgx-rust:1604-1.1.0 + image: baiduxlab/sgx-rust:1604-1.1.1 commands: - . /opt/sgxsdk/environment - . /root/.cargo/env - cd sgx && SGX_MODE=SW XARGO_SGX=1 make -C RSA-sgx-test - name: sim-test - image: baiduxlab/sgx-rust:1604-1.1.0 + image: baiduxlab/sgx-rust:1604-1.1.1 commands: - . /opt/sgxsdk/environment - cd sgx/RSA-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt @@ -25,14 +25,14 @@ name: RSA-sgx-xargo-1604-hw steps: - name: hw-compile - image: baiduxlab/sgx-rust:1604-1.1.0 + image: baiduxlab/sgx-rust:1604-1.1.1 commands: - . /opt/sgxsdk/environment - . /root/.cargo/env - cd sgx && XARGO_SGX=1 make -C RSA-sgx-test - name: hw-test - image: baiduxlab/sgx-rust:1604-1.1.0 + image: baiduxlab/sgx-rust:1604-1.1.1 privileged: true volumes: - name: isgx @@ -63,14 +63,14 @@ name: RSA-sgx-xargo-1804-sw steps: - name: sim-compile - image: baiduxlab/sgx-rust:1804-1.1.0 + image: baiduxlab/sgx-rust:1804-1.1.1 commands: - . /opt/sgxsdk/environment - . /root/.cargo/env - cd sgx && SGX_MODE=SW XARGO_SGX=1 make -C RSA-sgx-test - name: sim-test - image: baiduxlab/sgx-rust:1804-1.1.0 + image: baiduxlab/sgx-rust:1804-1.1.1 commands: - . /opt/sgxsdk/environment - cd sgx/RSA-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt @@ -85,14 +85,14 @@ name: RSA-sgx-xargo-1804-hw steps: - name: hw-compile - image: baiduxlab/sgx-rust:1804-1.1.0 + image: baiduxlab/sgx-rust:1804-1.1.1 commands: - . /opt/sgxsdk/environment - . /root/.cargo/env - cd sgx && XARGO_SGX=1 make -C RSA-sgx-test - name: hw-test - image: baiduxlab/sgx-rust:1804-1.1.0 + image: baiduxlab/sgx-rust:1804-1.1.1 privileged: true volumes: - name: isgx @@ -123,14 +123,14 @@ name: RSA-sgx-1604-sw steps: - name: sim-compile - image: baiduxlab/sgx-rust:1604-1.1.0 + image: baiduxlab/sgx-rust:1604-1.1.1 commands: - . /opt/sgxsdk/environment - . /root/.cargo/env - SGX_MODE=SW make -C sgx/RSA-sgx-test - name: sim-test - image: baiduxlab/sgx-rust:1604-1.1.0 + image: baiduxlab/sgx-rust:1604-1.1.1 commands: - . /opt/sgxsdk/environment - cd sgx/RSA-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt @@ -145,14 +145,14 @@ name: RSA-sgx-1604-hw steps: - name: hw-compile - image: baiduxlab/sgx-rust:1604-1.1.0 + image: baiduxlab/sgx-rust:1604-1.1.1 commands: - . /opt/sgxsdk/environment - . /root/.cargo/env - make -C sgx/RSA-sgx-test - name: hw-test - image: baiduxlab/sgx-rust:1604-1.1.0 + image: baiduxlab/sgx-rust:1604-1.1.1 privileged: true volumes: - name: isgx @@ -183,14 +183,14 @@ name: RSA-sgx-1804-sw steps: - name: sim-compile - image: baiduxlab/sgx-rust:1804-1.1.0 + image: baiduxlab/sgx-rust:1804-1.1.1 commands: - . /opt/sgxsdk/environment - . /root/.cargo/env - SGX_MODE=SW make -C sgx/RSA-sgx-test - name: sim-test - image: baiduxlab/sgx-rust:1804-1.1.0 + image: baiduxlab/sgx-rust:1804-1.1.1 commands: - . /opt/sgxsdk/environment - cd sgx/RSA-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt @@ -205,14 +205,14 @@ name: RSA-sgx-1804-hw steps: - name: hw-compile - image: baiduxlab/sgx-rust:1804-1.1.0 + image: baiduxlab/sgx-rust:1804-1.1.1 commands: - . /opt/sgxsdk/environment - . /root/.cargo/env - make -C sgx/RSA-sgx-test - name: hw-test - image: baiduxlab/sgx-rust:1804-1.1.0 + image: baiduxlab/sgx-rust:1804-1.1.1 privileged: true volumes: - name: isgx diff --git a/Cargo.toml b/Cargo.toml index 7c12a237..4b6464a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,11 +17,11 @@ num-traits = { git = "https://github.com/mesalock-linux/num-traits-sgx" } num-integer = { git = "https://github.com/mesalock-linux/num-integer-sgx" } num-iter = {git = "https://github.com/mesalock-linux/num-iter-sgx" } lazy_static = { version = "1.3.0", default-features = false, features = ["spin_no_std"] } -rand = { git = "https://github.com/mesalock-linux/rand-sgx", tag = "v0.6.5_sgx1.1.0" } +rand = { git = "https://github.com/mesalock-linux/rand-sgx", tag = "v0.6.5_sgx1.1.1" } byteorder = { git = "https://github.com/mesalock-linux/byteorder-sgx" } #failure= { git = "https://github.com/mesalock-linux/failure-sgx" } subtle = { git = "https://github.com/mesalock-linux/subtle-sgx" } -sgx_tstd = { rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } +sgx_tstd = { rev = "v1.1.1", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } [dependencies.zeroize] version = "1.1.0" diff --git a/sgx/RSA-sgx-test/app/Cargo.toml b/sgx/RSA-sgx-test/app/Cargo.toml index c7935efd..c5cce681 100644 --- a/sgx/RSA-sgx-test/app/Cargo.toml +++ b/sgx/RSA-sgx-test/app/Cargo.toml @@ -5,6 +5,6 @@ authors = ["Baidu"] build = "build.rs" [dependencies] -sgx_types = { rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git" } -sgx_urts = { rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git" } +sgx_types = { rev = "v1.1.1", git = "https://github.com/apache/teaclave-sgx-sdk.git" } +sgx_urts = { rev = "v1.1.1", git = "https://github.com/apache/teaclave-sgx-sdk.git" } dirs = "1.0.2" diff --git a/sgx/RSA-sgx-test/common/inc/assert.h b/sgx/RSA-sgx-test/common/inc/assert.h index 82489e80..a1539954 100644 --- a/sgx/RSA-sgx-test/common/inc/assert.h +++ b/sgx/RSA-sgx-test/common/inc/assert.h @@ -1,5 +1,5 @@ -/* $OpenBSD: assert.h,v 1.12 2006/01/31 10:53:51 hshoexer Exp $ */ -/* $NetBSD: assert.h,v 1.6 1994/10/26 00:55:44 cgd Exp $ */ +/* $OpenBSD: assert.h,v 1.12 2006/01/31 10:53:51 hshoexer Exp $ */ +/* $NetBSD: assert.h,v 1.6 1994/10/26 00:55:44 cgd Exp $ */ /*- * Copyright (c) 1992, 1993 diff --git a/sgx/RSA-sgx-test/common/inc/complex.h b/sgx/RSA-sgx-test/common/inc/complex.h index 93fe495d..904cb31f 100644 --- a/sgx/RSA-sgx-test/common/inc/complex.h +++ b/sgx/RSA-sgx-test/common/inc/complex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: complex.h,v 1.3 2010/07/24 22:17:03 guenther Exp $ */ +/* $OpenBSD: complex.h,v 1.3 2010/07/24 22:17:03 guenther Exp $ */ /* * Copyright (c) 2008 Martynas Venckus * @@ -16,7 +16,7 @@ */ #ifndef _COMPLEX_H_ -#define _COMPLEX_H_ +#define _COMPLEX_H_ #include @@ -25,18 +25,18 @@ */ #ifdef __GNUC__ #if __STDC_VERSION__ < 199901 -#define _Complex __complex__ +#define _Complex __complex__ #endif -#define _Complex_I 1.0fi +#define _Complex_I 1.0fi #elif defined(lint) -#define _Complex_I 1.0fi +#define _Complex_I 1.0fi #endif -#define complex _Complex +#define complex _Complex /* XXX switch to _Imaginary_I */ #undef I -#define I _Complex_I +#define I _Complex_I __BEGIN_DECLS /* diff --git a/sgx/RSA-sgx-test/common/inc/ctype.h b/sgx/RSA-sgx-test/common/inc/ctype.h index 14084470..4449d74d 100644 --- a/sgx/RSA-sgx-test/common/inc/ctype.h +++ b/sgx/RSA-sgx-test/common/inc/ctype.h @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)ctype.h 5.3 (Berkeley) 4/3/91 + * @(#)ctype.h 5.3 (Berkeley) 4/3/91 */ #ifndef _CTYPE_H_ diff --git a/sgx/RSA-sgx-test/common/inc/dirent.h b/sgx/RSA-sgx-test/common/inc/dirent.h index b3b85e85..49d612ae 100644 --- a/sgx/RSA-sgx-test/common/inc/dirent.h +++ b/sgx/RSA-sgx-test/common/inc/dirent.h @@ -29,7 +29,7 @@ struct dirent #endif unsigned short int d_reclen; unsigned char d_type; - char d_name[256]; /* We must not include limits.h! */ + char d_name[256]; /* We must not include limits.h! */ }; //#ifdef __USE_LARGEFILE64 @@ -39,11 +39,11 @@ struct dirent64 __off64_t d_off; unsigned short int d_reclen; unsigned char d_type; - char d_name[256]; /* We must not include limits.h! */ + char d_name[256]; /* We must not include limits.h! */ }; //#endif -#define d_fileno d_ino /* Backwards compatibility. */ +#define d_fileno d_ino /* Backwards compatibility. */ #undef _DIRENT_HAVE_D_NAMLEN #define _DIRENT_HAVE_D_RECLEN @@ -52,8 +52,8 @@ struct dirent64 #if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T /* Inform libc code that these two types are effectively identical. */ -# define _DIRENT_MATCHES_DIRENT64 1 +# define _DIRENT_MATCHES_DIRENT64 1 #else -# define _DIRENT_MATCHES_DIRENT64 0 +# define _DIRENT_MATCHES_DIRENT64 0 +#endif #endif -#endif \ No newline at end of file diff --git a/sgx/RSA-sgx-test/common/inc/endian.h b/sgx/RSA-sgx-test/common/inc/endian.h index fcd74c9a..2620c589 100644 --- a/sgx/RSA-sgx-test/common/inc/endian.h +++ b/sgx/RSA-sgx-test/common/inc/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.18 2006/03/27 07:09:24 otto Exp $ */ +/* $OpenBSD: endian.h,v 1.18 2006/03/27 07:09:24 otto Exp $ */ /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. diff --git a/sgx/RSA-sgx-test/common/inc/errno.h b/sgx/RSA-sgx-test/common/inc/errno.h index 0924d5ac..dbe293cb 100644 --- a/sgx/RSA-sgx-test/common/inc/errno.h +++ b/sgx/RSA-sgx-test/common/inc/errno.h @@ -1,4 +1,4 @@ -/* $OpenBSD: errno.h,v 1.1 2005/12/28 16:33:56 millert Exp $ */ +/* $OpenBSD: errno.h,v 1.1 2005/12/28 16:33:56 millert Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)errno.h 8.5 (Berkeley) 1/21/94 + * @(#)errno.h 8.5 (Berkeley) 1/21/94 */ #ifndef _ERRNO_H_ @@ -180,7 +180,7 @@ __BEGIN_DECLS #ifndef errno int * _TLIBC_CDECL_ __errno(void); -#define errno (*__errno()) +#define errno (*__errno()) #endif /* errno */ __END_DECLS diff --git a/sgx/RSA-sgx-test/common/inc/float.h b/sgx/RSA-sgx-test/common/inc/float.h index 5ca839a9..e38a7c6a 100644 --- a/sgx/RSA-sgx-test/common/inc/float.h +++ b/sgx/RSA-sgx-test/common/inc/float.h @@ -1,5 +1,5 @@ -/* $OpenBSD: float.h,v 1.3 2008/07/21 20:50:54 martynas Exp $ */ -/* $NetBSD: float.h,v 1.8 1995/06/20 20:45:37 jtc Exp $ */ +/* $OpenBSD: float.h,v 1.3 2008/07/21 20:50:54 martynas Exp $ */ +/* $NetBSD: float.h,v 1.8 1995/06/20 20:45:37 jtc Exp $ */ /* * Copyright (c) 1989 Regents of the University of California. diff --git a/sgx/RSA-sgx-test/common/inc/iso646.h b/sgx/RSA-sgx-test/common/inc/iso646.h index 83feb52e..a0c341b6 100644 --- a/sgx/RSA-sgx-test/common/inc/iso646.h +++ b/sgx/RSA-sgx-test/common/inc/iso646.h @@ -1,5 +1,5 @@ -/* $OpenBSD: iso646.h,v 1.3 2001/10/11 00:05:21 espie Exp $ */ -/* $NetBSD: iso646.h,v 1.1 1995/02/17 09:08:10 jtc Exp $ */ +/* $OpenBSD: iso646.h,v 1.3 2001/10/11 00:05:21 espie Exp $ */ +/* $NetBSD: iso646.h,v 1.1 1995/02/17 09:08:10 jtc Exp $ */ /* * Written by J.T. Conklin 02/16/95. diff --git a/sgx/RSA-sgx-test/common/inc/limits.h b/sgx/RSA-sgx-test/common/inc/limits.h index fab59c9b..9d42cb54 100644 --- a/sgx/RSA-sgx-test/common/inc/limits.h +++ b/sgx/RSA-sgx-test/common/inc/limits.h @@ -1,5 +1,5 @@ -/* $OpenBSD: limits.h,v 1.15 2008/02/10 09:59:54 kettenis Exp $ */ -/* $NetBSD: limits.h,v 1.7 1994/10/26 00:56:00 cgd Exp $ */ +/* $OpenBSD: limits.h,v 1.15 2008/02/10 09:59:54 kettenis Exp $ */ +/* $NetBSD: limits.h,v 1.7 1994/10/26 00:56:00 cgd Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)limits.h 5.9 (Berkeley) 4/3/91 + * @(#)limits.h 5.9 (Berkeley) 4/3/91 */ diff --git a/sgx/RSA-sgx-test/common/inc/math.h b/sgx/RSA-sgx-test/common/inc/math.h index 749f935a..6ea425b8 100644 --- a/sgx/RSA-sgx-test/common/inc/math.h +++ b/sgx/RSA-sgx-test/common/inc/math.h @@ -1,4 +1,4 @@ -/* $OpenBSD: math.h,v 1.27 2010/12/14 11:16:15 martynas Exp $ */ +/* $OpenBSD: math.h,v 1.27 2010/12/14 11:16:15 martynas Exp $ */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. @@ -145,7 +145,7 @@ double _TLIBC_CDECL_ tgamma(double); double _TLIBC_CDECL_ nearbyint(double); double _TLIBC_CDECL_ rint(double); -long int _TLIBC_CDECL_ lrint(double); +long int _TLIBC_CDECL_ lrint(double); long long int _TLIBC_CDECL_ llrint(double); double _TLIBC_CDECL_ round(double); long int _TLIBC_CDECL_ lround(double); diff --git a/sgx/RSA-sgx-test/common/inc/mbusafecrt.h b/sgx/RSA-sgx-test/common/inc/mbusafecrt.h index 466c5504..3bdfe7ae 100644 --- a/sgx/RSA-sgx-test/common/inc/mbusafecrt.h +++ b/sgx/RSA-sgx-test/common/inc/mbusafecrt.h @@ -1,6 +1,6 @@ // // Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. // /*** @@ -80,4 +80,4 @@ extern errno_t memmove_s( void * dst, size_t sizeInBytes, const void * src, size } #endif -#endif /* MBUSAFECRT_H */ +#endif /* MBUSAFECRT_H */ diff --git a/sgx/RSA-sgx-test/common/inc/netdb.h b/sgx/RSA-sgx-test/common/inc/netdb.h new file mode 100644 index 00000000..5b39fcee --- /dev/null +++ b/sgx/RSA-sgx-test/common/inc/netdb.h @@ -0,0 +1,37 @@ + /* Copyright (C) 1996-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* All data returned by the network data base library are supplied in + host order and returned in network order (suitable for use in + system calls). */ + +#ifndef _NETDB_H +#define _NETDB_H + +struct addrinfo +{ + int ai_flags; /* Input flags. */ + int ai_family; /* Protocol family for socket. */ + int ai_socktype; /* Socket type. */ + int ai_protocol; /* Protocol for socket. */ + socklen_t ai_addrlen; /* Length of socket address. */ + struct sockaddr *ai_addr; /* Socket address for socket. */ + char *ai_canonname; /* Canonical name for service location. */ + struct addrinfo *ai_next; /* Pointer to next in list. */ +}; + +#endif diff --git a/sgx/RSA-sgx-test/common/inc/poll.h b/sgx/RSA-sgx-test/common/inc/poll.h index 35815a90..1a070e07 100644 --- a/sgx/RSA-sgx-test/common/inc/poll.h +++ b/sgx/RSA-sgx-test/common/inc/poll.h @@ -7,9 +7,9 @@ typedef unsigned long int nfds_t; /* Data structure describing a polling request. */ struct pollfd { - int fd; /* File descriptor to poll. */ - short int events; /* Types of events poller cares about. */ - short int revents; /* Types of events that actually occurred. */ + int fd; /* File descriptor to poll. */ + short int events; /* Types of events poller cares about. */ + short int revents; /* Types of events that actually occurred. */ }; #endif diff --git a/sgx/RSA-sgx-test/common/inc/pwd.h b/sgx/RSA-sgx-test/common/inc/pwd.h new file mode 100644 index 00000000..fc947d84 --- /dev/null +++ b/sgx/RSA-sgx-test/common/inc/pwd.h @@ -0,0 +1,36 @@ +/* Copyright (C) 1991-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* + * POSIX Standard: 9.2.2 User Database Access + */ + +#ifndef _PWD_H +#define _PWD_H + +struct passwd +{ + char *pw_name; /* Username. */ + char *pw_passwd; /* Password. */ + __uid_t pw_uid; /* User ID. */ + __gid_t pw_gid; /* Group ID. */ + char *pw_gecos; /* Real name. */ + char *pw_dir; /* Home directory. */ + char *pw_shell; /* Shell program. */ +}; + +#endif diff --git a/sgx/RSA-sgx-test/common/inc/sched.h b/sgx/RSA-sgx-test/common/inc/sched.h new file mode 100644 index 00000000..5c29893c --- /dev/null +++ b/sgx/RSA-sgx-test/common/inc/sched.h @@ -0,0 +1,40 @@ +/* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993 + scheduling interface. + Copyright (C) 1996-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SCHED_H +#define _SCHED_H +#include + +/* Size definition for CPU sets. */ +#define __CPU_SETSIZE 1024 +#define __NCPUBITS (8 * sizeof (__cpu_mask)) + +/* Basic access functions. */ +#define __CPUELT(cpu) ((cpu) / __NCPUBITS) +#define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) + +/* Data structure to describe CPU mask. */ +typedef struct +{ + __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS]; +} cpu_set_t; + +typedef __pid_t pid_t; + +#endif \ No newline at end of file diff --git a/sgx/RSA-sgx-test/common/inc/setjmp.h b/sgx/RSA-sgx-test/common/inc/setjmp.h index 6954e2b2..752f0cf7 100644 --- a/sgx/RSA-sgx-test/common/inc/setjmp.h +++ b/sgx/RSA-sgx-test/common/inc/setjmp.h @@ -1,4 +1,4 @@ -/* $NetBSD: setjmp.h,v 1.26 2011/11/05 09:27:06 joerg Exp $ */ +/* $NetBSD: setjmp.h,v 1.26 2011/11/05 09:27:06 joerg Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)setjmp.h 8.2 (Berkeley) 1/21/94 + * @(#)setjmp.h 8.2 (Berkeley) 1/21/94 */ #ifndef _SETJMP_H_ diff --git a/sgx/RSA-sgx-test/common/inc/stdarg.h b/sgx/RSA-sgx-test/common/inc/stdarg.h index ed73e246..b2a5d36e 100644 --- a/sgx/RSA-sgx-test/common/inc/stdarg.h +++ b/sgx/RSA-sgx-test/common/inc/stdarg.h @@ -1,5 +1,5 @@ -/* $OpenBSD: stdarg.h,v 1.14 2010/12/30 05:01:36 tedu Exp $ */ -/* $NetBSD: stdarg.h,v 1.12 1995/12/25 23:15:31 mycroft Exp $ */ +/* $OpenBSD: stdarg.h,v 1.14 2010/12/30 05:01:36 tedu Exp $ */ +/* $NetBSD: stdarg.h,v 1.12 1995/12/25 23:15:31 mycroft Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)stdarg.h 8.1 (Berkeley) 6/10/93 + * @(#)stdarg.h 8.1 (Berkeley) 6/10/93 */ #ifndef _STDARG_H_ diff --git a/sgx/RSA-sgx-test/common/inc/stdbool.h b/sgx/RSA-sgx-test/common/inc/stdbool.h index bd1837ec..86b866d5 100644 --- a/sgx/RSA-sgx-test/common/inc/stdbool.h +++ b/sgx/RSA-sgx-test/common/inc/stdbool.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdbool.h,v 1.5 2010/07/24 22:17:03 guenther Exp $ */ +/* $OpenBSD: stdbool.h,v 1.5 2010/07/24 22:17:03 guenther Exp $ */ /* * Written by Marc Espie, September 25, 1999 diff --git a/sgx/RSA-sgx-test/common/inc/stddef.h b/sgx/RSA-sgx-test/common/inc/stddef.h index 84509c50..c1328824 100644 --- a/sgx/RSA-sgx-test/common/inc/stddef.h +++ b/sgx/RSA-sgx-test/common/inc/stddef.h @@ -1,5 +1,5 @@ -/* $OpenBSD: stddef.h,v 1.10 2009/09/22 21:40:02 jsg Exp $ */ -/* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */ +/* $OpenBSD: stddef.h,v 1.10 2009/09/22 21:40:02 jsg Exp $ */ +/* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)stddef.h 5.5 (Berkeley) 4/3/91 + * @(#)stddef.h 5.5 (Berkeley) 4/3/91 */ #ifndef _STDDEF_H_ diff --git a/sgx/RSA-sgx-test/common/inc/stdint.h b/sgx/RSA-sgx-test/common/inc/stdint.h index d283ae92..e5744840 100644 --- a/sgx/RSA-sgx-test/common/inc/stdint.h +++ b/sgx/RSA-sgx-test/common/inc/stdint.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdint.h,v 1.4 2006/12/10 22:17:55 deraadt Exp $ */ +/* $OpenBSD: stdint.h,v 1.4 2006/12/10 22:17:55 deraadt Exp $ */ /* * Copyright (c) 1997, 2005 Todd C. Miller @@ -16,7 +16,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _STDINT_H_ +#ifndef _STDINT_H_ #define _STDINT_H_ #include diff --git a/sgx/RSA-sgx-test/common/inc/stdio.h b/sgx/RSA-sgx-test/common/inc/stdio.h index 0175a3ac..92d01a0d 100644 --- a/sgx/RSA-sgx-test/common/inc/stdio.h +++ b/sgx/RSA-sgx-test/common/inc/stdio.h @@ -1,5 +1,5 @@ -/* $OpenBSD: stdio.h,v 1.38 2009/11/09 00:18:27 kurt Exp $ */ -/* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */ +/* $OpenBSD: stdio.h,v 1.38 2009/11/09 00:18:27 kurt Exp $ */ +/* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)stdio.h 5.17 (Berkeley) 6/3/91 + * @(#)stdio.h 5.17 (Berkeley) 6/3/91 */ #ifndef _STDIO_H_ diff --git a/sgx/RSA-sgx-test/common/inc/stdlib.h b/sgx/RSA-sgx-test/common/inc/stdlib.h index f3217385..e5b63653 100644 --- a/sgx/RSA-sgx-test/common/inc/stdlib.h +++ b/sgx/RSA-sgx-test/common/inc/stdlib.h @@ -1,5 +1,5 @@ -/* $OpenBSD: stdlib.h,v 1.47 2010/05/18 22:24:55 tedu Exp $ */ -/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */ +/* $OpenBSD: stdlib.h,v 1.47 2010/05/18 22:24:55 tedu Exp $ */ +/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * -* @(#)stdlib.h 5.13 (Berkeley) 6/4/91 +* @(#)stdlib.h 5.13 (Berkeley) 6/4/91 */ #ifndef _STDLIB_H_ diff --git a/sgx/RSA-sgx-test/common/inc/string.h b/sgx/RSA-sgx-test/common/inc/string.h index 86d3cd26..0cc7206e 100644 --- a/sgx/RSA-sgx-test/common/inc/string.h +++ b/sgx/RSA-sgx-test/common/inc/string.h @@ -1,5 +1,5 @@ -/* $OpenBSD: string.h,v 1.20 2010/09/24 13:33:00 matthew Exp $ */ -/* $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ */ +/* $OpenBSD: string.h,v 1.20 2010/09/24 13:33:00 matthew Exp $ */ +/* $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)string.h 5.10 (Berkeley) 3/9/91 + * @(#)string.h 5.10 (Berkeley) 3/9/91 */ #ifndef _STRING_H_ diff --git a/sgx/RSA-sgx-test/common/inc/sys/_types.h b/sgx/RSA-sgx-test/common/inc/sys/_types.h index fc9f153f..5dc6d5bb 100644 --- a/sgx/RSA-sgx-test/common/inc/sys/_types.h +++ b/sgx/RSA-sgx-test/common/inc/sys/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.2 2008/03/16 19:42:57 otto Exp $ */ +/* $OpenBSD: _types.h,v 1.2 2008/03/16 19:42:57 otto Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)types.h 8.3 (Berkeley) 1/5/94 + * @(#)types.h 8.3 (Berkeley) 1/5/94 */ #ifndef _SYS__TYPES_H_ @@ -83,9 +83,9 @@ typedef __uint64_t __uint_fast64_t; typedef long __off_t; #ifdef __x86_64__ -typedef long int __off64_t; +typedef long int __off64_t; #else -typedef long long int __off64_t; +typedef long long int __off64_t; #endif /* 7.18.1.4 Integer types capable of holding object pointers */ @@ -138,28 +138,30 @@ typedef __int64_t __intmax_t; typedef __uint64_t __uintmax_t; -typedef unsigned long int __ino_t; -typedef unsigned int __mode_t; -typedef unsigned int __uid_t; -typedef unsigned int __gid_t; -typedef long int __blksize_t; -typedef long int __blkcnt_t; +typedef unsigned long int __ino_t; +typedef unsigned int __mode_t; +typedef unsigned int __uid_t; +typedef unsigned int __gid_t; +typedef long int __blksize_t; +typedef long int __blkcnt_t; #ifdef __x86_64__ -typedef unsigned long int __dev_t; -typedef long int __off64_t; -typedef unsigned long int __nlink_t; -typedef long int __blkcnt64_t; -typedef unsigned long int __ino64_t; +typedef unsigned long int __dev_t; +typedef long int __off64_t; +typedef unsigned long int __nlink_t; +typedef long int __blkcnt64_t; +typedef unsigned long int __ino64_t; #else -typedef unsigned long long int __dev_t; -typedef long long int __off64_t; -typedef unsigned int __nlink_t; -typedef long long int __blkcnt64_t; -typedef unsigned long long int __ino64_t; +typedef unsigned long long int __dev_t; +typedef long long int __off64_t; +typedef unsigned int __nlink_t; +typedef long long int __blkcnt64_t; +typedef unsigned long long int __ino64_t; #endif typedef unsigned int __socklen_t; +typedef int __pid_t; +typedef long __cpu_mask; #endif /* !_SYS__TYPES_H_ */ diff --git a/sgx/RSA-sgx-test/common/inc/sys/cdefs.h b/sgx/RSA-sgx-test/common/inc/sys/cdefs.h index a6fdb585..71c3c1ce 100644 --- a/sgx/RSA-sgx-test/common/inc/sys/cdefs.h +++ b/sgx/RSA-sgx-test/common/inc/sys/cdefs.h @@ -1,5 +1,5 @@ -/* $OpenBSD: cdefs.h,v 1.34 2012/08/14 20:11:37 matthew Exp $ */ -/* $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ */ +/* $OpenBSD: cdefs.h,v 1.34 2012/08/14 20:11:37 matthew Exp $ */ +/* $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ */ /* * Copyright (c) 1991, 1993 @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)cdefs.h 8.7 (Berkeley) 1/21/94 + * @(#)cdefs.h 8.7 (Berkeley) 1/21/94 */ #ifndef _SYS_CDEFS_H_ @@ -122,11 +122,11 @@ * larger code. */ #if defined(__GNUC__) && __GNUC_PREREQ__(2, 96) -#define __predict_true(exp) __builtin_expect(((exp) != 0), 1) -#define __predict_false(exp) __builtin_expect(((exp) != 0), 0) +#define __predict_true(exp) __builtin_expect(((exp) != 0), 1) +#define __predict_false(exp) __builtin_expect(((exp) != 0), 0) #else -#define __predict_true(exp) ((exp) != 0) -#define __predict_false(exp) ((exp) != 0) +#define __predict_true(exp) ((exp) != 0) +#define __predict_false(exp) ((exp) != 0) #endif #endif /* !_SYS_CDEFS_H_ */ diff --git a/sgx/RSA-sgx-test/common/inc/sys/endian.h b/sgx/RSA-sgx-test/common/inc/sys/endian.h index 29edd81c..1cd7b810 100644 --- a/sgx/RSA-sgx-test/common/inc/sys/endian.h +++ b/sgx/RSA-sgx-test/common/inc/sys/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.18 2006/03/27 07:09:24 otto Exp $ */ +/* $OpenBSD: endian.h,v 1.18 2006/03/27 07:09:24 otto Exp $ */ /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. diff --git a/sgx/RSA-sgx-test/common/inc/sys/epoll.h b/sgx/RSA-sgx-test/common/inc/sys/epoll.h index f464db4a..c07830dc 100644 --- a/sgx/RSA-sgx-test/common/inc/sys/epoll.h +++ b/sgx/RSA-sgx-test/common/inc/sys/epoll.h @@ -15,23 +15,23 @@ License along with the GNU C Library; if not, see . */ -#ifndef _SYS_EPOLL_H -#define _SYS_EPOLL_H +#ifndef _SYS_EPOLL_H +#define _SYS_EPOLL_H #define __EPOLL_PACKED __attribute__ ((__packed__)) typedef union epoll_data { - void *ptr; - int fd; - uint32_t u32; - uint64_t u64; + void *ptr; + int fd; + uint32_t u32; + uint64_t u64; } epoll_data_t; struct epoll_event { - uint32_t events; /* Epoll events */ - epoll_data_t data; /* User data variable */ + uint32_t events; /* Epoll events */ + epoll_data_t data; /* User data variable */ } __EPOLL_PACKED; -#endif \ No newline at end of file +#endif diff --git a/sgx/RSA-sgx-test/common/inc/sys/ieee.h b/sgx/RSA-sgx-test/common/inc/sys/ieee.h index 8370cd82..eab3b975 100644 --- a/sgx/RSA-sgx-test/common/inc/sys/ieee.h +++ b/sgx/RSA-sgx-test/common/inc/sys/ieee.h @@ -1,5 +1,5 @@ -/* $OpenBSD: ieee.h,v 1.2 2008/09/07 20:36:06 martynas Exp $ */ -/* $NetBSD: ieee.h,v 1.1 1996/09/30 16:34:25 ws Exp $ */ +/* $OpenBSD: ieee.h,v 1.2 2008/09/07 20:36:06 martynas Exp $ */ +/* $NetBSD: ieee.h,v 1.1 1996/09/30 16:34:25 ws Exp $ */ /* * Copyright (c) 1992, 1993 @@ -38,7 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)ieee.h 8.1 (Berkeley) 6/11/93 + * @(#)ieee.h 8.1 (Berkeley) 6/11/93 */ /* @@ -50,27 +50,27 @@ /* * Define the number of bits in each fraction and exponent. * - * k k+1 + * k k+1 * Note that 1.0 x 2 == 0.1 x 2 and that denorms are represented * - * (-exp_bias+1) + * (-exp_bias+1) * as fractions that look like 0.fffff x 2 . This means that * - * -126 + * -126 * the number 0.10000 x 2 , for instance, is the same as the normalized * - * -127 -128 + * -127 -128 * float 1.0 x 2 . Thus, to represent 2 , we need one leading zero * - * -129 + * -129 * in the fraction; to represent 2 , we need two, and so on. This * - * (-exp_bias-fracbits+1) + * (-exp_bias-fracbits+1) * implies that the smallest denormalized number is 2 * * for whichever format we are talking about: for single precision, for * - * -126 -149 + * -126 -149 * instance, we get .00000000000000000000001 x 2 , or 1.0 x 2 , and * * -149 == -127 - 23 + 1. diff --git a/sgx/RSA-sgx-test/common/inc/sys/sockaddr.h b/sgx/RSA-sgx-test/common/inc/sys/sockaddr.h index 3a1a9586..94dc548a 100644 --- a/sgx/RSA-sgx-test/common/inc/sys/sockaddr.h +++ b/sgx/RSA-sgx-test/common/inc/sys/sockaddr.h @@ -25,12 +25,12 @@ typedef unsigned short int sa_family_t; of the data types used for socket addresses, `struct sockaddr', `struct sockaddr_in', `struct sockaddr_un', etc. */ -#define __SOCKADDR_COMMON(sa_prefix) \ - sa_family_t sa_prefix##family +#define __SOCKADDR_COMMON(sa_prefix) \ + sa_family_t sa_prefix##family -#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) +#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) /* Size of struct sockaddr_storage. */ #define _SS_SIZE 128 -#endif \ No newline at end of file +#endif diff --git a/sgx/RSA-sgx-test/common/inc/sys/socket.h b/sgx/RSA-sgx-test/common/inc/sys/socket.h index 2f0bd0e2..fe19269b 100644 --- a/sgx/RSA-sgx-test/common/inc/sys/socket.h +++ b/sgx/RSA-sgx-test/common/inc/sys/socket.h @@ -31,24 +31,24 @@ typedef __socklen_t socklen_t; /* Structure describing a generic socket address. */ struct sockaddr { - __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */ - char sa_data[14]; /* Address data. */ + __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */ + char sa_data[14]; /* Address data. */ }; struct msghdr { - void *msg_name; /* Address to send to/receive from. */ - socklen_t msg_namelen; /* Length of address data. */ + void *msg_name; /* Address to send to/receive from. */ + socklen_t msg_namelen; /* Length of address data. */ - struct iovec *msg_iov; /* Vector of data to send/receive into. */ - size_t msg_iovlen; /* Number of elements in the vector. */ + struct iovec *msg_iov; /* Vector of data to send/receive into. */ + size_t msg_iovlen; /* Number of elements in the vector. */ - void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ - size_t msg_controllen; /* Ancillary data buffer length. - !! The type should be socklen_t but the + void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ + size_t msg_controllen; /* Ancillary data buffer length. + !! The type should be socklen_t but the definition of the kernel is incompatible with this. */ - int msg_flags; /* Flags on received message. */ + int msg_flags; /* Flags on received message. */ }; -#endif \ No newline at end of file +#endif diff --git a/sgx/RSA-sgx-test/common/inc/sys/stat.h b/sgx/RSA-sgx-test/common/inc/sys/stat.h index 7ba561f4..eeae9b53 100644 --- a/sgx/RSA-sgx-test/common/inc/sys/stat.h +++ b/sgx/RSA-sgx-test/common/inc/sys/stat.h @@ -17,7 +17,7 @@ #ifndef _SYS_STAT_H -#define _SYS_STAT_H 1 +#define _SYS_STAT_H #include #include @@ -25,39 +25,39 @@ /* Versions of the `struct stat' data structure. */ #ifndef __x86_64__ -# define _STAT_VER_LINUX_OLD 1 -# define _STAT_VER_KERNEL 1 -# define _STAT_VER_SVR4 2 -# define _STAT_VER_LINUX 3 +# define _STAT_VER_LINUX_OLD 1 +# define _STAT_VER_KERNEL 1 +# define _STAT_VER_SVR4 2 +# define _STAT_VER_LINUX 3 /* i386 versions of the `xmknod' interface. */ -# define _MKNOD_VER_LINUX 1 -# define _MKNOD_VER_SVR4 2 -# define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ +# define _MKNOD_VER_LINUX 1 +# define _MKNOD_VER_SVR4 2 +# define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ #else -# define _STAT_VER_KERNEL 0 -# define _STAT_VER_LINUX 1 +# define _STAT_VER_KERNEL 0 +# define _STAT_VER_LINUX 1 /* x86-64 versions of the `xmknod' interface. */ -# define _MKNOD_VER_LINUX 0 +# define _MKNOD_VER_LINUX 0 #endif -#define _STAT_VER _STAT_VER_LINUX +#define _STAT_VER _STAT_VER_LINUX #ifndef _DEV_T_DEFINED_ #define _DEV_T_DEFINED_ -typedef __dev_t dev_t; +typedef __dev_t dev_t; #endif #ifndef _INO_T_DEFINED_ #define _INO_T_DEFINED_ -typedef __ino_t ino_t; +typedef __ino_t ino_t; typedef __ino64_t ino64_t; #endif #ifndef _MODE_T_DEFINED_ #define _MODE_T_DEFINED_ -typedef __mode_t mode_t; +typedef __mode_t mode_t; #endif #ifndef _NLINK_T_DEFINED_ @@ -67,71 +67,71 @@ typedef __nlink_t nlink_t; #ifndef _UID_T_DEFINED_ #define _UID_T_DEFINED_ -typedef __uid_t uid_t; +typedef __uid_t uid_t; #endif #ifndef _GID_T_DEFINED_ #define _GID_T_DEFINED_ -typedef __gid_t gid_t; +typedef __gid_t gid_t; #endif #ifndef _BLKSIZE_T_DEFINED_ #define _BLKSIZE_T_DEFINED_ -typedef __blksize_t blksize_t; +typedef __blksize_t blksize_t; #endif #ifndef _BLKCNT_T_DEFINED_ #define _BLKCNT_T_DEFINED_ -typedef __blkcnt_t blkcnt_t; -typedef __blkcnt64_t blkcnt64_t; +typedef __blkcnt_t blkcnt_t; +typedef __blkcnt64_t blkcnt64_t; #endif struct stat { - dev_t st_dev; /* Device. */ + dev_t st_dev; /* Device. */ #ifndef __x86_64__ unsigned short int __pad1; #endif #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 - ino_t st_ino; /* File serial number. */ + ino_t st_ino; /* File serial number. */ #else - ino_t __st_ino; /* 32bit file serial number. */ + ino_t __st_ino; /* 32bit file serial number. */ #endif #ifndef __x86_64__ - mode_t st_mode; /* File mode. */ - nlink_t st_nlink; /* Link count. */ + mode_t st_mode; /* File mode. */ + nlink_t st_nlink; /* Link count. */ #else - nlink_t st_nlink; /* Link count. */ - mode_t st_mode; /* File mode. */ + nlink_t st_nlink; /* Link count. */ + mode_t st_mode; /* File mode. */ #endif - uid_t st_uid; /* User ID of the file's owner. */ - gid_t st_gid; /* Group ID of the file's group.*/ + uid_t st_uid; /* User ID of the file's owner. */ + gid_t st_gid; /* Group ID of the file's group.*/ #ifdef __x86_64__ int __pad0; #endif - dev_t st_rdev; /* Device number, if device. */ + dev_t st_rdev; /* Device number, if device. */ #ifndef __x86_64__ unsigned short int __pad2; #endif #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 - off_t st_size; /* Size of file, in bytes. */ + off_t st_size; /* Size of file, in bytes. */ #else - off64_t st_size; /* Size of file, in bytes. */ + off64_t st_size; /* Size of file, in bytes. */ #endif - blksize_t st_blksize; /* Optimal block size for I/O. */ + blksize_t st_blksize; /* Optimal block size for I/O. */ #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 - blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ + blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ #else - blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ + blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif - time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ + time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ #ifdef __x86_64__ long int __glibc_reserved[3]; #else @@ -139,37 +139,37 @@ struct stat unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; # else - ino64_t st_ino; /* File serial number. */ + ino64_t st_ino; /* File serial number. */ # endif #endif }; struct stat64 { - dev_t st_dev; /* Device. */ + dev_t st_dev; /* Device. */ # ifdef __x86_64__ - ino64_t st_ino; /* File serial number. */ - nlink_t st_nlink; /* Link count. */ - mode_t st_mode; /* File mode. */ + ino64_t st_ino; /* File serial number. */ + nlink_t st_nlink; /* Link count. */ + mode_t st_mode; /* File mode. */ # else unsigned int __pad1; - ino_t __st_ino; /* 32bit file serial number. */ - mode_t st_mode; /* File mode. */ - nlink_t st_nlink; /* Link count. */ + ino_t __st_ino; /* 32bit file serial number. */ + mode_t st_mode; /* File mode. */ + nlink_t st_nlink; /* Link count. */ # endif - uid_t st_uid; /* User ID of the file's owner. */ - gid_t st_gid; /* Group ID of the file's group.*/ + uid_t st_uid; /* User ID of the file's owner. */ + gid_t st_gid; /* Group ID of the file's group.*/ # ifdef __x86_64__ int __pad0; - dev_t st_rdev; /* Device number, if device. */ - off_t st_size; /* Size of file, in bytes. */ + dev_t st_rdev; /* Device number, if device. */ + off_t st_size; /* Size of file, in bytes. */ # else - dev_t st_rdev; /* Device number, if device. */ + dev_t st_rdev; /* Device number, if device. */ unsigned int __pad2; - off64_t st_size; /* Size of file, in bytes. */ + off64_t st_size; /* Size of file, in bytes. */ # endif - blksize_t st_blksize; /* Optimal block size for I/O. */ - blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ + blksize_t st_blksize; /* Optimal block size for I/O. */ + blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ # ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used @@ -177,70 +177,70 @@ struct stat64 identifier 'timespec' to appear in the header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ # else - time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - time_t st_ctime; /* Time of last status change. */ + time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ # endif # ifdef __x86_64__ long int __glibc_reserved[3]; # else - ino64_t st_ino; /* File serial number. */ + ino64_t st_ino; /* File serial number. */ # endif }; /* Tell code we have these members. */ -#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_BLKSIZE #define _STATBUF_ST_RDEV /* Nanosecond resolution time values are supported. */ #define _STATBUF_ST_NSEC /* Encoding of the file mode. */ -#define S_IFMT 0170000 /* These bits determine file type. */ +#define S_IFMT 0170000 /* These bits determine file type. */ /* File types. */ -#define S_IFDIR 0040000 /* Directory. */ -#define S_IFCHR 0020000 /* Character device. */ -#define S_IFBLK 0060000 /* Block device. */ -#define S_IFREG 0100000 /* Regular file. */ -#define S_IFIFO 0010000 /* FIFO. */ -#define S_IFLNK 0120000 /* Symbolic link. */ -#define S_IFSOCK 0140000 /* Socket. */ +#define S_IFDIR 0040000 /* Directory. */ +#define S_IFCHR 0020000 /* Character device. */ +#define S_IFBLK 0060000 /* Block device. */ +#define S_IFREG 0100000 /* Regular file. */ +#define S_IFIFO 0010000 /* FIFO. */ +#define S_IFLNK 0120000 /* Symbolic link. */ +#define S_IFSOCK 0140000 /* Socket. */ /* POSIX.1b objects. Note that these macros always evaluate to zero. But they do it by enforcing the correct use of the macros. */ -#define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) -#define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) -#define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) +#define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) +#define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) +#define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) /* Protection bits. */ -#define S_ISUID 04000 /* Set user ID on execution. */ -#define S_ISGID 02000 /* Set group ID on execution. */ -#define S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define S_IREAD 0400 /* Read by owner. */ -#define S_IWRITE 0200 /* Write by owner. */ -#define S_IEXEC 0100 /* Execute by owner. */ +#define S_ISUID 04000 /* Set user ID on execution. */ +#define S_ISGID 02000 /* Set group ID on execution. */ +#define S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define S_IREAD 0400 /* Read by owner. */ +#define S_IWRITE 0200 /* Write by owner. */ +#define S_IEXEC 0100 /* Execute by owner. */ #ifdef __USE_ATFILE -# define UTIME_NOW ((1l << 30) - 1l) -# define UTIME_OMIT ((1l << 30) - 2l) +# define UTIME_NOW ((1l << 30) - 1l) +# define UTIME_OMIT ((1l << 30) - 2l) #endif -#define S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask)) +#define S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask)) -#define S_ISDIR(mode) S_ISTYPE((mode), S_IFDIR) -#define S_ISCHR(mode) S_ISTYPE((mode), S_IFCHR) -#define S_ISBLK(mode) S_ISTYPE((mode), S_IFBLK) -#define S_ISREG(mode) S_ISTYPE((mode), S_IFREG) -#define S_ISFIFO(mode) S_ISTYPE((mode), S_IFIFO) -#define S_ISLNK(mode) S_ISTYPE((mode), S_IFLNK) +#define S_ISDIR(mode) S_ISTYPE((mode), S_IFDIR) +#define S_ISCHR(mode) S_ISTYPE((mode), S_IFCHR) +#define S_ISBLK(mode) S_ISTYPE((mode), S_IFBLK) +#define S_ISREG(mode) S_ISTYPE((mode), S_IFREG) +#define S_ISFIFO(mode) S_ISTYPE((mode), S_IFIFO) +#define S_ISLNK(mode) S_ISTYPE((mode), S_IFLNK) -#endif /* bits/stat.h */ +#endif /* bits/stat.h */ diff --git a/sgx/RSA-sgx-test/common/inc/sys/stdint.h b/sgx/RSA-sgx-test/common/inc/sys/stdint.h index 97407cea..51599456 100644 --- a/sgx/RSA-sgx-test/common/inc/sys/stdint.h +++ b/sgx/RSA-sgx-test/common/inc/sys/stdint.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdint.h,v 1.4 2006/12/10 22:17:55 deraadt Exp $ */ +/* $OpenBSD: stdint.h,v 1.4 2006/12/10 22:17:55 deraadt Exp $ */ /* * Copyright (c) 1997, 2005 Todd C. Miller diff --git a/sgx/RSA-sgx-test/common/inc/sys/struct_timespec.h b/sgx/RSA-sgx-test/common/inc/sys/struct_timespec.h index f2ac6d7a..3e3f3562 100644 --- a/sgx/RSA-sgx-test/common/inc/sys/struct_timespec.h +++ b/sgx/RSA-sgx-test/common/inc/sys/struct_timespec.h @@ -24,8 +24,8 @@ has nanoseconds instead of microseconds. */ struct timespec { - __time_t tv_sec; /* Seconds. */ - long tv_nsec; /* Nanoseconds. */ + __time_t tv_sec; /* Seconds. */ + long tv_nsec; /* Nanoseconds. */ }; #endif diff --git a/sgx/RSA-sgx-test/common/inc/sys/types.h b/sgx/RSA-sgx-test/common/inc/sys/types.h index cc4e7532..b64f89df 100644 --- a/sgx/RSA-sgx-test/common/inc/sys/types.h +++ b/sgx/RSA-sgx-test/common/inc/sys/types.h @@ -1,5 +1,5 @@ -/* $OpenBSD: types.h,v 1.31 2008/03/16 19:42:57 otto Exp $ */ -/* $NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $ */ +/* $OpenBSD: types.h,v 1.31 2008/03/16 19:42:57 otto Exp $ */ +/* $NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $ */ /*- * Copyright (c) 1982, 1986, 1991, 1993 @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)types.h 8.4 (Berkeley) 1/21/94 + * @(#)types.h 8.4 (Berkeley) 1/21/94 */ #ifndef _SYS_TYPES_H_ diff --git a/sgx/RSA-sgx-test/common/inc/sys/uio.h b/sgx/RSA-sgx-test/common/inc/sys/uio.h index e3f33d1c..00cd177d 100644 --- a/sgx/RSA-sgx-test/common/inc/sys/uio.h +++ b/sgx/RSA-sgx-test/common/inc/sys/uio.h @@ -21,8 +21,8 @@ /* Structure for scatter/gather I/O. */ struct iovec { - void *iov_base; /* Pointer to data. */ - size_t iov_len; /* Length of data. */ + void *iov_base; /* Pointer to data. */ + size_t iov_len; /* Length of data. */ }; -#endif \ No newline at end of file +#endif diff --git a/sgx/RSA-sgx-test/common/inc/time.h b/sgx/RSA-sgx-test/common/inc/time.h index 29852c56..01cfd6e4 100644 --- a/sgx/RSA-sgx-test/common/inc/time.h +++ b/sgx/RSA-sgx-test/common/inc/time.h @@ -1,5 +1,5 @@ -/* $OpenBSD: time.h,v 1.18 2006/01/06 18:53:04 millert Exp $ */ -/* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */ +/* $OpenBSD: time.h,v 1.18 2006/01/06 18:53:04 millert Exp $ */ +/* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)time.h 5.12 (Berkeley) 3/9/91 + * @(#)time.h 5.12 (Berkeley) 3/9/91 */ #ifndef _TIME_H_ diff --git a/sgx/RSA-sgx-test/common/inc/unistd.h b/sgx/RSA-sgx-test/common/inc/unistd.h index 4da748a6..2ab3a9a0 100644 --- a/sgx/RSA-sgx-test/common/inc/unistd.h +++ b/sgx/RSA-sgx-test/common/inc/unistd.h @@ -1,5 +1,5 @@ -/* $OpenBSD: unistd.h,v 1.62 2008/06/25 14:58:54 millert Exp $ */ -/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */ +/* $OpenBSD: unistd.h,v 1.62 2008/06/25 14:58:54 millert Exp $ */ +/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)unistd.h 5.13 (Berkeley) 6/17/91 + * @(#)unistd.h 5.13 (Berkeley) 6/17/91 */ #ifndef _UNISTD_H_ diff --git a/sgx/RSA-sgx-test/common/inc/wchar.h b/sgx/RSA-sgx-test/common/inc/wchar.h index 4ca0b39f..5982aef4 100644 --- a/sgx/RSA-sgx-test/common/inc/wchar.h +++ b/sgx/RSA-sgx-test/common/inc/wchar.h @@ -1,5 +1,5 @@ -/* $OpenBSD: wchar.h,v 1.11 2010/07/24 09:58:39 guenther Exp $ */ -/* $NetBSD: wchar.h,v 1.16 2003/03/07 07:11:35 tshiozak Exp $ */ +/* $OpenBSD: wchar.h,v 1.11 2010/07/24 09:58:39 guenther Exp $ */ +/* $NetBSD: wchar.h,v 1.16 2003/03/07 07:11:35 tshiozak Exp $ */ /*- * Copyright (c)1999 Citrus Project, diff --git a/sgx/RSA-sgx-test/common/inc/wctype.h b/sgx/RSA-sgx-test/common/inc/wctype.h index 25466f15..fb421afd 100644 --- a/sgx/RSA-sgx-test/common/inc/wctype.h +++ b/sgx/RSA-sgx-test/common/inc/wctype.h @@ -1,5 +1,5 @@ -/* $OpenBSD: wctype.h,v 1.5 2006/01/06 18:53:04 millert Exp $ */ -/* $NetBSD: wctype.h,v 1.5 2003/03/02 22:18:11 tshiozak Exp $ */ +/* $OpenBSD: wctype.h,v 1.5 2006/01/06 18:53:04 millert Exp $ */ +/* $NetBSD: wctype.h,v 1.5 2003/03/02 22:18:11 tshiozak Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * citrus Id: wctype.h,v 1.4 2000/12/21 01:50:21 itojun Exp + * citrus Id: wctype.h,v 1.4 2000/12/21 01:50:21 itojun Exp */ #ifndef _WCTYPE_H_ diff --git a/sgx/RSA-sgx-test/edl/inc/dirent.h b/sgx/RSA-sgx-test/edl/inc/dirent.h index ba3c2c3a..be63f833 100644 --- a/sgx/RSA-sgx-test/edl/inc/dirent.h +++ b/sgx/RSA-sgx-test/edl/inc/dirent.h @@ -1,30 +1,19 @@ -// Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: +// http://www.apache.org/licenses/LICENSE-2.0 // -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in -// the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Baidu, Inc., nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License.. #ifndef _EDL_DIRENT_H #define _EDL_DIRENT_H @@ -47,4 +36,4 @@ struct dirent64_t char d_name[256]; }; -#endif \ No newline at end of file +#endif diff --git a/sgx/RSA-sgx-test/edl/inc/stat.h b/sgx/RSA-sgx-test/edl/inc/stat.h index ac437618..7f04c3ce 100644 --- a/sgx/RSA-sgx-test/edl/inc/stat.h +++ b/sgx/RSA-sgx-test/edl/inc/stat.h @@ -1,30 +1,19 @@ -// Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: +// http://www.apache.org/licenses/LICENSE-2.0 // -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in -// the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Baidu, Inc., nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License.. #ifndef _EDL_STAT_H #define _EDL_STAT_H @@ -51,7 +40,7 @@ struct stat_t int64_t __reserved[3]; }; -struct stat64_t +struct stat64_t { uint64_t st_dev; uint64_t st_ino; @@ -73,4 +62,4 @@ struct stat64_t int64_t __reserved[3]; }; -#endif \ No newline at end of file +#endif diff --git a/sgx/RSA-sgx-test/edl/intel/sgx_pthread.edl b/sgx/RSA-sgx-test/edl/intel/sgx_pthread.edl new file mode 100644 index 00000000..7a097a73 --- /dev/null +++ b/sgx/RSA-sgx-test/edl/intel/sgx_pthread.edl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2011-2019 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +enclave { + untrusted { + [cdecl] int pthread_wait_timeout_ocall (unsigned long long waiter, unsigned long long timeout); + [cdecl] int pthread_create_ocall(unsigned long long self); + [cdecl] int pthread_wakeup_ocall(unsigned long long waiter); + }; +}; diff --git a/sgx/RSA-sgx-test/edl/intel/sgx_tkey_exchange.edl b/sgx/RSA-sgx-test/edl/intel/sgx_tkey_exchange.edl new file mode 100644 index 00000000..3e18c895 --- /dev/null +++ b/sgx/RSA-sgx-test/edl/intel/sgx_tkey_exchange.edl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2011-2019 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +enclave { + trusted { + public sgx_status_t sgx_ra_get_ga(sgx_ra_context_t context, + [out] sgx_ec256_public_t *g_a); + + public sgx_status_t sgx_ra_proc_msg2_trusted(sgx_ra_context_t context, + [in]const sgx_ra_msg2_t *p_msg2, /*copy msg2 except quote into enclave */ + [in] const sgx_target_info_t *p_qe_target, + [out] sgx_report_t *p_report, + [out] sgx_quote_nonce_t *p_nonce); + + public sgx_status_t sgx_ra_get_msg3_trusted(sgx_ra_context_t context, + uint32_t quote_size, + [in]sgx_report_t* qe_report, + [user_check]sgx_ra_msg3_t *p_msg3, + uint32_t msg3_size); + }; +}; diff --git a/sgx/RSA-sgx-test/edl/intel/sgx_tprotected_fs.edl b/sgx/RSA-sgx-test/edl/intel/sgx_tprotected_fs.edl new file mode 100644 index 00000000..2dfad370 --- /dev/null +++ b/sgx/RSA-sgx-test/edl/intel/sgx_tprotected_fs.edl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2011-2019 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +enclave { + from "sgx_tstdc.edl" import *; + untrusted { + void* u_sgxprotectedfs_exclusive_file_open([in, string] const char* filename, uint8_t read_only, [out] int64_t* file_size, [out] int32_t* error_code); + uint8_t u_sgxprotectedfs_check_if_file_exists([in, string] const char* filename); + int32_t u_sgxprotectedfs_fread_node([user_check] void* f, uint64_t node_number, [out, size=node_size] uint8_t* buffer, uint32_t node_size); + int32_t u_sgxprotectedfs_fwrite_node([user_check] void* f, uint64_t node_number, [in, size=node_size] uint8_t* buffer, uint32_t node_size); + int32_t u_sgxprotectedfs_fclose([user_check] void* f); + uint8_t u_sgxprotectedfs_fflush([user_check] void* f); + int32_t u_sgxprotectedfs_remove([in, string] const char* filename); + + void* u_sgxprotectedfs_recovery_file_open([in, string] const char* filename); + uint8_t u_sgxprotectedfs_fwrite_recovery_node([user_check] void* f, [in, count=data_length] uint8_t* data, uint32_t data_length); + int32_t u_sgxprotectedfs_do_file_recovery([in, string] const char* filename, [in, string] const char* recovery_filename, uint32_t node_size); + }; +}; diff --git a/sgx/RSA-sgx-test/edl/intel/sgx_tstdc.edl b/sgx/RSA-sgx-test/edl/intel/sgx_tstdc.edl new file mode 100644 index 00000000..4124debc --- /dev/null +++ b/sgx/RSA-sgx-test/edl/intel/sgx_tstdc.edl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2011-2019 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +enclave { + untrusted { + [cdecl] void sgx_oc_cpuidex([out] int cpuinfo[4], int leaf, int subleaf); + + /* Go outside and wait on my untrusted event */ + [cdecl] int sgx_thread_wait_untrusted_event_ocall([user_check] const void *self); + + /* Wake a thread waiting on its untrusted event */ + [cdecl] int sgx_thread_set_untrusted_event_ocall([user_check] const void *waiter); + + /* Wake a thread waiting on its untrusted event, and wait on my untrusted event */ + [cdecl] int sgx_thread_setwait_untrusted_events_ocall([user_check] const void *waiter, [user_check] const void *self); + + /* Wake multiple threads waiting on their untrusted events */ + [cdecl] int sgx_thread_set_multiple_untrusted_events_ocall([in, count = total] const void **waiters, size_t total); + }; +}; diff --git a/sgx/RSA-sgx-test/edl/intel/sgx_tswitchless.edl b/sgx/RSA-sgx-test/edl/intel/sgx_tswitchless.edl new file mode 100644 index 00000000..a20669ab --- /dev/null +++ b/sgx/RSA-sgx-test/edl/intel/sgx_tswitchless.edl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2011-2019 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +enclave { + + trusted { + public sgx_status_t sl_init_switchless([user_check]void* sl_data); + public sgx_status_t sl_run_switchless_tworker(); + }; + +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_asyncio.edl b/sgx/RSA-sgx-test/edl/sgx_asyncio.edl index f0a483ee..f4637389 100644 --- a/sgx/RSA-sgx-test/edl/sgx_asyncio.edl +++ b/sgx/RSA-sgx-test/edl/sgx_asyncio.edl @@ -1,33 +1,19 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. enclave { @@ -42,6 +28,6 @@ enclave { int u_poll_ocall([out] int *error, [in, out, count=nfds] struct pollfd *fds, nfds_t nfds, int timeout); int u_epoll_create1_ocall([out] int *error, int flags); int u_epoll_ctl_ocall([out] int *error, int epfd, int op, int fd, [in] struct epoll_event *event); - int u_epoll_wait_ocall([out] int *error, int epfd, [out, count=maxevents] struct epoll_event * events, int maxevents, int timeout); + int u_epoll_wait_ocall([out] int *error, int epfd, [out, count=maxevents] struct epoll_event *events, int maxevents, int timeout); }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_backtrace.edl b/sgx/RSA-sgx-test/edl/sgx_backtrace.edl index 7f333d6f..4a9e7ef8 100644 --- a/sgx/RSA-sgx-test/edl/sgx_backtrace.edl +++ b/sgx/RSA-sgx-test/edl/sgx_backtrace.edl @@ -1,34 +1,20 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + enclave { from "sgx_fd.edl" import *; @@ -42,4 +28,4 @@ enclave { untrusted { /* define OCALLs here. */ }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_env.edl b/sgx/RSA-sgx-test/edl/sgx_env.edl index 6093cf25..d4a77cc8 100644 --- a/sgx/RSA-sgx-test/edl/sgx_env.edl +++ b/sgx/RSA-sgx-test/edl/sgx_env.edl @@ -1,44 +1,40 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + enclave { + include "pwd.h" + trusted { /* define ECALLs here. */ }; untrusted { - char ** u_environ_ocall(); - char * u_getenv_ocall([in, string] const char *name); + char **u_environ_ocall(); + char *u_getenv_ocall([in, string] const char *name); int u_setenv_ocall([out] int *error, [in, string] const char *name, [in, string] const char *value, int overwrite); int u_unsetenv_ocall([out] int *error, [in, string] const char *name); + int u_chdir_ocall([out] int *error, [in, string] const char *dir); + char *u_getcwd_ocall([out] int *error, [out, size=buflen] char *buf, size_t buflen); + int u_getpwuid_r_ocall(unsigned int uid, + [out] struct passwd *pwd, + [out, size=buflen] char *buf, + size_t buflen, + [out] struct passwd **passwd_result); + unsigned int u_getuid_ocall(); }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_fd.edl b/sgx/RSA-sgx-test/edl/sgx_fd.edl index fefe0b15..8cfc822e 100644 --- a/sgx/RSA-sgx-test/edl/sgx_fd.edl +++ b/sgx/RSA-sgx-test/edl/sgx_fd.edl @@ -1,33 +1,19 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. enclave { @@ -41,13 +27,13 @@ enclave { }; untrusted { - size_t u_read_ocall([out] int *error, int fd, [out, size=count] void *buf, size_t count); - size_t u_pread64_ocall([out] int *error, int fd, [out, size=count] void *buf, size_t count, int64_t offset); + size_t u_read_ocall([out] int *error, int fd, [user_check] void *buf, size_t count); + size_t u_pread64_ocall([out] int *error, int fd, [user_check] void *buf, size_t count, int64_t offset); size_t u_readv_ocall([out] int *error, int fd, [in, count=iovcnt] const struct iovec *iov, int iovcnt); size_t u_preadv64_ocall([out] int *error, int fd, [in, count=iovcnt] const struct iovec *iov, int iovcnt, int64_t offset); - size_t u_write_ocall([out] int *error, int fd, [in, size=count] const void *buf, size_t count); - size_t u_pwrite64_ocall([out] int *error, int fd, [in, size=count] const void *buf, size_t count, int64_t offset); + size_t u_write_ocall([out] int *error, int fd, [user_check] const void *buf, size_t count); + size_t u_pwrite64_ocall([out] int *error, int fd, [user_check] const void *buf, size_t count, int64_t offset); size_t u_writev_ocall([out] int *error, int fd, [in, count=iovcnt] const struct iovec *iov, int iovcnt); size_t u_pwritev64_ocall([out] int *error, int fd, [in, count=iovcnt] const struct iovec *iov, int iovcnt, int64_t offset); @@ -56,6 +42,6 @@ enclave { int u_ioctl_arg0_ocall([out] int *error, int fd, int request); int u_ioctl_arg1_ocall([out] int *error, int fd, int request, [in, out] int *arg); - int u_close_ocall([out] int *error, int fd); + int u_close_ocall([out] int *error, int fd); }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_file.edl b/sgx/RSA-sgx-test/edl/sgx_file.edl index 54c48be7..1e280366 100644 --- a/sgx/RSA-sgx-test/edl/sgx_file.edl +++ b/sgx/RSA-sgx-test/edl/sgx_file.edl @@ -1,33 +1,19 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. enclave { @@ -64,13 +50,13 @@ enclave { int u_chmod_ocall([out] int *error, [in, string] const char *path, uint32_t mode); size_t u_readlink_ocall([out] int *error, [in, string] const char *path, [out, size=bufsz] char *buf, size_t bufsz); int u_symlink_ocall([out] int *error, [in, string] const char *path1, [in, string] const char *path2); - char * u_realpath_ocall([out] int *error, [in, string] const char *pathname); + char *u_realpath_ocall([out] int *error, [in, string] const char *pathname); int u_mkdir_ocall([out] int *error, [in, string] const char *pathname, uint32_t mode); int u_rmdir_ocall([out] int *error, [in, string] const char *pathname); - void * u_opendir_ocall([out] int *error, [in, string] const char *pathname); - int u_readdir64_r_ocall([out] int *error, [user_check] void *dirp, [in, out] struct dirent64_t *entry, [out] struct dirent64_t **result); + void *u_opendir_ocall([out] int *error, [in, string] const char *pathname); + int u_readdir64_r_ocall([user_check] void *dirp, [in, out] struct dirent64_t *entry, [out] struct dirent64_t **result); int u_closedir_ocall([out] int *error, [user_check] void *dirp); int u_dirfd_ocall([out] int *error, [user_check] void *dirp); int u_fstatat64_ocall([out] int *error, int dirfd, [in, string] const char *pathname, [out] struct stat64_t *buf, int flags); }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_fs.edl b/sgx/RSA-sgx-test/edl/sgx_fs.edl index 0e52961c..2618be93 100644 --- a/sgx/RSA-sgx-test/edl/sgx_fs.edl +++ b/sgx/RSA-sgx-test/edl/sgx_fs.edl @@ -1,33 +1,19 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. enclave { @@ -42,4 +28,4 @@ enclave { untrusted { /* define OCALLs here. */ }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_mem.edl b/sgx/RSA-sgx-test/edl/sgx_mem.edl index a46f0fac..db558027 100644 --- a/sgx/RSA-sgx-test/edl/sgx_mem.edl +++ b/sgx/RSA-sgx-test/edl/sgx_mem.edl @@ -1,34 +1,20 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + enclave { trusted { @@ -36,13 +22,19 @@ enclave { }; untrusted { - void * u_malloc_ocall([out] int *error, size_t size); + void *u_malloc_ocall([out] int *error, size_t size); void u_free_ocall([user_check] void *p); - void * u_mmap_ocall([out] int *error, [user_check] void *start, size_t length, int prot, int flags, int fd, int64_t offset); + void *u_mmap_ocall([out] int *error, + [user_check] void *start, + size_t length, + int prot, + int flags, + int fd, + int64_t offset); int u_munmap_ocall([out] int *error, [user_check] void *start, size_t length); int u_msync_ocall([out] int *error, [user_check] void *addr, size_t length, int flags); int u_mprotect_ocall([out] int *error, [user_check] void *addr, size_t length, int prot); }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_net.edl b/sgx/RSA-sgx-test/edl/sgx_net.edl index 6d6c33e7..a803b53a 100644 --- a/sgx/RSA-sgx-test/edl/sgx_net.edl +++ b/sgx/RSA-sgx-test/edl/sgx_net.edl @@ -1,36 +1,25 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. enclave { + include "sys/socket.h" + include "netdb.h" + from "sgx_socket.edl" import *; from "sgx_asyncio.edl" import *; from "sgx_fd.edl" import *; @@ -41,6 +30,12 @@ enclave { }; untrusted { - /* define OCALLs here. */ + int u_getaddrinfo_ocall([out] int *error, + [in, string] const char *node, + [in, string] const char *service, + [in] const struct addrinfo *hints, + [out] struct addrinfo **res); + void u_freeaddrinfo_ocall([user_check] struct addrinfo *res); + char *u_gai_strerror_ocall(int errcode); }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_net_switchless.edl b/sgx/RSA-sgx-test/edl/sgx_net_switchless.edl index a149b40e..ec5c500c 100644 --- a/sgx/RSA-sgx-test/edl/sgx_net_switchless.edl +++ b/sgx/RSA-sgx-test/edl/sgx_net_switchless.edl @@ -1,33 +1,19 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. enclave { @@ -36,7 +22,7 @@ enclave { from "sgx_fs.edl" import *; from "sgx_time.edl" import *; from "sgx_mem.edl" import *; - + trusted { /* define ECALLs here. */ }; @@ -66,7 +52,7 @@ enclave { [out, size=addrlen_in] struct sockaddr *src_addr, socklen_t addrlen_in, [out] socklen_t *addrlen_out) transition_using_threads; - size_t u_net_recvmsg_ocall([out] int *error, int sockfd, [in, out] struct msghdr * msg, int flags) transition_using_threads; + size_t u_net_recvmsg_ocall([out] int *error, int sockfd, [in, out] struct msghdr *msg, int flags) transition_using_threads; size_t u_net_send_ocall([out] int *error, int sockfd, [in, size=len] const void *buf, size_t len, int flags) transition_using_threads; size_t u_net_sendto_ocall([out] int *error, int sockfd, @@ -75,7 +61,7 @@ enclave { int flags, [in, size=addrlen] const struct sockaddr *dest_addr, socklen_t addrlen) transition_using_threads; - size_t u_sendmsg_ocall([out] int *error, int sockfd, [in] const struct msghdr * msg, int flags) transition_using_threads; + size_t u_sendmsg_ocall([out] int *error, int sockfd, [in] const struct msghdr *msg, int flags) transition_using_threads; int u_net_getsockopt_ocall([out] int *error, int sockfd, int level, diff --git a/sgx/RSA-sgx-test/edl/sgx_pipe.edl b/sgx/RSA-sgx-test/edl/sgx_pipe.edl index fcca6c16..00c12f5e 100644 --- a/sgx/RSA-sgx-test/edl/sgx_pipe.edl +++ b/sgx/RSA-sgx-test/edl/sgx_pipe.edl @@ -1,33 +1,19 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. enclave { @@ -40,6 +26,6 @@ enclave { untrusted { int u_pipe_ocall([out] int *error, [out, count=2] int *pipefd); - int u_pipe2_ocall([out] int *error, [out, count=2] int *pipefd, int flags); + int u_pipe2_ocall([out] int *error, [out, count=2] int *pipefd, int flags); }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_socket.edl b/sgx/RSA-sgx-test/edl/sgx_socket.edl index 2e6ab0ba..68ce3b6e 100644 --- a/sgx/RSA-sgx-test/edl/sgx_socket.edl +++ b/sgx/RSA-sgx-test/edl/sgx_socket.edl @@ -1,33 +1,19 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. enclave { @@ -59,25 +45,25 @@ enclave { int sockfd, [in, size=addrlen] const struct sockaddr *addr, socklen_t addrlen); - size_t u_recv_ocall([out] int *error, int sockfd, [out, size=len] void *buf, size_t len, int flags); + size_t u_recv_ocall([out] int *error, int sockfd,[user_check] void *buf, size_t len, int flags); size_t u_recvfrom_ocall([out] int *error, int sockfd, - [out, size=len] void *buf, + [user_check] void *buf, size_t len, int flags, [out, size=addrlen_in] struct sockaddr *src_addr, socklen_t addrlen_in, [out] socklen_t *addrlen_out); - size_t u_recvmsg_ocall([out] int *error, int sockfd, [in, out] struct msghdr * msg, int flags); - size_t u_send_ocall([out] int *error, int sockfd, [in, size=len] const void *buf, size_t len, int flags); + size_t u_recvmsg_ocall([out] int *error, int sockfd, [in, out] struct msghdr *msg, int flags); + size_t u_send_ocall([out] int *error, int sockfd, [user_check] const void *buf, size_t len, int flags); size_t u_sendto_ocall([out] int *error, int sockfd, - [in, size=len] const void *buf, + [user_check] const void *buf, size_t len, int flags, [in, size=addrlen] const struct sockaddr *dest_addr, socklen_t addrlen); - size_t u_sendmsg_ocall([out] int *error, int sockfd, [in] const struct msghdr * msg, int flags); + size_t u_sendmsg_ocall([out] int *error, int sockfd, [in] const struct msghdr *msg, int flags); int u_getsockopt_ocall([out] int *error, int sockfd, int level, @@ -103,4 +89,4 @@ enclave { [out] socklen_t *addrlen_out); int u_shutdown_ocall([out] int *error, int sockfd, int how); }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_stdio.edl b/sgx/RSA-sgx-test/edl/sgx_stdio.edl index 84a70f04..5367d9ab 100644 --- a/sgx/RSA-sgx-test/edl/sgx_stdio.edl +++ b/sgx/RSA-sgx-test/edl/sgx_stdio.edl @@ -1,38 +1,24 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + enclave { from "sgx_fd.edl" import *; - + trusted { /* define ECALLs here. */ }; @@ -40,4 +26,4 @@ enclave { untrusted { /* define OCALLs here. */ }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_sys.edl b/sgx/RSA-sgx-test/edl/sgx_sys.edl index 54a9aade..e9405818 100644 --- a/sgx/RSA-sgx-test/edl/sgx_sys.edl +++ b/sgx/RSA-sgx-test/edl/sgx_sys.edl @@ -1,41 +1,32 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + enclave { + include "sched.h" + trusted { /* define ECALLs here. */ }; untrusted { long u_sysconf_ocall([out] int *error, int name); + int u_prctl_ocall([out] int *error, int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5); + int u_sched_setaffinity_ocall([out] int *error, pid_t pid, size_t cpusetsize, [in]cpu_set_t *mask); + int u_sched_getaffinity_ocall([out] int *error, pid_t pid, size_t cpusetsize, [out]cpu_set_t *mask); }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_thread.edl b/sgx/RSA-sgx-test/edl/sgx_thread.edl new file mode 100644 index 00000000..4dd0e5c5 --- /dev/null +++ b/sgx/RSA-sgx-test/edl/sgx_thread.edl @@ -0,0 +1,31 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +enclave { + + include "time.h" + + from "intel/sgx_pthread.edl" import *; + + trusted { + /* define ECALLs here. */ + }; + + untrusted { + int u_sched_yield_ocall([out]int *error); + int u_nanosleep_ocall([out]int *error, [in]const struct timespec *req, [out]struct timespec *rem); + }; +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_time.edl b/sgx/RSA-sgx-test/edl/sgx_time.edl index 8f3c1910..adeeeccf 100644 --- a/sgx/RSA-sgx-test/edl/sgx_time.edl +++ b/sgx/RSA-sgx-test/edl/sgx_time.edl @@ -1,34 +1,20 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + enclave { include "time.h" @@ -40,4 +26,4 @@ enclave { untrusted { int u_clock_gettime_ocall([out] int *error, int clk_id, [out] struct timespec *tp); }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/edl/sgx_tstd.edl b/sgx/RSA-sgx-test/edl/sgx_tstd.edl index 70e83b9b..9b74272f 100644 --- a/sgx/RSA-sgx-test/edl/sgx_tstd.edl +++ b/sgx/RSA-sgx-test/edl/sgx_tstd.edl @@ -1,34 +1,20 @@ -/* - * Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Baidu, Inc., nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + enclave { from "sgx_time.edl" import *; @@ -42,8 +28,11 @@ enclave { untrusted { /* define OCALLs here. */ int u_thread_set_event_ocall([out] int *error, [user_check] const void *tcs); - int u_thread_wait_event_ocall([out] int *error, [user_check] const void *tcs, int timeout); - int u_thread_set_multiple_events_ocall([out]int *error, [in, count=total]const void ** tcss, int total); - int u_thread_setwait_events_ocall([out]int *error, [user_check]const void * waiter_tcs, [user_check]const void * self_tcs, int timeout); + int u_thread_wait_event_ocall([out] int *error, [user_check] const void *tcs, [in] const struct timespec *timeout); + int u_thread_set_multiple_events_ocall([out] int *error, [in, count=total] const void **tcss, int total); + int u_thread_setwait_events_ocall([out] int *error, + [user_check] const void *waiter_tcs, + [user_check] const void *self_tcs, + [in] const struct timespec *timeout); }; -}; \ No newline at end of file +}; diff --git a/sgx/RSA-sgx-test/enclave/Cargo.toml b/sgx/RSA-sgx-test/enclave/Cargo.toml index c8b7a772..ac9626d5 100644 --- a/sgx/RSA-sgx-test/enclave/Cargo.toml +++ b/sgx/RSA-sgx-test/enclave/Cargo.toml @@ -26,6 +26,6 @@ lazy_static = { version = "1", default-features = false, features = ["spin_no_st [target.'cfg(not(target_env = "sgx"))'.dependencies] -sgx_types = { rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git" } -sgx_tstd = { rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git" } -sgx_tunittest = {rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git" } +sgx_types = { rev = "v1.1.1", git = "https://github.com/apache/teaclave-sgx-sdk.git" } +sgx_tstd = { rev = "v1.1.1", git = "https://github.com/apache/teaclave-sgx-sdk.git" } +sgx_tunittest = {rev = "v1.1.1", git = "https://github.com/apache/teaclave-sgx-sdk.git" } diff --git a/sgx/RSA-sgx-test/enclave/Xargo.toml b/sgx/RSA-sgx-test/enclave/Xargo.toml index ef14c968..3a845efc 100644 --- a/sgx/RSA-sgx-test/enclave/Xargo.toml +++ b/sgx/RSA-sgx-test/enclave/Xargo.toml @@ -29,10 +29,6 @@ stage = 2 git = "https://github.com/apache/teaclave-sgx-sdk.git" stage = 2 -[dependencies.sgx_tservice] -git = "https://github.com/apache/teaclave-sgx-sdk.git" -stage = 2 - [dependencies.sgx_tse] git = "https://github.com/apache/teaclave-sgx-sdk.git" stage = 2 @@ -67,8 +63,8 @@ stage = 4 [dependencies.std] git = "https://github.com/apache/teaclave-sgx-sdk.git" -features = ["backtrace", "net"] stage = 5 +features = ["backtrace"] [dependencies.sgx_no_tstd] git = "https://github.com/apache/teaclave-sgx-sdk.git"