Skip to content

Commit fe200aa

Browse files
committed
Intel(R) SGX DCAP 1.13 Release
Enhanced QPL (Quote Provider Library) to support caching Intel PCK (Provisioning Certificate Key) certificate chain in local memory, or retrieving Intel PCK cert chain from local HTTP/S address. Upgraded Intel ECDSA Quote Verification Enclave to integrate SgxSSL/OpenSSL version 1.1.1m. Introduced Intel ID enclave for QE identity generation. Fixed bug. Signed-off-by: Li, Xun <[email protected]>
1 parent b6d6145 commit fe200aa

File tree

364 files changed

+21677
-15742
lines changed

Some content is hidden

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

364 files changed

+21677
-15742
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131

3232
CUR_MKFILE:= $(lastword $(MAKEFILE_LIST))
3333

34-
.PHONY: all clean rebuild QuoteGeneration QuoteVerification PCKCertSelection PCKRetrievalTool
34+
.PHONY: all clean rebuild QuoteGeneration QuoteVerification PCKCertSelection PCKRetrievalTool SGXPlatformRegistration
3535

36-
all: QuoteGeneration QuoteVerification PCKCertSelection PCKRetrievalTool
36+
all: QuoteGeneration QuoteVerification PCKCertSelection PCKRetrievalTool SGXPlatformRegistration
3737

3838
QuoteGeneration: QuoteVerification
3939
$(MAKE) -C QuoteGeneration
@@ -47,11 +47,15 @@ PCKCertSelection:
4747
PCKRetrievalTool: QuoteGeneration
4848
$(MAKE) -C tools/PCKRetrievalTool
4949

50+
SGXPlatformRegistration:
51+
$(MAKE) -C tools/SGXPlatformRegistration
52+
5053
clean:
5154
$(MAKE) -C QuoteGeneration clean
5255
$(MAKE) -C QuoteVerification clean
5356
$(MAKE) -C tools/PCKCertSelection clean
5457
$(MAKE) -C tools/PCKRetrievalTool clean
58+
$(MAKE) -C tools/SGXPlatformRegistration clean
5559

5660
rebuild:
5761
$(MAKE) -f $(CUR_MKFILE) clean

QuoteGeneration/Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ deb_sgx_dcap_pccs_pkg:
8787
deb_sgx_ae_qe3_pkg: $(CHECK_OPT)
8888
./installer/linux/deb/libsgx-ae-qe3/build.sh
8989

90+
.PHONY: deb_sgx_ae_id_enclave_pkg
91+
deb_sgx_ae_id_enclave_pkg: $(CHECK_OPT)
92+
./installer/linux/deb/libsgx-ae-id-enclave/build.sh
93+
9094
.PHONY: deb_sgx_ae_qve_pkg qve_wrapper
9195
deb_sgx_ae_qve_pkg: $(CHECK_OPT)
9296
./installer/linux/deb/libsgx-ae-qve/build.sh
@@ -110,7 +114,7 @@ deb_sgx_ra_service_pkg:
110114

111115

