Skip to content

Commit

Permalink
Intel(R) SGX DCAP 1.10 Release
Browse files Browse the repository at this point in the history
Upgraded OpenSSL and SgxSSL to latest version 1.1.1i in DCAP components
Added data base migration support in PCCS
Fixed bugs

Signed-off-by: Li, Xun <[email protected]>
  • Loading branch information
llly committed Feb 4, 2021
1 parent 70f54db commit 30fac05
Show file tree
Hide file tree
Showing 147 changed files with 3,601 additions and 1,681 deletions.
2 changes: 1 addition & 1 deletion QuoteGeneration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ For Windows* OS
**NOTE**:`sgx_dcap_dev.inf` is for Windows* Server 2016 LTSC and `sgx_dcap.inf` is for Windows* Server 2019 LTSC.

## How to install
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.9/windows/docs/Intel_SGX_DCAP_Windows_SW_Installation_Guide.pdf) to install the right packages on your platform.
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.10/windows/docs/Intel_SGX_DCAP_Windows_SW_Installation_Guide.pdf) to install the right packages on your platform.


For Linux* OS
Expand Down
59 changes: 44 additions & 15 deletions QuoteGeneration/common/inc/internal/se_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,33 +43,45 @@

typedef enum
{
SE_TRACE_ERROR,
SE_TRACE_WARNING,
SE_TRACE_NOTICE,
SE_TRACE_DEBUG
SE_TRACE_ERROR,
SE_TRACE_WARNING,
SE_TRACE_NOTICE,
SE_TRACE_DEBUG
} se_trace_t;

#ifndef SE_DEBUG_LEVEL
//Each module need define their own SE_DEBUG_LEVEL
/* Each module need define their own SE_DEBUG_LEVEL */
#define SE_DEBUG_LEVEL SE_TRACE_ERROR
#endif

#ifdef __cplusplus
extern "C" {
#endif
int se_trace_internal(int debug_level, const char *fmt, ...);

void se_trace_internal(int debug_level, const char *fmt, ...);
void sgx_proc_log_report_default(int channel, int debug_level, const char* fmt, ...);
#ifdef _WIN32
extern void sgx_proc_log_report(int channel, int level, const char* format, ...);
#if defined (_M_IX86)
#pragma comment(linker, "/alternatename:_sgx_proc_log_report=_sgx_proc_log_report_default")
#elif defined (_M_IA64) || defined (_M_AMD64)
#pragma comment(linker, "/alternatename:sgx_proc_log_report=sgx_proc_log_report_default")
#else
#endif
#else
void __attribute__((weak)) sgx_proc_log_report(int level, const char* format, ...);
#endif
#ifdef __cplusplus
}
#endif

//For libraries, we usually define DISABLE_TRACE to disable any trace.
//For apps, we usually enable trace.

