Skip to content

Commit d166ff0

Browse files
committed
Linux 2.7.1 Open Source Gold Release
Updated OpenSSL to 1.1.1d. Fixed bugs. Signed-off-by: Li, Xun <[email protected]>
1 parent 864364d commit d166ff0

40 files changed

+7917
-5037
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#
3030
#
3131

32-
DCAP_VER?= 1.3
32+
DCAP_VER?= 1.3.1
3333
DCAP_DOWNLOAD_BASE ?= https://github.com/intel/SGXDataCenterAttestationPrimitives/archive
3434

3535
CHECK_OPT :=

buildenv.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,7 @@ COMMON_LDFLAGS := -Wl,-z,relro,-z,now,-z,noexecstack
180180
# When `pie' is enabled, the linker (both BFD and Gold) under Ubuntu 14.04
181181
# will hide all symbols from dynamic symbol table even if they are marked
182182
# as `global' in the LD version script.
183-
ENCLAVE_CFLAGS = -ffreestanding -nostdinc -fvisibility=hidden -fpie
184-
ifeq ($(CC_GREAT_EQUAL_8), 1)
185-
ENCLAVE_CFLAGS += -fcf-protection
186-
endif
183+
ENCLAVE_CFLAGS = -ffreestanding -nostdinc -fvisibility=hidden -fpie -fno-strict-overflow -fno-delete-null-pointer-checks
187184
ENCLAVE_CXXFLAGS = $(ENCLAVE_CFLAGS) -nostdinc++
188185
ENCLAVE_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
189186
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \

common/inc/internal/se_version.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*
3030
*/
31-
#define STRFILEVER "2.7.100.4"
31+
#define STRFILEVER "2.7.101.3"
3232
#define COPYRIGHT "Copyright (C) 2019 Intel Corporation"
3333

34-
#define UAE_SERVICE_VERSION "1.2.101.4"
35-
#define URTS_VERSION "1.1.102.4"
36-
#define ENCLAVE_COMMON_VERSION "1.0.105.4"
37-
#define LAUNCH_VERSION "1.0.100.4"
38-
#define PLATFORM_VERSION "1.0.100.4"
39-
#define EPID_VERSION "1.0.100.4"
40-
#define QUOTE_EX_VERSION "1.0.100.4"
34+
#define UAE_SERVICE_VERSION "1.2.102.3"
35+
#define URTS_VERSION "1.1.103.3"
36+
#define ENCLAVE_COMMON_VERSION "1.0.106.3"
37+
#define LAUNCH_VERSION "1.0.101.3"
38+
#define PLATFORM_VERSION "1.0.101.3"
39+
#define EPID_VERSION "1.0.101.3"
40+
#define QUOTE_EX_VERSION "1.0.101.3"

common/inc/sgx_secure_align.h

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
/*
2+
* Copyright (C) 2011-2019 Intel Corporation. All rights reserved.
3+
*
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 Intel Corporation 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.
29+
*
30+
*/
31+
32+
33+
#ifndef _SGX_SECURE_ALIGN_H_
34+
#define _SGX_SECURE_ALIGN_H_
35+
36+
#include <cstdint>
37+
#include <utility>
38+
39+
namespace sgx {
40+
41+
template <class T>
42+
constexpr T __rol(T v, std::size_t c, std::size_t _m)
43+
{
44+
return (v << (c & _m)) | (v >> ((0 - c) & _m));
45+
}
46+
47+
template <class T>
48+
constexpr T rol(T v, std::size_t c)
49+
{
50+
return __rol(typename std::make_unsigned<T>::type(v), c, sizeof(v) * 8 - 1);
51+
}
52+
53+
template <class T>
54+
constexpr T ror(T v, std::size_t c)
55+
{
56+
return rol(v, 0 - c);
57+
}
58+
59+
namespace __custom_alignment_internal {
60+
61+
template <std::int64_t B, std::size_t... OLs>
62+
struct secret_bmp;
63+
64+
template <std::int64_t B, std::size_t O, std::size_t L, std::size_t... OLs>
65+
struct secret_bmp<B, O, L, OLs...> :
66+
secret_bmp<B | rol((1ll << L) - 1, O), OLs...>
67+
{};
68+
69+
template <std::int64_t B>
70+
struct secret_bmp<B>
71+
{
72+
enum : std::int64_t
73+
{
74+
value = B
75+
};
76+
};
77+
78+
constexpr std::int64_t __gen_alignmask(
79+
std::size_t al,
80+
std::size_t a = sizeof(std::uint64_t) * 8,
81+
std::uint64_t m = 1ull << (sizeof(std::uint64_t) * 8 - 1))
82+
{
83+
return a > al ? __gen_alignmask(al, a >> 1, m | (m >> (a >> 1))) : m;
84+
}
85+
86+
/* count leading zero bits */
87+
template <class T>
88+
constexpr int count_lzb(T bmp)
89+
{
90+
return bmp == 0 ? -1 :
91+
typename std::make_signed<T>::type(bmp) < 0 ? 0 : count_lzb(bmp << 1) + 1;
92+
}
93+
94+
/* calculate leading spaces needed
95+
* returns negative value if no viable solution could be found
96+
*/
97+
constexpr int calc_lspc(std::size_t al, std::int64_t bmp)
98+
{
99+
return (al & (al - 1)) != 0 ? -2 : count_lzb(
100+
~(ror(bmp | ror(bmp, 1) | ror(bmp, 2) | ror(bmp, 3), 5) | ror(bmp, 1)) & __gen_alignmask(al));
101+
}
102+
103+
constexpr std::size_t __calc_algn(std::size_t size, std::size_t a = sizeof(std::uint64_t) * 8)
104+
{
105+
return a > 8 && size <= a / 2 ? __calc_algn(size, a / 2) : a;
106+
}
107+
108+
/* calculate alignment for a structure */
109+
constexpr std::size_t calc_algn(std::size_t al, std::size_t size)
110+
{
111+
return al > 64 ? al : __calc_algn(size);
112+
}
113+
114+
115+
/*
116+
* without this pragma, we need a destructor, which
117+
* would want to pull in C++ lib, which we want to avoid
118+
*/
119+
120+
template <class T, std::size_t A, int LZ>
121+
struct alignas(calc_algn(A, sizeof(T) + LZ)) custom_alignment
122+
{
123+
static_assert(LZ > 0, "No viable offset");
124+
125+
char __no_secret_allowed_in_here[LZ];
126+
T v;
127+
128+
template <class... Us>
129+
custom_alignment(Us&&... args) : v(std::forward<Us>(args)...) {}
130+
};
131+
132+
template <class T, std::size_t A>
133+
struct alignas(calc_algn(A, sizeof(T))) custom_alignment<T, A, 0>
134+
{
135+
T v;
136+
137+
template <class... Us>
138+
custom_alignment(Us&&... args) : v(std::forward<Us>(args)...) {}
139+
};
140+
141+
142+
143+
} /* namespace __custom_alignment_internal */
144+
145+
template <class T, std::size_t A, std::size_t... OLs>
146+
using custom_alignment_aligned = __custom_alignment_internal::custom_alignment<T, A,
147+
__custom_alignment_internal::calc_lspc(A, __custom_alignment_internal::secret_bmp<0, OLs...>::value)>;
148+
149+
template <class T, std::size_t... OLs>
150+
using custom_alignment = custom_alignment_aligned<T, alignof(T), OLs...>;
151+
152+
} /* namespace sgx */
153+
154+
#endif