112116
.PHONY: deb_pkg
113-
deb_pkg: deb_sgx_pce_logic_pkg deb_sgx_qe3_logic_pkg deb_sgx_dcap_ql_pkg deb_sgx_dcap_quote_verify_pkg deb_sgx_dcap_default_qpl_pkg deb_sgx_dcap_pccs_pkg deb_sgx_ae_qe3_pkg deb_sgx_ae_qve_pkg deb_sgx_pck_id_retrieval_tool_pkg deb_sgx_ra_service_pkg
117+
deb_pkg: deb_sgx_pce_logic_pkg deb_sgx_qe3_logic_pkg deb_sgx_dcap_ql_pkg deb_sgx_dcap_quote_verify_pkg deb_sgx_dcap_default_qpl_pkg deb_sgx_dcap_pccs_pkg deb_sgx_ae_qe3_pkg deb_sgx_ae_id_enclave_pkg deb_sgx_ae_qve_pkg deb_sgx_pck_id_retrieval_tool_pkg deb_sgx_ra_service_pkg
114118
@$(RM) -f ./installer/linux/deb/*.deb ./installer/linux/deb/*.ddeb
115119
cp `find ./installer/linux/deb/ -name "*.deb" -o -name "*.ddeb"` ./installer/linux/deb/
116120
cp `find ../tools/PCKRetrievalTool/installer/deb/ -name "*.deb" -o -name "*.ddeb"` ./installer/linux/deb/
@@ -135,6 +139,10 @@ rpm_sgx_dcap_pccs_pkg:
135139
rpm_sgx_ae_qe3_pkg: $(CHECK_OPT)
136140
./installer/linux/rpm/libsgx-ae-qe3/build.sh
137141

142+
.PHONY: rpm_sgx_ae_id_enclave_pkg
143+
rpm_sgx_ae_id_enclave_pkg: $(CHECK_OPT)
144+
./installer/linux/rpm/libsgx-ae-id-enclave/build.sh
145+
138146
.PHONY: rpm_sgx_ae_qve_pkg
139147
rpm_sgx_ae_qve_pkg: $(CHECK_OPT) qve_wrapper
140148
./installer/linux/rpm/libsgx-ae-qve/build.sh
@@ -161,7 +169,7 @@ rpm_sgx_ra_service_pkg:
161169
$(MAKE) -C ../tools/SGXPlatformRegistration/ rpm_pkg
162170

163171
.PHONY: rpm_pkg
164-
rpm_pkg: rpm_sgx_dcap_ql_pkg rpm_sgx_dcap_default_qpl_pkg rpm_sgx_dcap_pccs_pkg rpm_sgx_ae_qe3_pkg rpm_sgx_ae_qve_pkg rpm_sgx_dcap_quote_verify_pkg rpm_sgx_pce_logic_pkg rpm_sgx_qe3_logic_pkg rpm_sgx_pck_id_retrieval_tool_pkg rpm_sgx_ra_service_pkg
172+
rpm_pkg: rpm_sgx_dcap_ql_pkg rpm_sgx_dcap_default_qpl_pkg rpm_sgx_dcap_pccs_pkg rpm_sgx_ae_qe3_pkg rpm_sgx_ae_id_enclave_pkg rpm_sgx_ae_qve_pkg rpm_sgx_dcap_quote_verify_pkg rpm_sgx_pce_logic_pkg rpm_sgx_qe3_logic_pkg rpm_sgx_pck_id_retrieval_tool_pkg rpm_sgx_ra_service_pkg
165173
@$(RM) -f ./installer/linux/rpm/*.rpm
166174
cp `find ./installer/linux/rpm/ -name "*.rpm"` ./installer/linux/rpm/
167175
cp `find ../tools/PCKRetrievalTool/installer/rpm/ -name "*.rpm"` ./installer/linux/rpm/
@@ -182,6 +190,7 @@ clean:
182190
./installer/linux/deb/libsgx-dcap-ql/clean.sh
183191
./installer/linux/deb/libsgx-dcap-quote-verify/clean.sh
184192
./installer/linux/deb/libsgx-ae-qe3/clean.sh
193+
./installer/linux/deb/libsgx-ae-id-enclave/clean.sh
185194
./installer/linux/deb/libsgx-ae-qve/clean.sh
186195
./installer/linux/deb/libsgx-pce-logic/clean.sh
187196
./installer/linux/deb/libsgx-qe3-logic/clean.sh
@@ -190,6 +199,7 @@ clean:
190199
../tools/PCKRetrievalTool/installer/deb/sgx-pck-id-retrieval-tool/clean.sh
191200
./installer/linux/rpm/libsgx-dcap-ql/clean.sh
192201
./installer/linux/rpm/libsgx-ae-qe3/clean.sh
202+
./installer/linux/rpm/libsgx-ae-id-enclave/clean.sh
193203
./installer/linux/rpm/libsgx-ae-qve/clean.sh
194204
./installer/linux/rpm/libsgx-dcap-quote-verify/clean.sh
195205
./installer/linux/rpm/libsgx-pce-logic/clean.sh

QuoteGeneration/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ For Windows* OS
3737
**NOTE**:`sgx_dcap_dev.inf` is for Windows* Server 2016 LTSC and `sgx_dcap.inf` is for Windows* Server 2019 LTSC.
3838

3939
## How to install
40-
Refer to the *"Installation Instructions"* section in the [Intel(R) Software Guard Extensions: Data Center Attestation Primitives Installation Guide For Windows* OS](https://download.01.org/intel-sgx/sgx-dcap/1.12.1/windows/docs/Intel_SGX_DCAP_Windows_SW_Installation_Guide.pdf) to install the right packages on your platform.
40+
Refer to the *"Installation Instructions"* section in the [Intel(R) Software Guard Extensions: Data Center Attestation Primitives Installation Guide For Windows* OS](https://download.01.org/intel-sgx/sgx-dcap/1.13/windows/docs/Intel_SGX_DCAP_Windows_SW_Installation_Guide.pdf) to install the right packages on your platform.
4141

4242

4343
For Linux* OS
@@ -136,13 +136,13 @@ A `README.md` is provided in the Intel(R) SGX driver package for Intel(R) SGX DC
136136
- Install prebuilt Intel(R) SGX common loader and other prerequisites from [01.org](https://01.org/intel-software-guard-extensions/downloads)
137137
* On Ubuntu 18.04 and Ubuntu 20.04:
138138
```
139-
$ sudo dpkg -i --force-overwrite libsgx-ae-pce_*.deb libsgx-ae-qe3_*.deb libsgx-ae-qve_*.deb libsgx-enclave-common_*.deb libsgx-urts_*.deb
139+
$ sudo dpkg -i --force-overwrite libsgx-ae-pce_*.deb libsgx-ae-qe3_*.deb libsgx-ae-id-enclave_*.deb libsgx-ae-qve_*.deb libsgx-enclave-common_*.deb libsgx-urts_*.deb
140140
```
141141
**NOTE**: Sometimes we will split old package into smaller ones or move files between different packages. In such cases, you need to add `--force-overwrite` to overwrite existing files. If you're doing a fresh install, you can omit this option.
142142

143143
* On Red Hat Enterprise Linux 8.2 and CentOS 8.2:
144144
```
145-
$ sudo rpm -ivh libsgx-ae-pce*.rpm libsgx-ae-qe3*.rpm libsgx-ae-qve*.rpm libsgx-enclave-common*.rpm libsgx-urts*.rpm
145+
$ sudo rpm -ivh libsgx-ae-pce*.rpm libsgx-ae-qe3*.rpm libsgx-ae-id-enclave*.rpm libsgx-ae-qve*.rpm libsgx-enclave-common*.rpm libsgx-urts*.rpm
146146
```
147147
**NOTE**: If you're not doing a fresh install, please replace option `-i` to `-U` to avoid some conflict errors.
148148

QuoteGeneration/ae/buildenv.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ LDTFLAGS_NO_CRYPTO = -L$(SGX_LIBRARY_PATH) -Wl,--whole-archive $(TRTSLIB) -Wl,--
5858
-Wl,--start-group $(EXTERNAL_LIB_NO_CRYPTO) -Wl,--end-group \
5959
-Wl,--version-script=$(WORK_DIR)/enclave.lds $(ENCLAVE_LDFLAGS)
6060

61-
LDTFLAGS += -fuse-ld=gold -Wl,--rosegment -Wl,-Map=out.map -Wl,--undefined=version -Wl,--gc-sections
62-
LDTFLAGS_NO_CRYPTO += -fuse-ld=gold -Wl,--rosegment -Wl,-Map=out.map -Wl,--undefined=version -Wl,--gc-sections
61+
LDTFLAGS += -Wl,-Map=out.map -Wl,--undefined=version -Wl,--gc-sections
62+
LDTFLAGS_NO_CRYPTO += -Wl,-Map=out.map -Wl,--undefined=version -Wl,--gc-sections
6363

6464

6565
vpath %.cpp $(COMMON_DIR)/src:$(LINUX_PSW_DIR)/ae/common

QuoteGeneration/buildenv.mk

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ INCLUDE :=
9696
# this will return the path to the file that included the buildenv.mk file
9797
CUR_DIR := $(realpath $(call parent-dir,$(lastword $(wordlist 2,$(words $(MAKEFILE_LIST)),x $(MAKEFILE_LIST)))))
9898

99+
CET_FLAGS :=
100+
CC_VERSION := $(shell $(CC) -dumpversion)
101+
CC_NO_LESS_THAN_8 := $(shell expr $(CC_VERSION) \>\= "8")
102+
ifeq ($(CC_NO_LESS_THAN_8), 1)
103+
CET_FLAGS += -fcf-protection
104+
endif
105+
99106
# turn on stack protector for SDK
100107
CC_BELOW_4_9 := $(shell expr "`$(CC) -dumpversion`" \< "4.9")
101108
ifeq ($(CC_BELOW_4_9), 1)
@@ -130,7 +137,7 @@ CFLAGS += -Wjump-misses-init -Wstrict-prototypes -Wunsuffixed-float-constants
130137
# additional warnings flags for C++
131138
CXXFLAGS += -Wnon-virtual-dtor
132139

133-
CXXFLAGS += -std=c++11
140+
CXXFLAGS += -std=c++14
134141

135142
.DEFAULT_GOAL := all
136143
# this turns off the RCS / SCCS implicit rules of GNU Make
@@ -175,6 +182,12 @@ else
175182
COMMON_FLAGS += -DITT_ARCH_IA64
176183
endif
177184

185+
ifneq ($(MITIGATION-CVE-2020-0551), LOAD)
186+
ifneq ($(MITIGATION-CVE-2020-0551), CF)
187+
COMMON_FLAGS += $(CET_FLAGS)
188+
endif
189+
endif
190+
178191
CFLAGS += $(COMMON_FLAGS)
179192
CXXFLAGS += $(COMMON_FLAGS)
180193

@@ -189,7 +202,7 @@ COMMON_LDFLAGS := -Wl,-z,relro,-z,now,-z,noexecstack
189202
# When `pie' is enabled, the linker (both BFD and Gold) under Ubuntu 14.04
190203
# will hide all symbols from dynamic symbol table even if they are marked
191204
# as `global' in the LD version script.
192-
ENCLAVE_CFLAGS = -ffreestanding -nostdinc -fvisibility=hidden -fpie $(MITIGATION_CFLAGS)
205+
ENCLAVE_CFLAGS = -ffreestanding -nostdinc -fvisibility=hidden -fpie -fno-strict-overflow -fno-delete-null-pointer-checks $(MITIGATION_CFLAGS)
193206
ENCLAVE_CXXFLAGS = $(ENCLAVE_CFLAGS) -nostdinc++
194207
ENCLAVE_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
195208
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \

QuoteGeneration/common/inc/internal/se_version.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@
2828
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*
3030
*/
31-
#define STRFILEVER "1.12.101.1"
32-
#define COPYRIGHT "Copyright (C) 2021 Intel Corporation"
33-
#define FILEVER 1,12,101,1
34-
#define PRODUCTVER 1,12,101,1
35-
#define STRPRODUCTVER "1.12.101.1"
31+
#define STRFILEVER "1.13.100.4"
32+
#define COPYRIGHT "Copyright (C) 2022 Intel Corporation"
33+
#define FILEVER 1,13,100,4
34+
#define PRODUCTVER 1,13,100,4
35+
#define STRPRODUCTVER "1.13.100.4"
3636
#define COMPANYNAME "Intel Corporation"
3737
#define PRODUCTNAME "Intel® Software Guard Extensions"
3838