/* For libraries, we usually define DISABLE_TRACE to disable any trace. */
/* For apps, we usually enable trace. */
#ifdef DISABLE_TRACE
#define SE_TRACE(...)
#define se_trace(...)
#define se_trace_verbose(...)
#else //DISABLE_TRACE
#else /* DISABLE_TRACE */
#define se_trace_verbose(debug_level, fmt, ...) \
do { \
se_trace_t trace_level = debug_level; \
Expand All @@ -84,17 +96,34 @@ int se_trace_internal(int debug_level, const char *fmt, ...);
se_trace_internal(trace_level, fmt, ##__VA_ARGS__); \
}while(0)

//For compatibility, SE_TRACE/se_trace is used in old code.
//New code should use SE_TRACE_DEBUG, SE_TRACE_NOTICE, SE_TRACE_WARNING, SE_TRACE_ERROR
/* For compatibility, SE_TRACE/se_trace is used in old code. */
/* New code should use SE_TRACE_DEBUG, SE_TRACE_NOTICE, SE_TRACE_WARNING, SE_TRACE_ERROR */
#define SE_TRACE(debug_level, fmt, ...) \
se_trace_verbose(debug_level, fmt, ##__VA_ARGS__)
#endif//DISABLE_TRACE
se_trace_verbose(debug_level, fmt, ##__VA_ARGS__)
#endif/* DISABLE_TRACE */

//SE_TRACE_DEBUG and SE_TRACE_NOTICE print the debug information plus message.
/* SE_TRACE_DEBUG and SE_TRACE_NOTICE print the debug information plus message. */
#define SE_TRACE_DEBUG(fmt, ...) se_trace_verbose(SE_TRACE_DEBUG, fmt, ##__VA_ARGS__)
#define SE_TRACE_NOTICE(fmt, ...) se_trace_verbose(SE_TRACE_NOTICE, fmt, ##__VA_ARGS__)
//SE_TRACE_WARNING and SE_TRACE_ERROR only print message.
#define SE_TRACE_WARNING(fmt, ...) se_trace(SE_TRACE_WARNING, fmt, ##__VA_ARGS__)
#define SE_TRACE_ERROR(fmt, ...) se_trace(SE_TRACE_ERROR, fmt, ##__VA_ARGS__)

/* SE_PROD_LOG will output message to stdout by default in production mode.
When the executable is running as daemon, it will output to syslog. */
#ifdef _WIN32
#define SE_PROD_LOG(fmt, ...) \
do { \
sgx_proc_log_report(1, 1, "[%s %s:%d] " fmt, __FUNCTION__, __FILE__, __LINE__, ##__VA_ARGS__); \
}while(0)
#else
#define SE_PROD_LOG(fmt, ...) \
do { \
if(sgx_proc_log_report) { \
sgx_proc_log_report(1, "[%s %s:%d] " fmt, __FUNCTION__, __FILE__, __LINE__, ##__VA_ARGS__); \
} else { \
se_trace_internal(SE_TRACE_ERROR, "[%s %s:%d] " fmt, __FUNCTION__, __FILE__, __LINE__, ##__VA_ARGS__); \
} \
}while(0)
#endif
#endif
10 changes: 5 additions & 5 deletions QuoteGeneration/common/inc/internal/se_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#define STRFILEVER "1.9.100.3"
#define COPYRIGHT "Copyright (C) 2020 Intel Corporation"
#define FILEVER 1,9,100,3
#define PRODUCTVER 1,9,100,3
#define STRPRODUCTVER "1.9.100.3"
#define STRFILEVER "1.10.100.4"
#define COPYRIGHT "Copyright (C) 2021 Intel Corporation"
#define FILEVER 1,10,100,4
#define PRODUCTVER 1,10,100,4
#define STRPRODUCTVER "1.10.100.4"
#define COMPANYNAME "Intel Corporation"
#define PRODUCTNAME "Intel® Software Guard Extensions"
35 changes: 25 additions & 10 deletions QuoteGeneration/common/src/se_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,32 @@

#include "se_trace.h"
#include <stdarg.h>
int se_trace_internal(int debug_level, const char *fmt, ...)

void sgx_proc_log_report_default(int channel, int debug_level, const char *fmt, ...)
{
(void)channel;
va_list args;

va_start(args, fmt);
if (SE_TRACE_NOTICE == debug_level)
vfprintf(stdout, fmt, args);
else
vfprintf(stderr, fmt, args);
va_end(args);

return;
}

void se_trace_internal(int debug_level, const char *fmt, ...)
{
va_list args;
int ret = 0;
va_list args;

va_start(args, fmt);
if(SE_TRACE_NOTICE == debug_level)
ret = vfprintf(stdout, fmt, args);
else
ret = vfprintf(stderr, fmt, args);
va_end(args);
va_start(args, fmt);
if (SE_TRACE_NOTICE == debug_level)
vfprintf(stdout, fmt, args);
else
vfprintf(stderr, fmt, args);
va_end(args);

return ret;
return;
}
6 changes: 3 additions & 3 deletions QuoteGeneration/download_prebuilt.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

@echo off

set ae_file_name=prebuilt_windows_dcap_1.9.zip
set checksum_file=SHA256SUM_prebuilt_windows_dcap_1.9.cfg
set server_url_path=https://download.01.org/intel-sgx/sgx-dcap/1.9/windows/
set ae_file_name=prebuilt_windows_dcap_1.10.zip
set checksum_file=SHA256SUM_prebuilt_windows_dcap_1.10.cfg
set server_url_path=https://download.01.org/intel-sgx/sgx-dcap/1.10/windows/
set server_ae_url=%server_url_path%/%ae_file_name%
set server_checksum_url=%server_url_path%/%checksum_file%

Expand Down
6 changes: 3 additions & 3 deletions QuoteGeneration/download_prebuilt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

top_dir=`dirname $0`
out_dir=$top_dir
ae_file_name=prebuilt_dcap_1.9.tar.gz
checksum_file=SHA256SUM_prebuilt_dcap_1.9.cfg
server_url_path=https://download.01.org/intel-sgx/sgx-dcap/1.9/linux
ae_file_name=prebuilt_dcap_1.10.tar.gz
checksum_file=SHA256SUM_prebuilt_dcap_1.10.cfg
server_url_path=https://download.01.org/intel-sgx/sgx-dcap/1.10/linux
server_ae_url=$server_url_path/$ae_file_name
server_checksum_url=$server_url_path/$checksum_file

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner
<deliverydir>/pccs/lib_wrapper/pcklib_wrapper.js <installdir>/lib_wrapper/pcklib_wrapper.js 0 main STP
<deliverydir>/pccs/middleware/auth.js <installdir>/middleware/auth.js 0 main STP
<deliverydir>/pccs/middleware/error.js <installdir>/middleware/error.js 0 main STP
<deliverydir>/pccs/middleware/addRequestId.js <installdir>/middleware/addRequestId.js 0 main STP
<deliverydir>/pccs/migrations/00_db_initialize.up.sql <installdir>/migrations/00_db_initialize.up.sql 0 main STP
<deliverydir>/pccs/migrations/01_db_version_1.js <installdir>/migrations/01_db_version_1.js 0 main STP
<deliverydir>/pccs/pcs_client/pcs_client.js <installdir>/pcs_client/pcs_client.js 0 main STP
<deliverydir>/pccs/routes/index.js <installdir>/routes/index.js 0 main STP
<deliverydir>/pccs/services/identityService.js <installdir>/services/identityService.js 0 main STP
Expand All @@ -51,6 +54,10 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner
<deliverydir>/pccs/services/refreshService.js <installdir>/services/refreshService.js 0 main STP
<deliverydir>/pccs/services/rootcacrlService.js <installdir>/services/rootcacrlService.js 0 main STP
<deliverydir>/pccs/services/tcbinfoService.js <installdir>/services/tcbinfoService.js 0 main STP
<deliverydir>/pccs/services/caching_modes/cachingMode.js <installdir>/services/caching_modes/cachingMode.js 0 main STP
<deliverydir>/pccs/services/caching_modes/cachingModeManager.js <installdir>/services/caching_modes/cachingModeManager.js 0 main STP
<deliverydir>/pccs/services/logic/commonCacheLogic.js <installdir>/services/logic/commonCacheLogic.js 0 main STP
<deliverydir>/pccs/services/logic/qvCollateralLogic.js <installdir>/services/logic/qvCollateralLogic.js 0 main STP
<deliverydir>/pccs/utils/Logger.js <installdir>/utils/Logger.js 0 main STP
<deliverydir>/pccs/utils/PccsError.js <installdir>/utils/PccsError.js 0 main STP
<deliverydir>/pccs/utils/apputil.js <installdir>/utils/apputil.js 0 main STP
Expand All @@ -61,7 +68,3 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner
<deliverydir>/pccs/pccs_server.js <installdir>/pccs_server.js 0 main STP
<deliverydir>/pccs/pccs.service <installdir>/pccs.service 0 main STP
<deliverydir>/pccs/README.md <installdir>/README.md 0 main STP
<deliverydir>/installer/linux/common/sgx-dcap-pccs/installConfig <installdir>/installConfig 0 main STP
<deliverydir>/installer/linux/common/sgx-dcap-pccs/Makefile <installdir>/Makefile 0 main STP


Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ Description: Intel(R) Software Guard Extensions Data Center Attestation Primitiv
Package: libsgx-dcap-ql-dev
Section: devel
Architecture: amd64
Depends: libsgx-dcap-ql (= @dep_version@), libsgx-headers (>= 2.12)
Depends: libsgx-dcap-ql (= @dep_version@), libsgx-headers (>= 2.13)
Description: Intel(R) Software Guard Extensions Data Center Attestation Primitives For Developers
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ Description: Intel(R) Software Guard Extensions Data Center Attestation Primitiv
Package: libsgx-dcap-quote-verify-dev
Section: devel
Architecture: amd64
Depends: libsgx-dcap-quote-verify (= @dep_version@), libsgx-headers (>= 2.12)
Depends: libsgx-dcap-quote-verify (= @dep_version@), libsgx-headers (>= 2.13)
Description: Intel(R) Software Guard Extensions Data Center Attestation Primitives For Developers
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Homepage: https://github.com/intel/SGXDataCenterAttestationPrimitives

Package: libsgx-pce-logic
Architecture: amd64
Depends: libsgx-urts (>= 2.12), libsgx-ae-pce(>= 2.12), ${shlibs:Depends}, ${misc:Depends}
Depends: libsgx-urts (>= 2.13), libsgx-ae-pce(>= 2.13), ${shlibs:Depends}, ${misc:Depends}
Description: Intel(R) Software Guard Extensions Data Center Attestation Primitives
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Homepage: https://github.com/intel/SGXDataCenterAttestationPrimitives

Package: libsgx-qe3-logic
Architecture: amd64
Depends: libsgx-urts (>= 2.12), libsgx-ae-qe3(>= @dep_version@), ${shlibs:Depends}, ${misc:Depends}
Depends: libsgx-urts (>= 2.13), libsgx-ae-qe3(>= @dep_version@), ${shlibs:Depends}, ${misc:Depends}
Description: Intel(R) Software Guard Extensions Data Center Attestation Primitives
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ case "$1" in
configure)
PCCS_USER=pccs
PCCS_HOME=/opt/intel/sgx-dcap-pccs
adduser --quiet --system $PCCS_USER --group --home $PCCS_HOME --no-create-home --shell /bin/bash
if ! id "$PCCS_USER" &>/dev/null; then
adduser --quiet --system $PCCS_USER --group --home $PCCS_HOME --no-create-home --shell /bin/bash
fi
chown -R $PCCS_USER:$PCCS_USER $PCCS_HOME
if [ "${DEBIAN_FRONTEND}" != "noninteractive" ]
then
Expand All @@ -43,6 +45,7 @@ case "$1" in
chmod 0644 $PCCS_DEST
systemctl daemon-reload
systemctl enable pccs
systemctl start pccs
elif [ -d /etc/init/ ]; then
PCCS_NAME=pccs.service
PCCS_TEMP=$PCCS_HOME/$PCCS_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Intel(R) Software Guard Extensions Data Center Attestation Primitives
%package devel
Summary: Intel(R) Software Guard Extensions Data Center Attestation Primitives for Developers
Group: Development/Libraries
Requires: %{name} = %{version}-%{release} libsgx-headers >= 2.12
Requires: %{name} = %{version}-%{release} libsgx-headers >= 2.13

%description devel
Intel(R) Software Guard Extensions Data Center Attestation Primitives for Developers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Intel(R) Software Guard Extensions Data Center Attestation Primitives
%package devel
Summary: Intel(R) Software Guard Extensions Data Center Attestation Primitives for Developers
Group: Development/Libraries
Requires: %{name} = %{version}-%{release} libsgx-headers >= 2.12
Requires: %{name} = %{version}-%{release} libsgx-headers >= 2.13

%description devel
Intel(R) Software Guard Extensions Data Center Attestation Primitives for Developers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Version: @version@
Release: 1%{?dist}
Summary: Intel(R) Software Guard Extensions PCE logic
Group: Development/Libraries
Requires: libsgx-urts >= 2.12 libsgx-ae-pce >= 2.12
Requires: libsgx-urts >= 2.13 libsgx-ae-pce >= 2.13

License: BSD License
URL: https://github.com/intel/SGXDataCenterAttestationPrimitives
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Version: @version@
Release: 1%{?dist}
Summary: Intel(R) Software Guard Extensions QE3 logic
Group: Development/Libraries
Requires: libsgx-urts >= 2.12 libsgx-ae-qe3 >= %{version}-%{release}
Requires: libsgx-urts >= 2.13 libsgx-ae-qe3 >= %{version}-%{release}

License: BSD License
URL: https://github.com/intel/SGXDataCenterAttestationPrimitives
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ PCCS_HOME=%{_install_path}
if [ ! $(getent group $PCCS_USER) ]; then
groupadd $PCCS_USER
fi
adduser --system $PCCS_USER -g $PCCS_USER --home $PCCS_HOME --no-create-home --shell /bin/bash
chown -R $PCCS_USER:$PCCS_USER $PCCS_HOME
if ! id "$PCCS_USER" &>/dev/null; then
adduser --system $PCCS_USER -g $PCCS_USER --home $PCCS_HOME --no-create-home --shell /bin/bash
chown -R $PCCS_USER:$PCCS_USER $PCCS_HOME
fi
#Install PCCS as system service
echo -n "Installing PCCS service ..."
if [ -d /run/systemd/system ]; then
Expand Down Expand Up @@ -97,30 +99,32 @@ echo "finished."
echo "Installation completed successfully."

%postun
echo -n "Uninstalling PCCS service ..."
if [ -d /run/systemd/system ]; then
PCCS_NAME=pccs.service
if [ -d /lib/systemd/system ]; then
PCCS_DEST=/lib/systemd/system/$PCCS_NAME
else
PCCS_DEST=/usr/lib/systemd/system/$PCCS_NAME
if [ $1 == 0 ]; then
echo -n "Uninstalling PCCS service ..."
if [ -d /run/systemd/system ]; then
PCCS_NAME=pccs.service
if [ -d /lib/systemd/system ]; then
PCCS_DEST=/lib/systemd/system/$PCCS_NAME
else
PCCS_DEST=/usr/lib/systemd/system/$PCCS_NAME
fi
systemctl stop pccs || true
systemctl disable pccs || true
rm $PCCS_DEST || true
systemctl daemon-reload
elif [ -d /etc/init/ ]; then
PCCS_NAME=pccs.service
PCCS_DEST=/etc/init/$PCCS_NAME
rm $PCCS_DEST || true
/sbin/initctl reload-configuration
fi
systemctl stop pccs || true
systemctl disable pccs || true
rm $PCCS_DEST || true
systemctl daemon-reload
elif [ -d /etc/init/ ]; then
PCCS_NAME=pccs.service
PCCS_DEST=/etc/init/$PCCS_NAME
rm $PCCS_DEST || true
/sbin/initctl reload-configuration
fi
echo "finished."
echo "finished."

if [ -d %{_install_path} ]; then
pushd %{_install_path} &> /dev/null
rm -rf node_modules || true
popd &> /dev/null
if [ -d %{_install_path} ]; then
pushd %{_install_path} &> /dev/null
rm -rf node_modules || true
popd &> /dev/null
fi
fi

%changelog
Expand Down
2 changes: 1 addition & 1 deletion QuoteGeneration/installer/win/DCAP_Components.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set QGFOLDER="..\..\"
set QVFOLDER="%TOPFOLDER%\QuoteVerification"
set DEBUGFILEFOLDER="..\..\..\x64\Debug\"
set RELEASEFILEFOLDER="..\..\..\x64\Release\"
set PACKAGETNAME=DCAP_Components.1.9.100.1
set PACKAGETNAME=DCAP_Components.1.10.100.0
set pwd=%~dp0DCAP_Components

pushd "%~dp0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>DCAP_Components</id>
<version>1.9.100.1</version>
<version>1.10.100.0</version>
<title>DCAP Components</title>
<authors>Intel(R) SGX</authors>
<owners>Intel</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>DCAP Components</description>
<dependencies>
<dependency id="SgxHeaders" version="2.11.100.3" />
<dependency id="SgxHeaders" version="2.12.100.4" />
</dependencies>
</metadata>
<files>
Expand Down
Loading

0 comments on commit 30fac05

Please sign in to comment.