Skip to content

Commit 1bf092a

Browse files
committed
Linux 2.19 Open Source Gold Release
Supported the Key Separation and Sharing (KSS) feature in Simulation mode. Upgraded to OpenSSL 1.1.1t. Upgraded Intel(R) SGX Quote Verification Enclave to integrate SgxSSL/OpenSSL version 1.1.1t. Added new API in quote verification library to extract FMSPC (Family-Model-SteppingPlatform-CustomSKU) value from ECDSA quote. Added Rust support for SGX ECDSA quote generation. Added Linux kernel 5.19 support in TDX R3AAL (Ring 3 Attestation Abstraction Layer). Removed Protobuf in TDX QGS (Quote Generation Service) and R3AAL (Ring 3 Attestation Abstraction Layer). Fixed bugs. Signed-off-by: Li, Xun <[email protected]>
1 parent d5e10df commit 1bf092a

File tree

94 files changed

+1764
-280
lines changed

Some content is hidden

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

94 files changed

+1764
-280
lines changed

Makefile.psw_dcap

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,11 @@ ippcp:
6464
$(MAKE) -C external/ippcp_internal/
6565

6666
sdk: ippcp
67-
$(MAKE) -C sdk/ MITIGATION-CVE-2020-0551=LOAD
68-
$(MAKE) -C sdk/ clean
69-
$(MAKE) -C sdk/ MITIGATION-CVE-2020-0551=CF
70-
$(MAKE) -C sdk/ clean
7167
$(MAKE) -C sdk/
72-
$(MAKE) -C external/dcap_source/QuoteVerification/dcap_tvl MITIGATION-CVE-2020-0551=LOAD
73-
$(MAKE) -C external/dcap_source/QuoteVerification/dcap_tvl MITIGATION-CVE-2020-0551=CF clean
74-
$(MAKE) -C external/dcap_source/QuoteVerification/dcap_tvl MITIGATION-CVE-2020-0551=CF
75-
$(MAKE) -C external/dcap_source/QuoteVerification/dcap_tvl clean
7668
$(MAKE) -C external/dcap_source/QuoteVerification/dcap_tvl
7769

7870
install_sdk: sdk
79-
./linux/installer/bin/build-installpkg.sh sdk cve-2020-0551
71+
./linux/installer/bin/build-installpkg.sh sdk
8072
ifeq ($(call DIR_EXISTS,$(SGX_SDK)),)
8173
./linux/installer/bin/sgx_linux_x64_sdk_*.bin --prefix=$(dir $(SGX_SDK))
8274
endif

Makefile.psw_tdx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,11 @@ endif
6363
ippcp:
6464
$(MAKE) -C external/ippcp_internal/
6565
sdk: ippcp
66-
$(MAKE) -C sdk/ MITIGATION-CVE-2020-0551=LOAD
67-
$(MAKE) -C sdk/ clean
68-
$(MAKE) -C sdk/ MITIGATION-CVE-2020-0551=CF
69-
$(MAKE) -C sdk/ clean
7066
$(MAKE) -C sdk/
71-
$(MAKE) -C external/dcap_source/QuoteVerification/dcap_tvl MITIGATION-CVE-2020-0551=LOAD
72-
$(MAKE) -C external/dcap_source/QuoteVerification/dcap_tvl MITIGATION-CVE-2020-0551=CF clean
73-
$(MAKE) -C external/dcap_source/QuoteVerification/dcap_tvl MITIGATION-CVE-2020-0551=CF
74-
$(MAKE) -C external/dcap_source/QuoteVerification/dcap_tvl clean
7567
$(MAKE) -C external/dcap_source/QuoteVerification/dcap_tvl
7668

7769
install_sdk: sdk
78-
./linux/installer/bin/build-installpkg.sh sdk cve-2020-0551
70+
./linux/installer/bin/build-installpkg.sh sdk
7971
ifeq ($(call DIR_EXISTS,$(SGX_SDK)),)
8072
./linux/installer/bin/sgx_linux_x64_sdk_*.bin --prefix=$(dir $(SGX_SDK))
8173
endif

