Skip to content
This repository was archived by the owner on Jul 27, 2022. It is now read-only.

Commit bb043a8

Browse files
committed
Problem: outdated Intel SGX SDK (CRO-626)
Solution: as the Rust SGX SDK isn't yet officially released (and may take some time), the code was ported to use the 1.1.0-beta that is based on the latest Intel SGX SDK. (crate dependencies were temporarily put into a sgx-vendor repository with the updated Rust SGX SDK deps.) TODO: port to the 1.1.0 release when it happens (note some changes may be needed for secrets handling)
1 parent c9dcc7b commit bb043a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+860
-939
lines changed

Cargo.lock

Lines changed: 95 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain-abci/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ hex = "0.4"
3232
protobuf = "2.7.0"
3333
integer-encoding = "1.0.7"
3434
structopt = "0.3"
35-
secp256k1zkp = { git = "https://github.com/crypto-com/rust-secp256k1-zkp.git", rev = "8b9a38b870a7759fcdbd4a5d435b5ba873c70afd", features = ["recovery", "endomorphism"] }
35+
secp256k1zkp = { git = "https://github.com/crypto-com/rust-secp256k1-zkp.git", rev = "be445f29a96af31fe079611d26c07f1f596d1c5f", features = ["recovery", "endomorphism"] }
3636
blake2 = "0.8"
3737
parity-scale-codec = { features = ["derive"], version = "1.1" }
3838
zmq = "0.9"

chain-core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ digest = { version = "0.8", default-features = false}
1616
tiny-keccak = { version = "2.0", features = ["keccak"] }
1717
sha2 = { version = "0.8", default-features = false }
1818
hex = { version = "0.4", optional = true }
19-
secp256k1zkp = { git = "https://github.com/crypto-com/rust-secp256k1-zkp.git", default-features = false, rev = "8b9a38b870a7759fcdbd4a5d435b5ba873c70afd", features = ["recovery", "endomorphism"] }
19+
secp256k1zkp = { git = "https://github.com/crypto-com/rust-secp256k1-zkp.git", default-features = false, rev = "be445f29a96af31fe079611d26c07f1f596d1c5f", features = ["recovery", "endomorphism"] }
2020
serde = { version = "1.0", features = ["derive"], optional = true }
2121
blake2 = { version = "0.8", default-features = false }
2222
parity-scale-codec = { features = ["derive"], default-features = false, version = "1.1" }
2323
base64 = { version = "0.11", optional = true }
24-
sgx_tstd = { rev = "v1.0.9", git = "https://github.com/baidu/rust-sgx-sdk.git", optional = true }
24+
sgx_tstd = { rev = "5b5e512abbbfc3030e8cb274989fb372b685b168", git = "https://github.com/baidu/rust-sgx-sdk.git", optional = true }
2525
static_assertions = { version = "1.1.0", default-features = false}
2626
bech32 = { version = "0.7.1", optional = true }
2727
aead = "0.2"

chain-tx-enclave/enclave-t-common/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ readme = "../../README.md"
77
edition = "2018"
88

99
[dependencies]
10-
sgx_tstd = { rev = "v1.0.9", git = "https://github.com/baidu/rust-sgx-sdk.git" }
10+
sgx_tstd = { rev = "5b5e512abbbfc3030e8cb274989fb372b685b168", git = "https://github.com/baidu/rust-sgx-sdk.git" }
1111
chain-core = { path = "../../chain-core", default-features = false, features = ["mesalock_sgx"] }
12-
secp256k1zkp = { git = "https://github.com/crypto-com/rust-secp256k1-zkp.git", default-features = false, rev = "8b9a38b870a7759fcdbd4a5d435b5ba873c70afd", features = ["recovery", "endomorphism", "sgx"] }
12+
secp256k1zkp = { git = "https://github.com/crypto-com/rust-secp256k1-zkp.git", default-features = false, rev = "be445f29a96af31fe079611d26c07f1f596d1c5f", features = ["recovery", "endomorphism", "sgx"] }
1313
zeroize = { version = "1.0", default-features = false }
14-
sgx_tseal = { rev = "v1.0.9", git = "https://github.com/baidu/rust-sgx-sdk" }
14+
sgx_tseal = { rev = "5b5e512abbbfc3030e8cb274989fb372b685b168", git = "https://github.com/baidu/rust-sgx-sdk" }
1515
parity-scale-codec = { default-features = false, version = "1.0" }
16-
sgx_types = { rev = "v1.0.9", git = "https://github.com/baidu/rust-sgx-sdk.git" }
16+
sgx_types = { rev = "5b5e512abbbfc3030e8cb274989fb372b685b168", git = "https://github.com/baidu/rust-sgx-sdk.git" }

chain-tx-enclave/enclave-u-common/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ edition = "2018"
1010
hex = "0.3"
1111
log = "0.4.0"
1212
env_logger = "0.7.0"
13-
sgx_types = { rev = "v1.0.9", git = "https://github.com/baidu/rust-sgx-sdk" }
14-
sgx_urts = { rev = "v1.0.9", git = "https://github.com/baidu/rust-sgx-sdk" }
13+
sgx_types = { rev = "5b5e512abbbfc3030e8cb274989fb372b685b168", git = "https://github.com/baidu/rust-sgx-sdk" }
14+
sgx_urts = { rev = "5b5e512abbbfc3030e8cb274989fb372b685b168", git = "https://github.com/baidu/rust-sgx-sdk" }

