This is an automated email from the ASF dual-hosted git repository.
rduan pushed a commit to branch v1.1.4-testing
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-sgx-sdk.git
The following commit(s) were added to refs/heads/v1.1.4-testing by this push:
new e3eea80 Support intel sgx sdk 2.15 and dcap 1.12
e3eea80 is described below
commit e3eea80beb0c91eb29dfd11a0c9d60cb3293490f
Author: volcano <[email protected]>
AuthorDate: Thu Oct 14 18:34:38 2021 +0800
Support intel sgx sdk 2.15 and dcap 1.12
---
buildenv.mk | 2 +-
common/inc/ctype.h | 1 +
common/inc/wchar.h | 4 ++
common/inc/wctype.h | 39 +++++------
dockerfile/02_binutils.sh | 10 +--
dockerfile/03_sdk.sh | 4 +-
dockerfile/04_psw_deb.sh | 11 ---
dockerfile/Dockerfile.1604.nightly | 50 --------------
dockerfile/Dockerfile.1804.nightly | 6 +-
dockerfile/Dockerfile.2004.nightly | 6 +-
dockerfile/Dockerfile.centos8.nightly | 4 +-
dockerfile/Dockerfile.fedora31.nightly | 40 -----------
dockerfile/build.sh | 12 +---
dockerfile/push.sh | 12 +---
sgx_edl/common/inc/ctype.h | 1 +
sgx_edl/common/inc/wchar.h | 4 ++
sgx_edl/common/inc/wctype.h | 39 +++++------
sgx_tcrypto/src/crypto.rs | 119 +++++++++++++++++++++++++++++++++
sgx_types/src/function.rs | 7 ++
sgx_ucrypto/src/crypto.rs | 119 +++++++++++++++++++++++++++++++++
20 files changed, 313 insertions(+), 177 deletions(-)
diff --git a/buildenv.mk b/buildenv.mk
index 2df01b4..c834988 100644
--- a/buildenv.mk
+++ b/buildenv.mk
@@ -85,7 +85,7 @@ CFLAGS += -Wjump-misses-init -Wstrict-prototypes
-Wunsuffixed-float-constants
CXXFLAGS += -Wnon-virtual-dtor
# for static_assert()
-CXXFLAGS += -std=c++0x
+CXXFLAGS += -std=c++14
.DEFAULT_GOAL := all
# this turns off the RCS / SCCS implicit rules of GNU Make
diff --git a/common/inc/ctype.h b/common/inc/ctype.h
index 4449d74..57ac70f 100644
--- a/common/inc/ctype.h
+++ b/common/inc/ctype.h
@@ -58,6 +58,7 @@ int _TLIBC_CDECL_ isxdigit(int);
int _TLIBC_CDECL_ tolower(int);
int _TLIBC_CDECL_ toupper(int);
int _TLIBC_CDECL_ isblank(int);
+int _TLIBC_CDECL_ isascii(int);
__END_DECLS
diff --git a/common/inc/wchar.h b/common/inc/wchar.h
index 5982aef..2db86f2 100644
--- a/common/inc/wchar.h
+++ b/common/inc/wchar.h
@@ -131,6 +131,10 @@ wchar_t * _TLIBC_CDECL_ wmemset(wchar_t *, wchar_t,
size_t);
int _TLIBC_CDECL_ swprintf(wchar_t *, size_t, const wchar_t *, ...);
int _TLIBC_CDECL_ vswprintf(wchar_t *, size_t, const wchar_t *,
__va_list);
+long double _TLIBC_CDECL_ wcstold (const wchar_t *, wchar_t **);
+long long _TLIBC_CDECL_ wcstoll (const wchar_t *, wchar_t **, int);
+unsigned long long _TLIBC_CDECL_ wcstoull (const wchar_t *, wchar_t **, int);
+
/* leagcy version of wcsstr */
wchar_t * _TLIBC_CDECL_ wcswcs(const wchar_t *, const wchar_t *);
diff --git a/common/inc/wctype.h b/common/inc/wctype.h
index fb421af..0ab9497 100644
--- a/common/inc/wctype.h
+++ b/common/inc/wctype.h
@@ -56,27 +56,24 @@ typedef __wctype_t wctype_t;
__BEGIN_DECLS
-/*
- * Deprecated definitions.
- */
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswalnum, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswalpha, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswblank, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswcntrl, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswdigit, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswgraph, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswlower, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswprint, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswpunct, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswspace, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswupper, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswxdigit, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswctype, wint_t,
wctype_t);
-_TLIBC_DEPRECATED_FUNCTION_(wint_t _TLIBC_CDECL_, towctrans, wint_t,
wctrans_t);
-_TLIBC_DEPRECATED_FUNCTION_(wint_t _TLIBC_CDECL_, towlower, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(wint_t _TLIBC_CDECL_, towupper, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(wctrans_t _TLIBC_CDECL_, wctrans, const char *);
-_TLIBC_DEPRECATED_FUNCTION_(wctype_t _TLIBC_CDECL_, wctype, const char *);
+int _TLIBC_CDECL_ iswalnum(wint_t);
+int _TLIBC_CDECL_ iswalpha(wint_t);
+int _TLIBC_CDECL_ iswblank(wint_t);
+int _TLIBC_CDECL_ iswcntrl(wint_t);
+int _TLIBC_CDECL_ iswdigit(wint_t);
+int _TLIBC_CDECL_ iswgraph(wint_t);
+int _TLIBC_CDECL_ iswlower(wint_t);
+int _TLIBC_CDECL_ iswprint(wint_t);
+int _TLIBC_CDECL_ iswpunct(wint_t);
+int _TLIBC_CDECL_ iswspace(wint_t);
+int _TLIBC_CDECL_ iswupper(wint_t);
+int _TLIBC_CDECL_ iswxdigit(wint_t);
+int _TLIBC_CDECL_ iswctype(wint_t, wctype_t);
+wint_t _TLIBC_CDECL_ towctrans(wint_t, wctrans_t);
+wint_t _TLIBC_CDECL_ towlower(wint_t);
+wint_t _TLIBC_CDECL_ towupper(wint_t);
+wctrans_t _TLIBC_CDECL_ wctrans(const char *);
+wctype_t _TLIBC_CDECL_ wctype(const char *);
__END_DECLS
diff --git a/dockerfile/02_binutils.sh b/dockerfile/02_binutils.sh
index eff4ffa..1e96cbf 100644
--- a/dockerfile/02_binutils.sh
+++ b/dockerfile/02_binutils.sh
@@ -1,14 +1,14 @@
if [ $BINUTILS_DIST != "SELF_BUILT" ]
then
cd /root && \
- wget
https://download.01.org/intel-sgx/sgx-linux/2.14/as.ld.objdump.gold.r3.tar.gz
&& \
- tar xzf as.ld.objdump.gold.r3.tar.gz && \
+ wget
https://download.01.org/intel-sgx/sgx-linux/2.15/as.ld.objdump.r4.tar.gz && \
+ tar xzf as.ld.objdump.r4.tar.gz && \
cp -r external/toolset/$BINUTILS_DIST/* /usr/bin/ && \
- rm -rf ./external ./as.ld.objdump.gold.r3.tar.gz
+ rm -rf ./external ./as.ld.objdump.r4.tar.gz
else
- curl -o binutils.tar.xz
https://ftp.gnu.org/gnu/binutils/binutils-2.35.tar.xz && \
+ curl -o binutils.tar.xz
https://ftp.gnu.org/gnu/binutils/binutils-2.36.1.tar.xz && \
tar xf binutils.tar.xz && \
- cd binutils-2.35 && \
+ cd binutils-2.36.1 && \
mkdir build && \
cd build && \
../configure --prefix=/usr/local --enable-gold --enable-ld=default
--enable-plugins --enable-shared --disable-werror --enable-64-bit-bfd
--with-system-zlib && \
diff --git a/dockerfile/03_sdk.sh b/dockerfile/03_sdk.sh
index 6df5d41..498ffb4 100644
--- a/dockerfile/03_sdk.sh
+++ b/dockerfile/03_sdk.sh
@@ -10,10 +10,10 @@ else
cd /root && \
git clone --recursive https://github.com/intel/linux-sgx && \
cd linux-sgx && \
- git checkout sgx_2.14 && \
+ git checkout sgx_2.15 && \
./download_prebuilt.sh && \
make -j "$(nproc)" sdk_install_pkg && \
- echo -e 'no\n/opt' |
./linux/installer/bin/sgx_linux_x64_sdk_2.14.100.2.bin && \
+ echo -e 'no\n/opt' |
./linux/installer/bin/sgx_linux_x64_sdk_2.15.100.3.bin && \
echo 'source /opt/sgxsdk/environment' >> /root/.bashrc && \
cd /root && \
rm -rf /root/linux-sgx
diff --git a/dockerfile/04_psw_deb.sh b/dockerfile/04_psw_deb.sh
deleted file mode 100644
index 5eae363..0000000
--- a/dockerfile/04_psw_deb.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-source /opt/sgxsdk/environment && \
-cd /root && \
-git clone --recursive https://github.com/intel/linux-sgx && \
-cd linux-sgx && \
-git checkout sgx_2.14 && \
-./download_prebuilt.sh && \
-make deb_local_repo && \
-cd linux/installer/deb && \
-find . -maxdepth 2 -name '*.deb' | grep -v pccs | grep -v sgx-ra-service |
xargs dpkg -i && \
-mkdir /var/run/aesmd && \
-cd /root && rm -rf /root/linux-sgx
diff --git a/dockerfile/Dockerfile.1604.nightly
b/dockerfile/Dockerfile.1604.nightly
deleted file mode 100644
index 167a47f..0000000
--- a/dockerfile/Dockerfile.1604.nightly
+++ /dev/null
@@ -1,50 +0,0 @@
-FROM ubuntu:16.04
-
-RUN apt-get update && apt-get install -y autoconf automake bison
build-essential ca-certificates cmake curl dpkg-dev expect flex gdb git
git-core gnupg kmod libboost-system-dev libboost-thread-dev
libcurl4-openssl-dev libiptcdata0-dev libjsoncpp-dev liblog4cpp5-dev
libprotobuf-c0-dev libprotobuf-dev libssl-dev libtool libxml2-dev ocaml
pkg-config protobuf-compiler python texinfo uuid-dev vim wget zlib1g-dev dkms
gnupg2 apt-transport-https software-properties-common && \
- rm -rf /var/lib/apt/lists/*
-
-# Conditionally trust ppa:ubuntu-toolchain-r
-# Use this on your own risk
-RUN apt-get update && \
- apt-get install build-essential software-properties-common -y && \
- add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
- apt-get update && \
- apt-get install gcc-snapshot -y && \
- apt-get update && \
- apt-get install gcc-8 g++-8 -y && \
- update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 --slave
/usr/bin/g++ g++ /usr/bin/g++-8 && \
- update-alternatives --config gcc && \
- rm -rf /var/lib/apt/lists/*
-
-#ENV BINUTILS_DIST="ubuntu16.04"
-ENV BINUTILS_DIST="SELF_BUILT"
-ENV LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
-ENV LD_RUN_PATH=/usr/lib:/usr/local/lib
-
-ADD 02_binutils.sh /root
-RUN bash /root/02_binutils.sh
-
-ENV SDK_DIST="SELF_BUILT"
-ADD 03_sdk.sh /root
-RUN bash /root/03_sdk.sh
-
-# Sixth, PSW
-
-ENV CODENAME xenial
-ENV VERSION 2.14.100.2-xenial1
-ENV DCAP_VERSION 1.11.100.2-xenial1
-
-ADD 04_psw.sh /root
-RUN bash /root/04_psw.sh
-
-# Seventh, Rust
-
-ENV rust_toolchain nightly-2021-09-13
-ADD 05_rust.sh /root
-RUN bash /root/05_rust.sh
-
-ENV rust_toolchain=
-ENV CODENAME=
-ENV VERSION=
-
-WORKDIR /root
diff --git a/dockerfile/Dockerfile.1804.nightly
b/dockerfile/Dockerfile.1804.nightly
index a04bca1..835918c 100644
--- a/dockerfile/Dockerfile.1804.nightly
+++ b/dockerfile/Dockerfile.1804.nightly
@@ -15,7 +15,7 @@ ADD 02_binutils.sh /root
RUN bash /root/02_binutils.sh
ENV SDK_DIST="INTEL_BUILT"
-ENV
SDK_URL="https://download.01.org/intel-sgx/sgx-linux/2.14/distro/ubuntu18.04-server/sgx_linux_x64_sdk_2.14.100.2.bin"
+ENV
SDK_URL="https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu18.04-server/sgx_linux_x64_sdk_2.15.100.3.bin"
#ENV SDK_DIST="SELF_BUILT"
ADD 03_sdk.sh /root
RUN bash /root/03_sdk.sh
@@ -23,8 +23,8 @@ RUN bash /root/03_sdk.sh
# Sixth, PSW
ENV CODENAME bionic
-ENV VERSION 2.14.100.2-bionic1
-ENV DCAP_VERSION 1.11.100.2-bionic1
+ENV VERSION 2.15.100.3-bionic1
+ENV DCAP_VERSION 1.12.100.3-bionic1
ADD 04_psw.sh /root
RUN bash /root/04_psw.sh
diff --git a/dockerfile/Dockerfile.2004.nightly
b/dockerfile/Dockerfile.2004.nightly
index 8776a50..c8c48d9 100644
--- a/dockerfile/Dockerfile.2004.nightly
+++ b/dockerfile/Dockerfile.2004.nightly
@@ -19,15 +19,15 @@ RUN bash /root/02_binutils.sh
#ENV SDK_DIST="SELF_BUILT"
ENV SDK_DIST="INTEL_BUILT"
-ENV
SDK_URL="https://download.01.org/intel-sgx/sgx-linux/2.14/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.14.100.2.bin"
+ENV
SDK_URL="https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.15.100.3.bin"
ADD 03_sdk.sh /root
RUN bash /root/03_sdk.sh
# Sixth, PSW
ENV CODENAME focal
-ENV VERSION 2.14.100.2-focal1
-ENV DCAP_VERSION 1.11.100.2-focal1
+ENV VERSION 2.15.100.3-focal1
+ENV DCAP_VERSION 1.12.100.3-focal1
ADD 04_psw.sh /root
RUN bash /root/04_psw.sh
diff --git a/dockerfile/Dockerfile.centos8.nightly
b/dockerfile/Dockerfile.centos8.nightly
index 6ad9b7e..92481e1 100644
--- a/dockerfile/Dockerfile.centos8.nightly
+++ b/dockerfile/Dockerfile.centos8.nightly
@@ -13,12 +13,12 @@ ADD 02_binutils.sh /root
RUN bash /root/02_binutils.sh
ENV SDK_DIST="INTEL_BUILT"
-ENV
SDK_URL="https://download.01.org/intel-sgx/sgx-linux/2.14/distro/centos8.2-server/sgx_linux_x64_sdk_2.14.100.2.bin"
+ENV
SDK_URL="https://download.01.org/intel-sgx/sgx-linux/2.15/distro/centos8.2-server/sgx_linux_x64_sdk_2.15.100.3.bin"
#ENV SDK_DIST="SELF_BUILT"
ADD 03_sdk.sh /root
RUN bash /root/03_sdk.sh
-ENV
PSW_REPO="https://download.01.org/intel-sgx/sgx-linux/2.14/distro/centos8.2-server/sgx_rpm_local_repo.tgz"
+ENV
PSW_REPO="https://download.01.org/intel-sgx/sgx-linux/2.15/distro/centos8.2-server/sgx_rpm_local_repo.tgz"
ADD 04_psw_rpm.sh /root
RUN bash /root/04_psw_rpm.sh
diff --git a/dockerfile/Dockerfile.fedora31.nightly
b/dockerfile/Dockerfile.fedora31.nightly
deleted file mode 100644
index 1d58f1d..0000000
--- a/dockerfile/Dockerfile.fedora31.nightly
+++ /dev/null
@@ -1,40 +0,0 @@
-FROM fedora:31
-
-RUN yum install -y yum-utils bzip2 ocaml ocaml-ocamlbuild wget python2
openssl-devel git protobuf-devel ncurses-devel libtool automake
redhat-rpm-config rpm-build cmake perl which && \
- yum-builddep gcc binutils -y && \
- yum groupinstall -y 'C Development Tools and Libraries'
-
-# Fedora31 has gcc-9.3. No need to update.
-#ADD 01_gcc_8.sh /root
-#RUN bash /root/01_gcc_8.sh
-
-ENV BINUTILS_DIST="fedora31"
-#ENV BINUTILS_DIST="SELF_BUILT"
-
-ADD 02_binutils.sh /root
-RUN bash /root/02_binutils.sh
-
-ENV SDK_DIST="INTEL_BUILT"
-ENV
SDK_URL="https://download.01.org/intel-sgx/sgx-linux/2.14/distro/fedora31-server/sgx_linux_x64_sdk_2.14.100.2.bin"
-#ENV SDK_DIST="SELF_BUILT"
-ADD 03_sdk.sh /root
-RUN bash /root/03_sdk.sh
-
-# Sixth, PSW
-
-ENV
PSW_REPO="https://download.01.org/intel-sgx/sgx-linux/2.14/distro/fedora31-server/sgx_rpm_local_repo.tgz"
-ADD 04_psw_rpm.sh /root
-RUN bash /root/04_psw_rpm.sh
-
-# Seventh, Rust
-
-ENV rust_toolchain nightly-2021-09-13
-ADD 05_rust.sh /root
-RUN bash /root/05_rust.sh
-
-ENV rust_toolchain=
-ENV CODENAME=
-ENV VERSION=
-ENV PSW_REPO=
-
-WORKDIR /root
diff --git a/dockerfile/build.sh b/dockerfile/build.sh
index e8629f0..6360163 100755
--- a/dockerfile/build.sh
+++ b/dockerfile/build.sh
@@ -2,24 +2,18 @@
set -e
-DOCKERFILE_1604_NIGHTLY=Dockerfile.1604.nightly
DOCKERFILE_1804_NIGHTLY=Dockerfile.1804.nightly
DOCKERFILE_2004_NIGHTLY=Dockerfile.2004.nightly
DOCKERFILE_centos8_NIGHTLY=Dockerfile.centos8.nightly
-DOCKERFILE_fedora31_NIGHTLY=Dockerfile.fedora31.nightly
-IMAGE_1604_NIGHTLY=baiduxlab/sgx-rust:1604-1.1.3
-IMAGE_1804_NIGHTLY=baiduxlab/sgx-rust:1804-1.1.3
-IMAGE_2004_NIGHTLY=baiduxlab/sgx-rust:2004-1.1.3
-IMAGE_centos8_NIGHTLY=baiduxlab/sgx-rust:centos8-1.1.3
-IMAGE_fedora31_NIGHTLY=baiduxlab/sgx-rust:fedora31-1.1.3
+IMAGE_1804_NIGHTLY=baiduxlab/sgx-rust:1804-1.1.4
+IMAGE_2004_NIGHTLY=baiduxlab/sgx-rust:2004-1.1.4
+IMAGE_centos8_NIGHTLY=baiduxlab/sgx-rust:centos8-1.1.4
build_one() {
docker build --no-cache -t $1 -f $2 .
}
-build_one ${IMAGE_1604_NIGHTLY} ${DOCKERFILE_1604_NIGHTLY}
build_one ${IMAGE_1804_NIGHTLY} ${DOCKERFILE_1804_NIGHTLY}
build_one ${IMAGE_2004_NIGHTLY} ${DOCKERFILE_2004_NIGHTLY}
build_one ${IMAGE_centos8_NIGHTLY} ${DOCKERFILE_centos8_NIGHTLY}
-build_one ${IMAGE_fedora31_NIGHTLY} ${DOCKERFILE_fedora31_NIGHTLY}
diff --git a/dockerfile/push.sh b/dockerfile/push.sh
index d6a8b21..e108466 100755
--- a/dockerfile/push.sh
+++ b/dockerfile/push.sh
@@ -2,27 +2,21 @@
set -e
-DOCKERFILE_1604_NIGHTLY=Dockerfile.1604.nightly
DOCKERFILE_1804_NIGHTLY=Dockerfile.1804.nightly
DOCKERFILE_2004_NIGHTLY=Dockerfile.2004.nightly
DOCKERFILE_centos8_NIGHTLY=Dockerfile.centos8.nightly
-DOCKERFILE_fedora31_NIGHTLY=Dockerfile.fedora31.nightly
-IMAGE_1604_NIGHTLY=baiduxlab/sgx-rust:1604-1.1.3
-IMAGE_1804_NIGHTLY=baiduxlab/sgx-rust:1804-1.1.3
-IMAGE_2004_NIGHTLY=baiduxlab/sgx-rust:2004-1.1.3
-IMAGE_centos8_NIGHTLY=baiduxlab/sgx-rust:centos8-1.1.3
-IMAGE_fedora31_NIGHTLY=baiduxlab/sgx-rust:fedora31-1.1.3
+IMAGE_1804_NIGHTLY=baiduxlab/sgx-rust:1804-1.1.4
+IMAGE_2004_NIGHTLY=baiduxlab/sgx-rust:2004-1.1.4
+IMAGE_centos8_NIGHTLY=baiduxlab/sgx-rust:centos8-1.1.4
push_one() {
docker push $1
}
-push_one ${IMAGE_1604_NIGHTLY}
push_one ${IMAGE_1804_NIGHTLY}
push_one ${IMAGE_2004_NIGHTLY}
push_one ${IMAGE_centos8_NIGHTLY}
-push_one ${IMAGE_fedora31_NIGHTLY}
docker tag ${IMAGE_1804_NIGHTLY} baiduxlab/sgx-rust:latest
push_one baiduxlab/sgx-rust:latest
diff --git a/sgx_edl/common/inc/ctype.h b/sgx_edl/common/inc/ctype.h
index 4449d74..57ac70f 100644
--- a/sgx_edl/common/inc/ctype.h
+++ b/sgx_edl/common/inc/ctype.h
@@ -58,6 +58,7 @@ int _TLIBC_CDECL_ isxdigit(int);
int _TLIBC_CDECL_ tolower(int);
int _TLIBC_CDECL_ toupper(int);
int _TLIBC_CDECL_ isblank(int);
+int _TLIBC_CDECL_ isascii(int);
__END_DECLS
diff --git a/sgx_edl/common/inc/wchar.h b/sgx_edl/common/inc/wchar.h
index 5982aef..2db86f2 100644
--- a/sgx_edl/common/inc/wchar.h
+++ b/sgx_edl/common/inc/wchar.h
@@ -131,6 +131,10 @@ wchar_t * _TLIBC_CDECL_ wmemset(wchar_t *, wchar_t,
size_t);
int _TLIBC_CDECL_ swprintf(wchar_t *, size_t, const wchar_t *, ...);
int _TLIBC_CDECL_ vswprintf(wchar_t *, size_t, const wchar_t *,
__va_list);
+long double _TLIBC_CDECL_ wcstold (const wchar_t *, wchar_t **);
+long long _TLIBC_CDECL_ wcstoll (const wchar_t *, wchar_t **, int);
+unsigned long long _TLIBC_CDECL_ wcstoull (const wchar_t *, wchar_t **, int);
+
/* leagcy version of wcsstr */
wchar_t * _TLIBC_CDECL_ wcswcs(const wchar_t *, const wchar_t *);
diff --git a/sgx_edl/common/inc/wctype.h b/sgx_edl/common/inc/wctype.h
index fb421af..0ab9497 100644
--- a/sgx_edl/common/inc/wctype.h
+++ b/sgx_edl/common/inc/wctype.h
@@ -56,27 +56,24 @@ typedef __wctype_t wctype_t;
__BEGIN_DECLS
-/*
- * Deprecated definitions.
- */
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswalnum, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswalpha, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswblank, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswcntrl, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswdigit, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswgraph, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswlower, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswprint, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswpunct, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswspace, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswupper, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswxdigit, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(int _TLIBC_CDECL_, iswctype, wint_t,
wctype_t);
-_TLIBC_DEPRECATED_FUNCTION_(wint_t _TLIBC_CDECL_, towctrans, wint_t,
wctrans_t);
-_TLIBC_DEPRECATED_FUNCTION_(wint_t _TLIBC_CDECL_, towlower, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(wint_t _TLIBC_CDECL_, towupper, wint_t);
-_TLIBC_DEPRECATED_FUNCTION_(wctrans_t _TLIBC_CDECL_, wctrans, const char *);
-_TLIBC_DEPRECATED_FUNCTION_(wctype_t _TLIBC_CDECL_, wctype, const char *);
+int _TLIBC_CDECL_ iswalnum(wint_t);
+int _TLIBC_CDECL_ iswalpha(wint_t);
+int _TLIBC_CDECL_ iswblank(wint_t);
+int _TLIBC_CDECL_ iswcntrl(wint_t);
+int _TLIBC_CDECL_ iswdigit(wint_t);
+int _TLIBC_CDECL_ iswgraph(wint_t);
+int _TLIBC_CDECL_ iswlower(wint_t);
+int _TLIBC_CDECL_ iswprint(wint_t);
+int _TLIBC_CDECL_ iswpunct(wint_t);
+int _TLIBC_CDECL_ iswspace(wint_t);
+int _TLIBC_CDECL_ iswupper(wint_t);
+int _TLIBC_CDECL_ iswxdigit(wint_t);
+int _TLIBC_CDECL_ iswctype(wint_t, wctype_t);
+wint_t _TLIBC_CDECL_ towctrans(wint_t, wctrans_t);
+wint_t _TLIBC_CDECL_ towlower(wint_t);
+wint_t _TLIBC_CDECL_ towupper(wint_t);
+wctrans_t _TLIBC_CDECL_ wctrans(const char *);
+wctype_t _TLIBC_CDECL_ wctype(const char *);
__END_DECLS
diff --git a/sgx_tcrypto/src/crypto.rs b/sgx_tcrypto/src/crypto.rs
index e6673c7..96c09b8 100644
--- a/sgx_tcrypto/src/crypto.rs
+++ b/sgx_tcrypto/src/crypto.rs
@@ -2922,6 +2922,125 @@ where
}
///
+/// The rsgx_rsa3072_sign_msg_ex computes a digital signature for a given
dataset based on RSA 3072 private key
+/// and the optional corresponding RSA 3072 public key.
+///
+/// # Description
+///
+/// This function computes a digital signature over the input dataset based on
the RSA 3072 private key.
+///
+/// A message digest is a fixed size number derived from the original message
with an applied hash function
+/// over the binary code of the message. (SHA256 in this case)
+///
+/// The signer's private key and the message digest are used to create a
signature.
+///
+/// The scheme used for computing a digital signature is of the
RSASSA-PKCS1-v1_5 scheme.
+///
+/// # Parameters
+///
+/// **data**
+///
+/// A pointer to the data to calculate the signature over.
+///
+/// **key**
+///
+/// A pointer to the RSA private key.
+///
+/// **public**
+///
+/// A pointer to the RSA public key. Can be None.
+///
+/// # Requirements
+///
+/// Library: libsgx_tcrypto.a
+///
+/// # Return value
+///
+/// The signature generated by this function.
+///
+/// # Errors
+///
+/// **SGX_ERROR_INVALID_PARAMETER**
+///
+/// The private key, data is NULL. Or the data size is 0. Or the RSA private
key and the public key do not match.
+///
+/// **SGX_ERROR_OUT_OF_MEMORY**
+///
+/// Not enough memory is available to complete this operation.
+///
+/// **SGX_ERROR_UNEXPECTED**
+///
+/// The signature generation process failed due to an internal cryptography
library failure.
+///
+pub fn rsgx_rsa3072_sign_msg_ex<T>(
+ data: &T,
+ key: &sgx_rsa3072_key_t,
+ public: Option<&sgx_rsa3072_public_key_t>,
+) -> SgxResult<sgx_rsa3072_signature_t>
+where
+ T: Copy + ContiguousMemory,
+{
+ let size = mem::size_of::<T>();
+ if size == 0 {
+ return Err(sgx_status_t::SGX_ERROR_INVALID_PARAMETER);
+ }
+ if size > u32::MAX as usize {
+ return Err(sgx_status_t::SGX_ERROR_INVALID_PARAMETER);
+ }
+
+ let mut sign = sgx_rsa3072_signature_t::default();
+ let ret = unsafe {
+ sgx_rsa3072_sign_ex(
+ data as *const _ as *const u8,
+ size as u32,
+ key as *const sgx_rsa3072_key_t,
+ public.map_or(ptr::null(), |key| key as *const
sgx_rsa3072_public_key_t),
+ &mut sign as *mut sgx_rsa3072_signature_t,
+ )
+ };
+ match ret {
+ sgx_status_t::SGX_SUCCESS => Ok(sign),
+ _ => Err(ret),
+ }
+}
+
+///
+/// The rsgx_rsa3072_sign_slice_ex computes signature for a given data based
on RSA 3072 private key
+/// and the optional corresponding RSA 3072 public key.
+///
+pub fn rsgx_rsa3072_sign_slice_ex<T>(
+ data: &[T],
+ key: &sgx_rsa3072_key_t,
+ public: Option<&sgx_rsa3072_public_key_t>,
+) -> SgxResult<sgx_rsa3072_signature_t>
+where
+ T: Copy + ContiguousMemory,
+{
+ let size = mem::size_of_val(data);
+ if size == 0 {
+ return Err(sgx_status_t::SGX_ERROR_INVALID_PARAMETER);
+ }
+ if size > u32::MAX as usize {
+ return Err(sgx_status_t::SGX_ERROR_INVALID_PARAMETER);
+ }
+
+ let mut sign = sgx_rsa3072_signature_t::default();
+ let ret = unsafe {
+ sgx_rsa3072_sign_ex(
+ data.as_ptr() as *const _ as *const u8,
+ size as u32,
+ key as *const sgx_rsa3072_key_t,
+ public.map_or(ptr::null(), |key| key as *const
sgx_rsa3072_public_key_t),
+ &mut sign as *mut sgx_rsa3072_signature_t,
+ )
+ };
+ match ret {
+ sgx_status_t::SGX_SUCCESS => Ok(sign),
+ _ => Err(ret),
+ }
+}
+
+///
/// rsgx_rsa3072_verify_msg verifies the input digital signature for the given
data- set based on the RSA 3072 public key.
///
/// # Description
diff --git a/sgx_types/src/function.rs b/sgx_types/src/function.rs
old mode 100755
new mode 100644
index 3e191ba..6b7cc9d
--- a/sgx_types/src/function.rs
+++ b/sgx_types/src/function.rs
@@ -318,6 +318,13 @@ extern "C" {
p_key: *const sgx_rsa3072_key_t,
p_signature: *mut sgx_rsa3072_signature_t) ->
sgx_status_t;
+ /* intel sgx sdk 2.15 */
+ pub fn sgx_rsa3072_sign_ex(p_data: *const uint8_t,
+ data_size: uint32_t,
+ p_key: *const sgx_rsa3072_key_t,
+ p_public: *const sgx_rsa3072_public_key_t,
+ p_signature: *mut sgx_rsa3072_signature_t) ->
sgx_status_t;
+
pub fn sgx_rsa3072_verify(p_data: *const uint8_t,
data_size: uint32_t,
p_public: *const sgx_rsa3072_public_key_t,
diff --git a/sgx_ucrypto/src/crypto.rs b/sgx_ucrypto/src/crypto.rs
index c1b2d62..47eebc5 100644
--- a/sgx_ucrypto/src/crypto.rs
+++ b/sgx_ucrypto/src/crypto.rs
@@ -2733,6 +2733,125 @@ where
}
///
+/// The rsgx_rsa3072_sign_msg_ex computes a digital signature for a given
dataset based on RSA 3072 private key
+/// and the optional corresponding RSA 3072 public key.
+///
+/// # Description
+///
+/// This function computes a digital signature over the input dataset based on
the RSA 3072 private key.
+///
+/// A message digest is a fixed size number derived from the original message
with an applied hash function
+/// over the binary code of the message. (SHA256 in this case)
+///
+/// The signer's private key and the message digest are used to create a
signature.
+///
+/// The scheme used for computing a digital signature is of the
RSASSA-PKCS1-v1_5 scheme.
+///
+/// # Parameters
+///
+/// **data**
+///
+/// A pointer to the data to calculate the signature over.
+///
+/// **key**
+///
+/// A pointer to the RSA private key.
+///
+/// **public**
+///
+/// A pointer to the RSA public key. Can be None.
+///
+/// # Requirements
+///
+/// Library: libsgx_tcrypto.a
+///
+/// # Return value
+///
+/// The signature generated by this function.
+///
+/// # Errors
+///
+/// **SGX_ERROR_INVALID_PARAMETER**
+///
+/// The private key, data is NULL. Or the data size is 0. Or the RSA private
key and the public key do not match.
+///
+/// **SGX_ERROR_OUT_OF_MEMORY**
+///
+/// Not enough memory is available to complete this operation.
+///
+/// **SGX_ERROR_UNEXPECTED**
+///
+/// The signature generation process failed due to an internal cryptography
library failure.
+///
+pub fn rsgx_rsa3072_sign_msg_ex<T>(
+ data: &T,
+ key: &sgx_rsa3072_key_t,
+ public: Option<&sgx_rsa3072_public_key_t>,
+) -> SgxResult<sgx_rsa3072_signature_t>
+where
+ T: Copy + ContiguousMemory,
+{
+ let size = mem::size_of::<T>();
+ if size == 0 {
+ return Err(sgx_status_t::SGX_ERROR_INVALID_PARAMETER);
+ }
+ if size > u32::MAX as usize {
+ return Err(sgx_status_t::SGX_ERROR_INVALID_PARAMETER);
+ }
+
+ let mut sign = sgx_rsa3072_signature_t::default();
+ let ret = unsafe {
+ sgx_rsa3072_sign_ex(
+ data as *const _ as *const u8,
+ size as u32,
+ key as *const sgx_rsa3072_key_t,
+ public.map_or(ptr::null(), |key| key as *const
sgx_rsa3072_public_key_t),
+ &mut sign as *mut sgx_rsa3072_signature_t,
+ )
+ };
+ match ret {
+ sgx_status_t::SGX_SUCCESS => Ok(sign),
+ _ => Err(ret),
+ }
+}
+
+///
+/// The rsgx_rsa3072_sign_slice_ex computes signature for a given data based
on RSA 3072 private key
+/// and the optional corresponding RSA 3072 public key.
+///
+pub fn rsgx_rsa3072_sign_slice_ex<T>(
+ data: &[T],
+ key: &sgx_rsa3072_key_t,
+ public: Option<&sgx_rsa3072_public_key_t>,
+) -> SgxResult<sgx_rsa3072_signature_t>
+where
+ T: Copy + ContiguousMemory,
+{
+ let size = mem::size_of_val(data);
+ if size == 0 {
+ return Err(sgx_status_t::SGX_ERROR_INVALID_PARAMETER);
+ }
+ if size > u32::MAX as usize {
+ return Err(sgx_status_t::SGX_ERROR_INVALID_PARAMETER);
+ }
+
+ let mut sign = sgx_rsa3072_signature_t::default();
+ let ret = unsafe {
+ sgx_rsa3072_sign_ex(
+ data.as_ptr() as *const _ as *const u8,
+ size as u32,
+ key as *const sgx_rsa3072_key_t,
+ public.map_or(ptr::null(), |key| key as *const
sgx_rsa3072_public_key_t),
+ &mut sign as *mut sgx_rsa3072_signature_t,
+ )
+ };
+ match ret {
+ sgx_status_t::SGX_SUCCESS => Ok(sign),
+ _ => Err(ret),
+ }
+}
+
+///
/// rsgx_rsa3072_verify_msg verifies the input digital signature for the given
data- set based on the RSA 3072 public key.
///
/// # Description
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]