39-
#define DEFAULT_QPL_VERSION "1.11.101.1"
40-
#define QUOTE_VERIFIER_VERSION "1.11.101.1"
41-
#define QUOTE_LOADER_VERSION "1.11.101.1"
39+
#define DEFAULT_QPL_VERSION "1.12.102.0"
40+
#define QUOTE_VERIFIER_VERSION "1.11.102.0"
41+
#define QUOTE_LOADER_VERSION "1.11.102.1"
42+
43+
#define QE3_VERSION "1.11.101.1"
44+
#define QVE_VERSION "1.11.101.1"
45+
#define IDE_VERSION "1.11.101.1"

QuoteGeneration/download_prebuilt.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929

3030
@echo off
3131

32-
set ae_file_name=prebuilt_windows_dcap_1.12.1.zip
33-
set checksum_file=SHA256SUM_prebuilt_windows_dcap_1.12.1.cfg
34-
set server_url_path=https://download.01.org/intel-sgx/sgx-dcap/1.12.1/windows/
32+
set ae_file_name=prebuilt_windows_dcap_1.13.zip
33+
set checksum_file=SHA256SUM_prebuilt_windows_dcap_1.13.cfg
34+
set server_url_path=https://download.01.org//intel-sgx/sgx-dcap/1.13/windows/
3535
set server_ae_url=%server_url_path%/%ae_file_name%
3636
set server_checksum_url=%server_url_path%/%checksum_file%
3737