README.md

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ Build the Intel(R) SGX SDK and Intel(R) SGX PSW Package
102102
- Use the following command(s) to install the required tools to build the Intel(R) SGX SDK:
103103
* On Ubuntu 18.04 and Debian 10:
104104
```
105-
$ sudo apt-get install build-essential ocaml ocamlbuild automake autoconf libtool wget python libssl-dev git cmake perl
105+
$ sudo apt-get install build-essential ocaml ocamlbuild automake autoconf libtool wget python3 libssl-dev git cmake perl
106+
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
106107
```
107108
* On Ubuntu 20.04 and Ubuntu 22.04:
108109
```
@@ -111,25 +112,26 @@ Build the Intel(R) SGX SDK and Intel(R) SGX PSW Package
111112
* On Red Hat Enterprise Linux 8.6:
112113
```
113114
$ sudo yum groupinstall 'Development Tools'
114-
$ sudo yum install ocaml ocaml-ocamlbuild wget python2 openssl-devel git cmake perl
115-
$ sudo alternatives --set python /usr/bin/python2
115+
$ sudo yum install ocaml ocaml-ocamlbuild wget python3 openssl-devel git cmake perl
116+
$ sudo alternatives --set python /usr/bin/python3
116117
```
117118
* On CentOS Stream 8 and CentOS 8.3:
118119
```
119120
$ sudo dnf group install 'Development Tools'
120-
$ sudo dnf --enablerepo=powertools install ocaml ocaml-ocamlbuild redhat-rpm-config openssl-devel wget rpm-build git cmake perl python2
121-
$ sudo alternatives --set python /usr/bin/python2
121+
$ sudo dnf --enablerepo=powertools install ocaml ocaml-ocamlbuild redhat-rpm-config openssl-devel wget rpm-build git cmake perl python3
122+
$ sudo alternatives --set python /usr/bin/python3
122123
```
123124
* On Anolis 8.6:
124125
```
125126
$ sudo dnf group install 'Development Tools'
126-
$ sudo dnf --enablerepo=PowerTools install ocaml ocaml-ocamlbuild redhat-rpm-config openssl-devel wget rpm-build git cmake perl python2
127-
$ sudo alternatives --set python /usr/bin/python2
127+
$ sudo dnf --enablerepo=PowerTools install ocaml ocaml-ocamlbuild redhat-rpm-config openssl-devel wget rpm-build git cmake perl python3
128+
$ sudo alternatives --set python /usr/bin/python3
128129
```
129130
* On SUSE Linux Enterprise Server 15.4:
130131
```
131132
$ sudo zypper install --type pattern devel_basis
132-
$ sudo zypper install ocaml ocaml-ocamlbuild automake autoconf libtool wget python libopenssl-devel rpm-build git cmake perl
133+
$ sudo zypper install ocaml ocaml-ocamlbuild automake autoconf libtool wget python3 libopenssl-devel rpm-build git cmake perl
134+
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
133135
```
134136
**Note**: To build Intel(R) SGX SDK, gcc version is required to be 7.3 or above and glibc version is required to be 2.27 or above.
135137
- Use the following command to install additional required tools and latest Intel(R) SGX SDK Installer to build the Intel(R) SGX PSW:
@@ -140,19 +142,19 @@ Build the Intel(R) SGX SDK and Intel(R) SGX PSW Package
140142
```
141143
* On Ubuntu 20.04 and Ubuntu 22.04:
142144
```
143-
$ sudo apt-get install libssl-dev libcurl4-openssl-dev protobuf-compiler libprotobuf-dev debhelper cmake reprepro unzip pkgconf libboost-dev libboost-system-dev libboost-thread-dev protobuf-c-compiler libprotobuf-c-dev lsb-release libsystemd0
145+
$ sudo apt-get install libssl-dev libcurl4-openssl-dev protobuf-compiler libprotobuf-dev debhelper cmake reprepro unzip pkgconf libboost-dev libboost-system-dev libboost-thread-dev lsb-release libsystemd0
144146
```
145147
* On Red Hat Enterprise Linux 8.6:
146148
```
147-
$ sudo yum install openssl-devel libcurl-devel protobuf-devel cmake rpm-build createrepo yum-utils pkgconf boost-devel protobuf-lite-devel protobuf-c-compiler protobuf-c-devel systemd-libs
149+
$ sudo yum install openssl-devel libcurl-devel protobuf-devel cmake rpm-build createrepo yum-utils pkgconf boost-devel protobuf-lite-devel systemd-libs
148150
```
149151
* On CentOS Stream 8 and CentOS 8.3:
150152
```
151-
$ sudo dnf --enablerepo=powertools install openssl-devel libcurl-devel protobuf-devel cmake rpm-build createrepo yum-utils pkgconf boost-devel protobuf-lite-devel protobuf-c-compiler protobuf-c-devel systemd-libs
153+
$ sudo dnf --enablerepo=powertools install openssl-devel libcurl-devel protobuf-devel cmake rpm-build createrepo yum-utils pkgconf boost-devel protobuf-lite-devel systemd-libs
152154
```
153155
* On Anolis 8.6:
154156
```
155-
$ sudo dnf --enablerepo=PowerTools install openssl-devel libcurl-devel protobuf-devel cmake rpm-build createrepo yum-utils pkgconf boost-devel protobuf-lite-devel protobuf-c-compiler protobuf-c-devel systemd-libs
157+
$ sudo dnf --enablerepo=PowerTools install openssl-devel libcurl-devel protobuf-devel cmake rpm-build createrepo yum-utils pkgconf boost-devel protobuf-lite-devel systemd-libs
156158
```
157159
* On SUSE Linux Enterprise Server 15.4:
158160
```
@@ -343,24 +345,26 @@ Install the Intel(R) SGX SDK
343345
* Anolis OS 8.6 64bits
344346
* Debian 10 64bits
345347
- Use the following command to install the required tool to use Intel(R) SGX SDK:
346-
* On Ubuntu 18.04, Ubuntu 20.04 and Debian 10:
348+
* On Ubuntu 18.04 and Debian 10:
347349
```
348-
$ sudo apt-get install build-essential python
350+
$ sudo apt-get install build-essential python3
351+
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
349352
```
350-
* On Ubuntu 22.04:
353+
* On Ubuntu 20.04 and Ubuntu 22.04:
351354
```
352-
$ sudo apt-get install build-essential python2
355+
$ sudo apt-get install build-essential python-is-python3
353356
```
354357
* On Red Hat Enterprise Linux 8.6, CentOS Stream 8, CentOS 8.3 and Anolis OS 8.6:
355358
```
356359
$ sudo yum groupinstall 'Development Tools'
357-
$ sudo yum install python2
358-
$ sudo alternatives --set python /usr/bin/python2
360+
$ sudo yum install python3
361+
$ sudo alternatives --set python /usr/bin/python3
359362
```
360363
* On SUSE Linux Enterprise Server 15.4:
361364
```
362365
$ sudo zypper install --type pattern devel_basis
363-
$ sudo zypper install python
366+
$ sudo zypper install python3
367+
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
364368
```
365369
366370
### Install the Intel(R) SGX SDK
@@ -403,6 +407,13 @@ See the later topic, *Install Intel(R) SGX PSW*, for information on how to insta
403407
$ ./app
404408
```
405409
Use similar commands for other code samples.
410+
**Note:** On Ubuntu 22.04 or any distro with systemd v248 or later, /dev/sgx_enclave is only accessible by users in the group "sgx". The enclave app should be run with a uid in the sgx group.
411+
```
412+
# check systemd version:
413+
$ systemctl --version
414+
# add sgx group to user if it's 248 or above:
415+
$ sudo usermod -a -G sgx <user name>
416+
```
406417
407418
408419
Install the Intel(R) SGX PSW