common/inc/sgx_secure_align_api.h

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/*
2+
* Copyright (C) 2011-2019 Intel Corporation. All rights reserved.
3+
*
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 Intel Corporation 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.
29+
*
30+
*/
31+
32+
#ifndef _SGX_SECURE_ALIGN_API_H_
33+
#define _SGX_SECURE_ALIGN_API_H_
34+
35+
#include <stdint.h>
36+
37+
typedef struct
38+
{
39+
size_t offset;
40+
size_t len;
41+
} align_req_t;
42+
43+
#ifdef __cplusplus
44+
extern "C" {
45+
#endif
46+
/**
47+
* sgx_aligned_malloc
48+
*
49+
* Allocates memory for a structure on a specified alignment boundary
50+
*
51+
* Parameters:
52+
* size - the size of the requested memory allocation in bytes.
53+
* alignment - the alignment value, which must be an integer power of 2.
54+
* data - (offset, length) pairs to define the fields in the structure for secrets
55+
* If data is NULL and count is 0, the whole structure will be aligned.
56+
* count - number of align_req_t structure in data
57+
* If data is NULL and count is 0, the whole structure will be aligned.
58+
*
59+
* Return Value:
60+
* A pointer to the memory block that was allocated or NULL if the operation failed.
61+
*/
62+
void *sgx_aligned_malloc(size_t size, size_t alignment, align_req_t *data, size_t count);
63+
/**
64+
* sgx_aligned_free
65+
*
66+
* Frees a block of memory that was allocated with sgx_aligned_malloc
67+
*
68+
* Parameters:
69+
* ptr - a pointer to the memory block that was returned to the sgx_aligned_malloc
70+
*
71+
*/
72+
void sgx_aligned_free(void *ptr);
73+
74+
/*
75+
* sgx_get_aligned_ptr
76+
*
77+
* Return a pointer from the pre-allocated memory on a specified alignment boundary
78+
*
79+
* Parameters:
80+
* raw - the memory allocated by user
81+
* raw_size - the size of raw memory in bytes
82+
* allocate_size - the size of the requested memory allocation in bytes.
83+
* alignment - the alignment value, which must be an integer power of 2.
84+
* data - (offset, length) pairs to define the fields in the structure for secrets
85+
* If data is NULL and count is 0, the whole structure will be aligned.
86+
* count - number of align_req_t structure in data
87+
* If data is NULL and count is 0, the whole structure will be aligned.
88+
* Return Value:
89+
* A pointer to the memory block or NULL if the operation failed.
90+
* Note:
91+
* The raw memory should be allocated by user, and it should be big enough to get aligned pointer:
92+
* (size + 72)(bytes), if alignment <= 8
93+
* (size + 64 + alignment)(bytes), if alignment > 8
94+
*
95+
*/
96+
void *sgx_get_aligned_ptr(void *raw, size_t raw_size, size_t allocate_size, size_t alignment, align_req_t *data, size_t count);
97+
98+
#ifdef __cplusplus
99+
}
100+
#endif
101+
102+
#endif

download_prebuilt.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333

3434
top_dir=`dirname $0`
3535
out_dir=$top_dir
36-
optlib_name=optimized_libs_2.7.tar.gz
37-
ae_file_name=prebuilt_ae_2.7.tar.gz
38-
checksum_file=SHA256SUM_prebuilt_2.7.txt
39-
server_url_path=https://download.01.org/intel-sgx/sgx-linux/2.7
36+
optlib_name=optimized_libs_2.7.1.tar.gz
37+
ae_file_name=prebuilt_ae_2.7.1.tar.gz
38+
checksum_file=SHA256SUM_prebuilt_2.7.1.txt
39+
server_url_path=https://download.01.org/intel-sgx/sgx-linux/2.7.1
4040
server_optlib_url=$server_url_path/$optlib_name
4141
server_ae_url=$server_url_path/$ae_file_name
4242
server_checksum_url=$server_url_path/$checksum_file

external/dcap_source

Submodule dcap_source updated 119 files

0 commit comments

Comments
 (0)