QuoteGeneration/download_prebuilt.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232

3333
top_dir=`dirname $0`
3434
out_dir=$top_dir
35-
ae_file_name=prebuilt_dcap_1.12.1.tar.gz
36-
checksum_file=SHA256SUM_prebuilt_dcap_1.12.1.cfg
37-
server_url_path=https://download.01.org/intel-sgx/sgx-dcap/1.12.1/linux
35+
ae_file_name=prebuilt_dcap_1.13.tar.gz
36+
checksum_file=SHA256SUM_prebuilt_dcap_1.13.cfg
37+
server_url_path=https://download.01.org/intel-sgx/sgx-dcap/1.13/linux
3838
server_ae_url=$server_url_path/$ae_file_name
3939
server_checksum_url=$server_url_path/$checksum_file
4040

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DeliveryName InstallName FileCheckSum FileFeature FileOwner
2+
<deliverydir>/installer/linux/common/libsgx-ae-id-enclave/installConfig <installdir>/installConfig 0 main STP
3+
<deliverydir>/installer/linux/common/libsgx-ae-id-enclave/Makefile <installdir>/Makefile 0 main STP
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DeliveryName InstallName FileCheckSum FileFeature FileOwner
2+
<deliverydir>/psw/ae/data/prebuilt/libsgx_id_enclave.signed.so <installdir>/lib/libsgx_id_enclave.signed.so 0 main STP
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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 installConfig
33+
34+
USR_LIB_PATH=$(shell readlink -m $(DESTDIR)/usr/$(notdir $(shell gcc -print-multi-os-directory))/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null))
35+
36+
USR_LIB_VER=1.0.0
37+
SPLIT_VERSION=$(word $2,$(subst ., ,$1))
38+
39+
default:
40+
41+
install:
42+
install -d $(USR_LIB_PATH)
43+
install ${LIB_DIR}/* $(USR_LIB_PATH)
44+
cd $(USR_LIB_PATH) && \
45+
mv libsgx_id_enclave.signed.so libsgx_id_enclave.signed.so.$(USR_LIB_VER) && \
46+
ln -fs libsgx_id_enclave.signed.so.$(USR_LIB_VER) libsgx_id_enclave.signed.so.$(call SPLIT_VERSION,$(USR_LIB_VER),1)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (C) 2011-2021 Intel Corporation. All rights reserved.
4+
#
5+
# Redistribution and use in source and binary forms, with or without
6+
# modification, are permitted provided that the following conditions
7+
# are met:
8+
#
9+
# * Redistributions of source code must retain the above copyright
10+
# notice, this list of conditions and the following disclaimer.
11+
# * Redistributions in binary form must reproduce the above copyright
12+
# notice, this list of conditions and the following disclaimer in
13+
# the documentation and/or other materials provided with the
14+
# distribution.
15+
# * Neither the name of Intel Corporation nor the names of its
16+
# contributors may be used to endorse or promote products derived
17+
# from this software without specific prior written permission.
18+
#
19+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
#
31+
#
32+
33+
34+
set -e
35+
36+
SCRIPT_DIR=$(dirname "$0")
37+
ROOT_DIR="${SCRIPT_DIR}/../../../../"
38+
LINUX_INSTALLER_DIR="${ROOT_DIR}/installer/linux"
39+
LINUX_INSTALLER_COMMON_DIR="${LINUX_INSTALLER_DIR}/common"
40+
41+
INSTALL_PATH=${SCRIPT_DIR}/output
42+
43+
# Cleanup
44+
rm -fr ${INSTALL_PATH}
45+
46+
# Get the configuration for this package
47+
source ${SCRIPT_DIR}/installConfig
48+
49+
# Fetch the gen_source script
50+
cp ${LINUX_INSTALLER_COMMON_DIR}/gen_source/gen_source.py ${SCRIPT_DIR}
51+
52+
# Copy the files according to the BOM
53+
python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/libsgx-ae-id-enclave.txt
54+
python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/libsgx-ae-id-enclave-package.txt --cleanup=false
55+
python ${SCRIPT_DIR}/gen_source.py --bom=../licenses/BOM_license.txt --cleanup=false
56+
57+
# Create the tarball
58+
SGX_VERSION=$(awk '/IDE_VERSION/ {print $3}' ${ROOT_DIR}/common/inc/internal/se_version.h|sed 's/^\"\(.*\)\"$/\1/')
59+
pushd ${INSTALL_PATH} &> /dev/null
60+
sed -i "s/USR_LIB_VER=.*/USR_LIB_VER=${SGX_VERSION}/" Makefile
61+
tar -zcvf ${TARBALL_NAME} *
62+
popd &> /dev/null
63+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
AE_ID_ENCLAVE_VERSION="1.0"
2+
TARBALL_NAME=libsgx-ae-id-enclave_1.0.orig.tar.gz
3+
4+
AE_ID_ENCLAVE_PACKAGE_NAME=libsgx-ae-id-enclave
5+
6+
LIB_DIR=lib