SampleCode/Cxx11SGXDemo/App/App.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
#endif
5050

5151
#if defined(__GNUC__)
52-
# define TOKEN_FILENAME "enclave.token"
5352
# define ENCLAVE_FILENAME "enclave.signed.so"
5453
#endif
5554

SampleCode/Cxx14SGXDemo/App/App.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
#endif
5050

5151
#if defined(__GNUC__)
52-
# define TOKEN_FILENAME "enclave.token"
5352
# define ENCLAVE_FILENAME "enclave.signed.so"
5453
#endif
5554

SampleCode/Cxx17SGXDemo/App/App.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
#endif
5050

5151
#if defined(__GNUC__)
52-
# define TOKEN_FILENAME "enclave.token"
5352
# define ENCLAVE_FILENAME "enclave.signed.so"
5453
#endif
5554

SampleCode/ProtobufSGXDemo/App/App.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
#endif
5050

5151
#if defined(__GNUC__)
52-
# define TOKEN_FILENAME "enclave.token"
5352
# define ENCLAVE_FILENAME "enclave.signed.so"
5453
#endif
5554

SampleCode/ProtobufSGXDemo/Enclave/person.proto

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
/*
2+
* Copyright (C) 2011-2021 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+
132
package lm;
233
message Person
334
{

SampleCode/SampleAttestedTLS/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Note:
122122
running in this sample.
123123
The project has a pre-preparation script - prepare_sgxssl.sh to prepare the SgxSSL libraries and link to them in
124124
the Makefile.
125+
Note that script "prepare_sgxssl.sh" requires git installed and configured.
125126
- Limitation: No Simulation mode is supported.
126127

127128
### Running attested TLS server in loop

SampleCode/SampleAttestedTLS/prepare_sgxssl.sh

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ project_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3535
echo "project_dir is $project_dir"
3636
sgxssl_dir=$project_dir/sgxssl
3737
openssl_out_dir=$sgxssl_dir/openssl_source
38-
openssl_ver_name=openssl-1.1.1q
39-
sgxssl_github_archive=https://github.com/01org/intel-sgx-ssl/archive
40-
sgxssl_file_name=support_tls_lin_1.1.1q
38+
openssl_ver_name=openssl-1.1.1t
39+
intel_sgx_ssl_url=https://github.com/intel/intel-sgx-ssl
40+
support_tls_branch=support_tls
4141
build_script=$sgxssl_dir/Linux/build_openssl.sh
4242
server_url_path=https://www.openssl.org/source
4343
full_openssl_url=$server_url_path/$openssl_ver_name.tar.gz
@@ -56,22 +56,10 @@ if [ $debug == true ] ; then
5656
read -n 1 -p "download souce code only, because we need to build ourselves"
5757
fi
5858

59-
openssl_chksum=d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca
60-
sgxssl_chksum=0ab6f62bda33e760422d502ba4812d058e50516ebb82e6c7713c78f580a7d622
61-
rm -f check_sum_openssl.txt check_sum_sgxssl.txt
59+
openssl_chksum=8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b
60+
rm -f check_sum_openssl.txt
6261
if [ ! -f $build_script ]; then
63-
wget $sgxssl_github_archive/$sgxssl_file_name.zip -P $sgxssl_dir/ || exit 1
64-
sha256sum $sgxssl_dir/$sgxssl_file_name.zip > $sgxssl_dir/check_sum_sgxssl.txt
65-
grep $sgxssl_chksum $sgxssl_dir/check_sum_sgxssl.txt
66-
if [ $? -ne 0 ]; then
67-
echo "File $sgxssl_dir/$sgxssl_file_name.zip checksum failure"
68-
rm -f $sgxssl_dir/$sgxssl_file_name.zip
69-
exit -1
70-
fi
71-
unzip -qq $sgxssl_dir/$sgxssl_file_name.zip -d $sgxssl_dir/ || exit 1
72-
mv $sgxssl_dir/intel-sgx-ssl-$sgxssl_file_name/* $sgxssl_dir/ || exit 1
73-
rm $sgxssl_dir/$sgxssl_file_name.zip || exit 1
74-
rm -rf $sgxssl_dir/intel-sgx-ssl-$sgxssl_file_name || exit 1
62+
git clone $intel_sgx_ssl_url -b $support_tls_branch $sgxssl_dir || exit 1
7563
fi
7664

7765
if [ ! -f $openssl_out_dir/$openssl_ver_name.tar.gz ]; then
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#
2+
# Copyright (C) 2011-2021 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+
include ../sgxenv.mk
33+
34+
all: server
35+
36+
server:
37+
$(CXX) -c -DTDX_ENV -DCLIENT_USE_QVL $(App_Cpp_Flags) server.cpp openssl_server.cpp ../common/verify_callback.cpp ../common/utility.cpp ../common/openssl_utility.cpp ../common/err_msg.cpp
38+
$(CXX) -o tls_server server.o openssl_server.o verify_callback.o utility.o openssl_utility.o err_msg.o $(App_Link_Flags) -lssl -ltdx_tls -lsgx_dcap_quoteverify -l:libtdx_attest.so.1
39+
40+
clean:
41+
rm -f tls_server *.o

0 commit comments

Comments
 (0)