chain-tx-enclave/rust-sgx-sdk/buildenv.mk

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
18
#
2-
# Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved.
9+
# http://www.apache.org/licenses/LICENSE-2.0
310
#
4-
# Redistribution and use in source and binary forms, with or without
5-
# modification, are permitted provided that the following conditions
6-
# are met:
7-
#
8-
# * Redistributions of source code must retain the above copyright
9-
# notice, this list of conditions and the following disclaimer.
10-
# * Redistributions in binary form must reproduce the above copyright
11-
# notice, this list of conditions and the following disclaimer in
12-
# the documentation and/or other materials provided with the
13-
# distribution.
14-
# * Neither the name of Baidu, Inc., nor the names of its
15-
# contributors may be used to endorse or promote products derived
16-
# from this software without specific prior written permission.
17-
#
18-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20-
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21-
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22-
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23-
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24-
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25-
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26-
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27-
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28-
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License..
2917
#
3018
#
3119

@@ -127,3 +115,4 @@ ENCLAVE_LDFLAGS = -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
127115
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \
128116
-Wl,--gc-sections \
129117
-Wl,--defsym,__ImageBase=0
118+

chain-tx-enclave/rust-sgx-sdk/common/inc/assert.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* $OpenBSD: assert.h,v 1.12 2006/01/31 10:53:51 hshoexer Exp $ */
2-
/* $NetBSD: assert.h,v 1.6 1994/10/26 00:55:44 cgd Exp $ */
1+
/* $OpenBSD: assert.h,v 1.12 2006/01/31 10:53:51 hshoexer Exp $ */
2+
/* $NetBSD: assert.h,v 1.6 1994/10/26 00:55:44 cgd Exp $ */
33

44
/*-
55
* Copyright (c) 1992, 1993

chain-tx-enclave/rust-sgx-sdk/common/inc/complex.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: complex.h,v 1.3 2010/07/24 22:17:03 guenther Exp $ */
1+
/* $OpenBSD: complex.h,v 1.3 2010/07/24 22:17:03 guenther Exp $ */
22
/*
33
* Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
44
*
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#ifndef _COMPLEX_H_
19-
#define _COMPLEX_H_
19+
#define _COMPLEX_H_
2020

2121
#include <sys/cdefs.h>
2222

@@ -25,18 +25,18 @@
2525
*/
2626
#ifdef __GNUC__
2727
#if __STDC_VERSION__ < 199901
28-
#define _Complex __complex__
28+
#define _Complex __complex__
2929
#endif
30-
#define _Complex_I 1.0fi
30+
#define _Complex_I 1.0fi
3131
#elif defined(lint)
32-
#define _Complex_I 1.0fi
32+
#define _Complex_I 1.0fi
3333
#endif
3434

35-
#define complex _Complex
35+
#define complex _Complex
3636

3737
/* XXX switch to _Imaginary_I */
3838
#undef I
39-
#define I _Complex_I
39+
#define I _Complex_I
4040

4141
__BEGIN_DECLS
4242
/*

chain-tx-enclave/rust-sgx-sdk/common/inc/ctype.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3535
* SUCH DAMAGE.
3636
*
37-
* @(#)ctype.h 5.3 (Berkeley) 4/3/91
37+
* @(#)ctype.h 5.3 (Berkeley) 4/3/91
3838
*/
3939

4040
#ifndef _CTYPE_H_

chain-tx-enclave/rust-sgx-sdk/common/inc/dirent.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct dirent
2929
#endif
3030
unsigned short int d_reclen;
3131
unsigned char d_type;
32-
char d_name[256]; /* We must not include limits.h! */
32+
char d_name[256]; /* We must not include limits.h! */
3333
};
3434

3535
//#ifdef __USE_LARGEFILE64
@@ -39,11 +39,11 @@ struct dirent64
3939
__off64_t d_off;
4040
unsigned short int d_reclen;
4141
unsigned char d_type;
42-
char d_name[256]; /* We must not include limits.h! */
42+
char d_name[256]; /* We must not include limits.h! */
4343
};
4444
//#endif
4545

46-
#define d_fileno d_ino /* Backwards compatibility. */
46+
#define d_fileno d_ino /* Backwards compatibility. */
4747

4848
#undef _DIRENT_HAVE_D_NAMLEN
4949
#define _DIRENT_HAVE_D_RECLEN
@@ -52,8 +52,8 @@ struct dirent64
5252

5353
#if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T
5454
/* Inform libc code that these two types are effectively identical. */
55-
# define _DIRENT_MATCHES_DIRENT64 1
55+
# define _DIRENT_MATCHES_DIRENT64 1
5656
#else
57-
# define _DIRENT_MATCHES_DIRENT64 0
57+
# define _DIRENT_MATCHES_DIRENT64 0
58+
#endif
5859
#endif
59-
#endif

0 commit comments

Comments
 (0)