QuoteGeneration/installer/linux/common/libsgx-ae-qe3/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,15 @@ include installConfig
3333

3434
USR_LIB_PATH=$(shell readlink -m $(DESTDIR)/usr/$(notdir $(shell gcc -print-multi-os-directory))/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null))
3535

36+
USR_LIB_VER=1.0.0
37+
SPLIT_VERSION=$(word $2,$(subst ., ,$1))
38+
3639
default:
3740

3841
install:
3942
install -d $(USR_LIB_PATH)
4043
install ${LIB_DIR}/* $(USR_LIB_PATH)
44+
cd $(USR_LIB_PATH) && \
45+
mv libsgx_qe3.signed.so libsgx_qe3.signed.so.$(USR_LIB_VER) && \
46+
ln -fs libsgx_qe3.signed.so.$(USR_LIB_VER) libsgx_qe3.signed.so.$(call SPLIT_VERSION,$(USR_LIB_VER),1) && \
47+
ln -fs libsgx_qe3.signed.so.$(call SPLIT_VERSION,$(USR_LIB_VER),1) libsgx_qe3.signed.so

QuoteGeneration/installer/linux/common/libsgx-ae-qe3/createTarball.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/libsgx-ae-qe3-package.txt --clean
5555
python ${SCRIPT_DIR}/gen_source.py --bom=../licenses/BOM_license.txt --cleanup=false
5656

5757
# Create the tarball
58+
SGX_VERSION=$(awk '/QE3_VERSION/ {print $3}' ${ROOT_DIR}/common/inc/internal/se_version.h|sed 's/^\"\(.*\)\"$/\1/')
5859
pushd ${INSTALL_PATH} &> /dev/null
60+
sed -i "s/USR_LIB_VER=.*/USR_LIB_VER=${SGX_VERSION}/" Makefile
5961
tar -zcvf ${TARBALL_NAME} *
6062
popd &> /dev/null

