Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows release #11

Merged
merged 2 commits into from
Nov 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
87 changes: 87 additions & 0 deletions Linux/License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
BSD 3-clause "New" or "Revised" License

Copyright (C) 2011-2017 Intel Corporation. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

=================================================================

This project use OpenSSL crypto tests.

/* ====================================================================
* Copyright (c) 1998-2017 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
34 changes: 17 additions & 17 deletions build_sgxssl.sh → Linux/build_sgxssl.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function clean_and_ret {

# set -x # enable this for debugging this script

# this variable must be set to the path where sgx sdk is installed
# this variable must be set to the path where Intel® Software Guard Extensions SDK is installed
if [[ $# -gt 0 ]] && [[ $1 == "linux-sgx" || $2 == "linux-sgx" ]] ; then
LINUX_BUILD_FLAG=LINUX_SGX_BUILD=1
SGX_SDK_LIBS_PATH=../../build/linux
Expand All @@ -77,7 +77,7 @@ else
if [ -f $SGX_SDK/environment ]; then
source $SGX_SDK/environment || clean_and_ret 1
else
echo "In order to run this script, Intel SGX SDK 1.7 must be installed on this machine, and SGX_SDK (in this script) must be set to the installation location"
echo "In order to run this script, Intel® Software Guard Extensions SDK 1.7 must be installed on this machine, and SGX_SDK (in this script) must be set to the installation location"
clean_and_ret 1
fi
fi
Expand All @@ -88,15 +88,15 @@ fi

SGXSSL_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo $SGXSSL_ROOT
OPENSSL_INSTALL_DIR="$SGXSSL_ROOT/openssl_source/OpenSSL_install_dir_tmp"
OPENSSL_VERSION=`/bin/ls $SGXSSL_ROOT/openssl_source/*.tar.gz | /usr/bin/head -1 | /bin/grep -o '[^/]*$' | /bin/sed -s -- 's/\.tar\.gz//'`
OPENSSL_INSTALL_DIR="$SGXSSL_ROOT/../openssl_source/OpenSSL_install_dir_tmp"
OPENSSL_VERSION=`/bin/ls $SGXSSL_ROOT/../openssl_source/*.tar.gz | /usr/bin/head -1 | /bin/grep -o '[^/]*$' | /bin/sed -s -- 's/\.tar\.gz//'`
if [ "$OPENSSL_VERSION" == "" ]
then
echo "In order to run this script, OpenSSL tar.gz package must be located in openssl_source/ directory."
clean_and_ret 1
fi
echo $OPENSSL_VERSION
# this variable must be set to the SGX SSL version
# this variable must be set to the Intel® Software Guard Extensions SSL version
SVN_REVISION=`svn info | grep Revision | cut -d ' ' -f 2` || clean_and_ret 1

if [ "$SVN_REVISION" == "" ]
Expand Down Expand Up @@ -133,10 +133,10 @@ cd $SGXSSL_ROOT/sgx/libsgx_usgxssl || clean_and_ret 1
sed -e "s|#define STRFILEVER \"1.0.0.0\"|#define STRFILEVER \"$SGXSSL_VERSION\"|" usgxssl_version.cpp.in > usgxssl_version.cpp

# build release modules
cd $SGXSSL_ROOT/openssl_source || clean_and_ret 1
cd $SGXSSL_ROOT/../openssl_source || clean_and_ret 1
tar xvf $OPENSSL_VERSION.tar.gz || clean_and_ret 1

# SGXSSL uses rd_rand, so there is no need to get a random based on time
# Intel® Software Guard Extensions SSL uses rd_rand, so there is no need to get a random based on time
sed -i "s|time_t tim;||g" $OPENSSL_VERSION/crypto/bn/bn_rand.c
sed -i "s|time(&tim);||g" $OPENSSL_VERSION/crypto/bn/bn_rand.c
sed -i "s|RAND_add(&tim, sizeof(tim), 0.0);||g" $OPENSSL_VERSION/crypto/bn/bn_rand.c
Expand All @@ -146,12 +146,12 @@ sed -i '/BSAES_ASM/d' $OPENSSL_VERSION/Configure

cp rand_unix.c $OPENSSL_VERSION/crypto/rand/rand_unix.c || clean_and_ret 1
cp md_rand.c $OPENSSL_VERSION/crypto/rand/md_rand.c || clean_and_ret 1
cd $SGXSSL_ROOT/openssl_source/$OPENSSL_VERSION || clean_and_ret 1
perl Configure linux-x86_64 no-idea no-mdc2 no-rc5 no-rc4 no-bf no-ec2m no-camellia no-cast no-srp no-hw no-dso no-shared no-ssl3 no-md2 no-md4 no-ui no-stdio no-afalgeng -D_FORTIFY_SOURCE=2 -DSGXSDK_INT_VERSION=$SGXSDK_INT_VERSION -DGETPID_IS_MEANINGLESS -include$SGXSSL_ROOT/openssl_source/bypass_to_sgxssl.h --prefix=$OPENSSL_INSTALL_DIR || clean_and_ret 1
cd $SGXSSL_ROOT/../openssl_source/$OPENSSL_VERSION || clean_and_ret 1
perl Configure linux-x86_64 no-idea no-mdc2 no-rc5 no-rc4 no-bf no-ec2m no-camellia no-cast no-srp no-hw no-dso no-shared no-ssl3 no-md2 no-md4 no-ui no-stdio no-afalgeng -D_FORTIFY_SOURCE=2 -DSGXSDK_INT_VERSION=$SGXSDK_INT_VERSION -DGETPID_IS_MEANINGLESS -include$SGXSSL_ROOT/../openssl_source/bypass_to_sgxssl.h --prefix=$OPENSSL_INSTALL_DIR || clean_and_ret 1
make build_generated libcrypto.a || clean_and_ret 1
cp libcrypto.a $SGXSSL_ROOT/package/lib64/release/libsgx_tsgxssl_crypto.a || clean_and_ret 1
cp include/openssl/* $SGXSSL_ROOT/package/include/openssl/ || clean_and_ret 1
cd $SGXSSL_ROOT/openssl_source || clean_and_ret 1
cd $SGXSSL_ROOT/../openssl_source || clean_and_ret 1
rm -rf $OPENSSL_VERSION || clean_and_ret 1
cd $SGXSSL_ROOT/sgx || clean_and_ret 1

Expand All @@ -163,26 +163,26 @@ make clean || clean_and_ret 1


# build debug modules
cd $SGXSSL_ROOT/openssl_source || clean_and_ret 1
cd $SGXSSL_ROOT/../openssl_source || clean_and_ret 1
tar xvf $OPENSSL_VERSION.tar.gz || clean_and_ret 1

# SGXSSL uses rd_rand, so there is no need to get a random based on time
# Intel® Software Guard Extensions SSL uses rd_rand, so there is no need to get a random based on time
sed -i "s|time_t tim;||g" $OPENSSL_VERSION/crypto/bn/bn_rand.c
sed -i "s|time(&tim);||g" $OPENSSL_VERSION/crypto/bn/bn_rand.c
sed -i "s|RAND_add(&tim, sizeof(tim), 0.0);||g" $OPENSSL_VERSION/crypto/bn/bn_rand.c

# Remove AESBS to support only AESNI and VPAES
sed -i '/BSAES_ASM/d' $OPENSSL_VERSION/Configure

#sed -i "s|my \$user_cflags=\"\"\;|my \$user_cflags=\"-include $SGXSSL_ROOT/openssl_source/bypass_to_sgxssl.h\"\;|" $OPENSSL_VERSION/Configure
#sed -i "s|my \$user_cflags=\"\"\;|my \$user_cflags=\"-include $SGXSSL_ROOT/../openssl_source/bypass_to_sgxssl.h\"\;|" $OPENSSL_VERSION/Configure
cp rand_unix.c $OPENSSL_VERSION/crypto/rand/rand_unix.c || clean_and_ret 1
cp md_rand.c $OPENSSL_VERSION/crypto/rand/md_rand.c || clean_and_ret 1
cd $SGXSSL_ROOT/openssl_source/$OPENSSL_VERSION || clean_and_ret 1
perl Configure linux-x86_64 no-idea no-mdc2 no-rc5 no-rc4 no-bf no-ec2m no-camellia no-cast no-srp no-hw no-dso no-shared no-ssl3 no-md2 no-md4 no-ui no-stdio no-afalgeng -D_FORTIFY_SOURCE=2 -DSGXSDK_INT_VERSION=$SGXSDK_INT_VERSION -DGETPID_IS_MEANINGLESS -DCONFNAME_HEADER=$CONFNAME_HEADER -include$SGXSSL_ROOT/openssl_source/bypass_to_sgxssl.h --prefix=$OPENSSL_INSTALL_DIR -g || clean_and_ret 1
cd $SGXSSL_ROOT/../openssl_source/$OPENSSL_VERSION || clean_and_ret 1
perl Configure linux-x86_64 no-idea no-mdc2 no-rc5 no-rc4 no-bf no-ec2m no-camellia no-cast no-srp no-hw no-dso no-shared no-ssl3 no-md2 no-md4 no-ui no-stdio no-afalgeng -D_FORTIFY_SOURCE=2 -DSGXSDK_INT_VERSION=$SGXSDK_INT_VERSION -DGETPID_IS_MEANINGLESS -DCONFNAME_HEADER=$CONFNAME_HEADER -include$SGXSSL_ROOT/../openssl_source/bypass_to_sgxssl.h --prefix=$OPENSSL_INSTALL_DIR -g || clean_and_ret 1
make build_generated libcrypto.a || clean_and_ret 1
cp libcrypto.a $SGXSSL_ROOT/package/lib64/debug/libsgx_tsgxssl_crypto.a || clean_and_ret 1

cd $SGXSSL_ROOT/openssl_source || clean_and_ret 1
cd $SGXSSL_ROOT/../openssl_source || clean_and_ret 1
rm -rf $OPENSSL_VERSION || clean_and_ret 1
cd $SGXSSL_ROOT/sgx || clean_and_ret 1

Expand All @@ -209,7 +209,7 @@ cd $SGXSSL_ROOT || clean_and_ret 1

# generate list of tools used for creating this release
BUILD_TOOLS_FILENAME=sgxssl.$SGXSSL_VERSION.build-tools.txt
echo "SGX SDK version:" > $BUILD_TOOLS_FILENAME
echo "Intel® Software Guard Extensions SDK version:" > $BUILD_TOOLS_FILENAME
echo $SGXSDK_VERSION >> $BUILD_TOOLS_FILENAME
echo "OpenSSL package version:" >> $BUILD_TOOLS_FILENAME
echo "$OPENSSL_VERSION" >> $BUILD_TOOLS_FILENAME
Expand Down
Binary file not shown.
Loading