Skip to content

Commit

Permalink
Port to sgx 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dingelish committed Mar 30, 2020
1 parent 4561619 commit d062f1d
Show file tree
Hide file tree
Showing 67 changed files with 974 additions and 810 deletions.
32 changes: 16 additions & 16 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions sgx/RSA-sgx-test/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions sgx/RSA-sgx-test/common/inc/assert.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 7 additions & 7 deletions sgx/RSA-sgx-test/common/inc/complex.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*
Expand All @@ -16,7 +16,7 @@
*/

#ifndef _COMPLEX_H_
#define _COMPLEX_H_
#define _COMPLEX_H_

#include <sys/cdefs.h>

Expand All @@ -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
/*
Expand Down
2 changes: 1 addition & 1 deletion sgx/RSA-sgx-test/common/inc/ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down
12 changes: 6 additions & 6 deletions sgx/RSA-sgx-test/common/inc/dirent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion sgx/RSA-sgx-test/common/inc/endian.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
6 changes: 3 additions & 3 deletions sgx/RSA-sgx-test/common/inc/errno.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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_
Expand Down Expand Up @@ -180,7 +180,7 @@ __BEGIN_DECLS

#ifndef errno
int * _TLIBC_CDECL_ __errno(void);
#define errno (*__errno())
#define errno (*__errno())
#endif /* errno */
__END_DECLS

Expand Down
4 changes: 2 additions & 2 deletions sgx/RSA-sgx-test/common/inc/float.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions sgx/RSA-sgx-test/common/inc/iso646.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> 02/16/95.
Expand Down
6 changes: 3 additions & 3 deletions sgx/RSA-sgx-test/common/inc/limits.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
*/


Expand Down
4 changes: 2 additions & 2 deletions sgx/RSA-sgx-test/common/inc/math.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions sgx/RSA-sgx-test/common/inc/mbusafecrt.h
Original file line number Diff line number Diff line change
@@ -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.
//

/***
Expand Down Expand Up @@ -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 */
37 changes: 37 additions & 0 deletions sgx/RSA-sgx-test/common/inc/netdb.h
Original file line number Diff line number Diff line change
@@ -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
<http://www.gnu.org/licenses/>. */

/* 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
6 changes: 3 additions & 3 deletions sgx/RSA-sgx-test/common/inc/poll.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading

0 comments on commit d062f1d

Please sign in to comment.