QuoteGeneration/installer/linux/common/libsgx-ae-qve/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,15 @@ include installConfig
3333

3434
USR_LIB_PATH=$(shell readlink -m $(DESTDIR)/usr/$(notdir $(shell gcc -print-multi-os-directory))/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null))
3535

36+
USR_LIB_VER=1.0.0
37+
SPLIT_VERSION=$(word $2,$(subst ., ,$1))
38+
3639
default:
3740

3841
install:
3942
install -d $(USR_LIB_PATH)
4043
install ${LIB_DIR}/* $(USR_LIB_PATH)
44+
cd $(USR_LIB_PATH) && \
45+
mv libsgx_qve.signed.so libsgx_qve.signed.so.$(USR_LIB_VER) && \
46+
ln -fs libsgx_qve.signed.so.$(USR_LIB_VER) libsgx_qve.signed.so.$(call SPLIT_VERSION,$(USR_LIB_VER),1) && \
47+
ln -fs libsgx_qve.signed.so.$(call SPLIT_VERSION,$(USR_LIB_VER),1) libsgx_qve.signed.so

QuoteGeneration/installer/linux/common/libsgx-ae-qve/createTarball.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/libsgx-ae-qve-package.txt --clean
5555
python ${SCRIPT_DIR}/gen_source.py --bom=../licenses/BOM_license.txt --cleanup=false
5656

5757
# Create the tarball
58+
SGX_VERSION=$(awk '/QVE_VERSION/ {print $3}' ${ROOT_DIR}/common/inc/internal/se_version.h|sed 's/^\"\(.*\)\"$/\1/')
5859
pushd ${INSTALL_PATH} &> /dev/null
60+
sed -i "s/USR_LIB_VER=.*/USR_LIB_VER=${SGX_VERSION}/" Makefile
5961
tar -zcvf ${TARBALL_NAME} *
6062
popd &> /dev/null

0 commit comments

Comments
 (0)