Unverified Commit 5544e74f authored by Stan Kladko's avatar Stan Kladko Committed by GitHub

Merge pull request #19 from skalenetwork/feature/SKALE-1850-remove-extra-dependencies-from-SGX

Feature/skale 1850 remove extra dependencies from sgx
parents 8ca3a0ca 1bae5dc6
......@@ -6,27 +6,27 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install packages
run: >
sudo apt-get update && sudo apt-get install -yq --no-install-recommends python-yaml vim telnet git
sudo apt-get update && sudo apt-get install -yq --no-install-recommends python-yaml vim telnet git yasm python-yaml
ca-certificates build-essential ocaml ocamlbuild automake autoconf libtool wget python
libssl-dev libssl-dev libcurl4-openssl-dev protobuf-compiler git libprotobuf-dev alien
cmake debhelper uuid-dev libxml2-dev libprotobuf10 cmake flex bison libprocps-dev ccache
libssl-dev libssl-dev libcurl4-openssl-dev protobuf-compiler git libprotobuf-dev alien
cmake debhelper uuid-dev libxml2-dev libprotobuf10 cmake flex bison libprocps-dev ccache
autoconf texinfo libssl-dev libboost-all-dev libjsonrpccpp-dev libjsonrpccpp-tools
- name: install sgx
run: >
git clone -b sgx_2.5 --depth 1 https://github.com/intel/linux-sgx &&
cd linux-sgx &&
patch -p1 -i ../docker/install-psw.patch && ./download_prebuilt.sh 2> /dev/null
&& make -s -j$(nproc) sdk_install_pkg psw_install_pkg
patch -p1 -i ../docker/install-psw.patch && ./download_prebuilt.sh 2> /dev/null
&& make -s -j$(nproc) sdk_install_pkg psw_install_pkg
&& sudo ./linux/installer/bin/sgx_linux_x64_sdk_2.5.100.49891.bin --prefix=/opt/intel
&& sudo ./linux/installer/bin/sgx_linux_x64_psw_2.5.100.49891.bin &&
cd .. && rm -rf linux-sgx/
&& sudo ./linux/installer/bin/sgx_linux_x64_psw_2.5.100.49891.bin &&
cd .. && rm -rf linux-sgx/
- name: update git
run: git submodule update --init --recursive
run: git submodule update --init --recursive
- name: build deps
run: cd scripts; ./build.py
- name: build sgx
......
......@@ -3,28 +3,42 @@
gmp-build
tgmp-build
install-sh
/config.log
/config.status
/Makefile.in
/Makefile
/secure_enclave_u.h
/secure_enclave_u.c
/secure_enclave.edl
/am--include-marker
config.log
config.status
Makefile.in
Makefile
secure_enclave_u.h
secure_enclave_u.c
secure_enclave.edl
am--include-marker
*.o
/aclocal.m4
/secure_enclave.signed.so
/sgxgmpmath
/sgxgmppi
/.deps/
/CMakeCache.txt
/cmake_install.cmake
/sgxd.cbp
/sgx-gmp/
/sgx-sdk-build/
/secure_enclave/Makefile
/secure_enclave/secure_enclave.signed.so
/secure_enclave/secure_enclave.so
/secure_enclave/secure_enclave_t.c
/secure_enclave/secure_enclave_t.h
/sgxd
aclocal.m4
secure_enclave.signed.so
sgxgmpmath
sgxgmppi
.deps
CMakeCache.txt
cmake_install.cmake
sgxd.cbp
sgx-gmp
sgx-sdk-build
secure_enclave/Makefile
secure_enclave/secure_enclave.signed.so
secure_enclave/secure_enclave.so
secure_enclave/secure_enclave_t.c
secure_enclave/secure_enclave_t.h
sgxd
cert/SGXServerCertificate*
autom4te.cache
sgxwallet
testw
configure
jsonrpc/zlib
jsonrpc/argtable2
jsonrpc/jsoncpp
jsonrpc/libjson-rpc-cpp
jsonrpc/curl-from-git.tar.gz
jsonrpc/curl
jsonrpc/libmicrohttpd
secure_enclave/.deps
test-driver
......@@ -30,11 +30,11 @@
#define EXTERNC
#endif
EXTERNC void init_all();
EXTERNC void init_daemon();
EXTERNC void init_enclave();
//EXTERNC void init_all();
//
//EXTERNC void init_daemon();
//
//EXTERNC void init_enclave();
EXTERNC bool sign(const char* encryptedKeyHex, const char* hashHex, size_t t, size_t n,
size_t signerIndex, char* _sig);
......
......@@ -26,11 +26,13 @@
#include "sgxwallet.h"
#include <iostream>
#include <memory>
#include <memory>
#include "SGXWalletServer.hpp"
#include "RPCException.h"
#include <libBLS/libff/libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp>
//#include <libBLS/libff/libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp>
#include <libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp>
std::vector<std::string> SplitString(const char* koefs, const char symbol){
std::string str(koefs);
......@@ -250,7 +252,7 @@ bool CreateBLSShare( const std::string& BLSKeyName, const char * s_shares, const
if (!hex2carray(encryptedKeyHex, &dec_key_len, encr_key)){
throw RPCException(INVALID_HEX, "Invalid encryptedKeyHex");
}
uint32_t enc_bls_len = 0;
std::cerr << "BEFORE create_bls_key IN ENCLAVE " << std::endl;
......@@ -341,8 +343,3 @@ std::vector<std::string> mult_G2(const std::string& x){
result[3] = ConvertToString(elG2.Y.c1);
return result;
}
......@@ -29,7 +29,7 @@ include $(top_srcdir)/build-aux/sgx_app.am
SUBDIRS=secure_enclave
## Supply additional flags to edger8r here.
## Supply additional flags to edger8r here.
##
## SGX_EDGER8R_FLAGS=
......@@ -46,7 +46,7 @@ secure_enclave.edl: secure_enclave/secure_enclave.edl
#AM_CFLAGS = -g -Og
#AM_CXXFLAGS = ${AM_CPPFLAGS}
AM_CPPFLAGS += -Wall -DSKALE_SGX=1 -DBINARY_OUTPUT=1 -Ileveldb/include -IlibBLS/bls -IlibBLS/libff -IlibBLS -fno-builtin-memset $(GMP_CPPFLAGS) -I.
AM_CPPFLAGS += -Wall -DSKALE_SGX=1 -DBINARY_OUTPUT=1 -Ileveldb/include -IlibBLS/bls -IlibBLS/libff -IlibBLS -fno-builtin-memset $(GMP_CPPFLAGS) -I. -I./libBLS/deps/deps_inst/x86_or_x64/include
## Additional targets to remove with 'make clean'. You must list
## any edger8r generated files here.
......@@ -74,7 +74,7 @@ nodist_sgxwallet_SOURCES = $(COMMON_ENCLAVE_SRC)
EXTRA_sgxwallet_DEPENDENCIES = secure_enclave.signed.so
BUILT_SOURCES = $(COMMON_ENCLAVE_SRC)
AM_LDFLAGS += $(GMP_LDFLAGS)
AM_LDFLAGS += $(GMP_LDFLAGS) -L./libBLS/deps/deps_inst/x86_or_x64/lib
secure_enclave.signed.so: secure_enclave/secure_enclave.signed.so
ln -s $?
......@@ -91,10 +91,14 @@ secure_enclave.signed.so: secure_enclave/secure_enclave.signed.so
## Use the variables, not the actual library names to ensure these
## targets work on simulation builds.
sgxwallet_LDADD=-l$(SGX_URTS_LIB) -Lleveldb/build -LlibBLS/build -LlibBLS/build/libff/libff -l:libbls.a -l:libleveldb.a \
-l:libff.a -lgmp -ldl -l:libsgx_capable.a -l:libsgx_tprotected_fs.a -ljsonrpccpp-stub -lpthread -ljsonrpccpp-common \
-ljsonrpccpp-server -ljsonrpccpp-client -ljsoncpp -lcurl -lprocps intel-sgx-ssl/Linux/package/lib64/libsgx_usgxssl.a \
intel-sgx-ssl/Linux/package/lib64/libsgx_tsgxssl_crypto.a
sgxwallet_LDADD=-l$(SGX_URTS_LIB) -LlibBLS/deps/deps_inst/x86_or_x64/lib -Lleveldb/build -LlibBLS/build \
-LlibBLS/build/libff/libff \
-l:libbls.a -l:libleveldb.a \
-l:libff.a -lgmp -ldl -l:libsgx_capable.a -l:libsgx_tprotected_fs.a \
-ljsonrpccpp-stub -ljsonrpccpp-server -ljsonrpccpp-client -ljsonrpccpp-common -ljsoncpp -lmicrohttpd \
intel-sgx-ssl/Linux/package/lib64/libsgx_usgxssl.a \
intel-sgx-ssl/Linux/package/lib64/libsgx_tsgxssl_crypto.a \
-lgnutls -lgcrypt -lcurl -lssl -lcrypto -lz -lpthread
testw_SOURCES=testw.cpp stubclient.cpp SGXWalletServer.cpp RPCException.cpp BLSCrypto.cpp ServerInit.cpp LevelDB.cpp \
......
......@@ -4,9 +4,9 @@
## Intro
sgxwallet is a next generation hardware secure crypto wallet that is based on Intel SGX technology. It currently supports Ethereum and SKALE, and will support Bitcoin in the future.
**sgxwallet** is a next generation hardware secure crypto wallet that is based on **Intel SGX** technology. It currently supports **Ethereum** and **SKALE**, and will support **Bitcoin** in the future.
sgxwallet has been tested on Ubuntu Linux 18.04.
**sgxwallet** has been tested on **Ubuntu Linux 18.04**.
## An important note about production readiness
......@@ -14,8 +14,8 @@ This sgxwallet library is still in active development and therefore should be re
## Install Prerequisites
```sh
sudo apt-get install build-essential make cmake gcc python libssl-dev libboost-all-dev libgmp3-dev libprotobuf10 libprocps-dev flex bison automake libtool texinfo libjsonrpccpp-dev
```
sudo apt-get install build-essential make cmake gcc g++ yasm python libprotobuf10 flex bison automake libtool texinfo libgcrypt20-dev libgnutls28-dev
```
## Clone this repository and its submodules
......@@ -24,12 +24,12 @@ sudo apt-get install build-essential make cmake gcc python libssl-dev libboost-a
## Enable SGX on your machine
To build and run sgxd, you'll need Intel SGX capable hardware. Most Intel chips that were produced after 2015 support SGX.
To build and run **sgxd**, you'll need **Intel SGX** capable hardware. Most Intel chips that were produced after 2015 support **SGX**.
- Enter BIOS of you machine by pressing and holding Del or F2 on bootup and verify that BIOS includes SGX options.
If not, your machine cant run SGX.
- Enter **BIOS** of you machine by pressing and holding **Del** or **F2** on boot-up and verify that **BIOS** includes **SGX options**.
If not, your machine cant run **SGX**.
- Set SGX in BIOS as `enabled` or `software-controlled`.
- If you can set SGX to `enabled` you are done! Proceed with "Install SGX Driver" section
- If you can set SGX to `enabled` you are done! Proceed with "Install SGX Driver" section
- If not, set SGX in BIOS to `software-controlled` and then enable by running a sgx-enable utility, as described below.
## Enable "software-controlled" SGX (for testing purposes only)
......@@ -37,52 +37,57 @@ To build and run sgxd, you'll need Intel SGX capable hardware. Most Intel chips
To enable SGX using a software utility:
- Build `sgx-enable` utility by typing `cd sgx-software-enable; make`
- Run `./sgx-enable`. Verify that it says that SGX is successfully enabled
- Run `./sgx_enable`. Verify that it says that **SGX** is successfully enabled
## Install SGX driver
`cd scripts; sudo ./sgx_linux_x64_driver_2.5.0_2605efa.bin`
```
cd scripts; sudo ./sgx_linux_x64_driver_2.5.0_2605efa.bin; cd ..
```
Reboot you machine after driver install. Do `ls /dev/isgx` to check that `isgx` device is properly installed.
If you do not see the `isgx` device, you need to troubleshoot your driver installation.
## Install SGX sdk
`cd scripts; sudo ./sgx_linux_x64_sdk_2.5.100.49891.bin`
```
cd scripts; sudo ./sgx_linux_x64_sdk_2.5.100.49891.bin; cd ..
```
## Install required debian packages
`cd scripts; sudo ./install_packages.sh`
```
cd scripts; sudo ./install_packages.sh; cd ..
```
## Build dependencies
Dependencies only need to be built once.
```sh
cd scripts; ./build.py
```
## Configure
Cd to the project top dir, then run
```sh
autoreconf -vif
automake
./configure
cd scripts; ./build.py; cd ..
```
## Build
## Configure and build
Cd to project top dir and run
Go to the project's top directory, then run
```sh
libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf
./configure
make
```
## Running sgxwallet
Type `./sgxwallet`
Type:
```
`./sgxwallet`
```
## Build Docker container
......@@ -100,11 +105,9 @@ Then run
This will run the server in a Docker container named sgxwallet
You can check that the server is running by doing
You can check that the server is running by doing
telnet localhost 2027
You can start and stop running sgxwallet container by doing
You can start and stop running sgxwallet container by doing
docker stop sgxwallet
docker start sgxwallet
......@@ -114,7 +117,70 @@ You can start and stop running sgxwallet container by doing
Note that `configure, Makefile` and `Makefile.in` files are created by `automake` tools on the fly.
Please do not add these files to the source tree!
To add new source and include files to app and enclave, edit the corresponding "Makefile.am" file and then re-run configure.
To add new source and include files to app and enclave, edit the corresponding **Makefile.am** file and then re-run configure.
If you change **.edl** file, you need to re-run configure too.
## Example of client certificate instantiation
Go to the project's top directory, then run
```
export CSR_FILE=a.csr
export KEY_FILE=k.key
export CERT_NAME_UNIQUE=someVeryUniqueName
openssl req -new -sha256 -nodes -out $CSR_FILE -newkey rsa:2048 -keyout $KEY_FILE -subj /CN=$CERT_NAME_UNIQUE
cat $CSR_FILE
cat $KEY_FILE
export KEY_PEM_FILE=k.pem
openssl rsa -in $KEY_FILE -text > $KEY_PEM_FILE
cat $KEY_PEM_FILE
```
Next, send content of `a.csr` as single line (by replacing real end of lines with `\n`) to port `1027`:
```
export URL_SGX_WALLET="http://127.0.0.1:1027"
curl -X POST --data '{ "jsonrpc": "2.0", "id": 2, "method": "SignCertificate", "params": { "certificate": "-----BEGIN CERTIFICATE REQUEST-----\nMIICYjCCAUoCAQAwHTEbMBkGA1UEAwwSc29tZVZlcnlVbmlxdWVOYW1lMIIBIjAN\nBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3C4ceRhzMAZnG87PwlkzMROHsm3B\ncPydIeiqs1dieuuvVETJqbXAcOENNsGA+AdXjZwFkDuIS24p2yZ8AwuIMAwdMsGa\n5Hzk0ugOy52iPyGEuooqV94nnL6eWw/zryTvkk7j239wMWn5our5Ia1/CBQlXXo2\n4IWTWfWYOz26SWUh4DuvzMOheMVSxg3KLaxpx7Bq09p32lR9xpl53+HqxSDIMYh9\nC3y3kA6NdkKsGE/Jt4WoZ5S5LlrhYjw+PFTeX2lbGDZpn/sxQIM16Pxo2LCfefIa\nik+aZBEAlpn22ljLZ5sEcVgBmOlL+v3waq9u0AaSYzdGFRA+0ceVwU/QTQIDAQAB\noAAwDQYJKoZIhvcNAQELBQADggEBAJXodL69Q/8zDt24AySXK0ksV3C3l5l10Hno\nfF6zKypsYev33CFbZu6HweSgK2f21+DeI9TsGKJxI7K6MUqyH0pJhwlFSeMB5/qP\nJueqXMuvStZSp0GGTaNy7Al/jzOKYNf0ePsv/Rx8NcOdy7RCZE0gW998B5jKb66x\nPgy6QvD8CkZULiRScYlOC8Ex6nc+1Z54pRC1NFWs/ugGyFgLJHy0J2gNkOv6yfsl\nH3V/ocCYSoF4ToUQAxwx+dcy4PXrL9vKzRNJgWzsI/LzCZkglo8iis9YZQawDOUf\nGmDMDkr0Fx1W1tSEpvkw0flkAXZ8PhIGCC0320jkuPeClt7OWNs=\n-----END CERTIFICATE REQUEST-----\n" } }' -H 'content-type:application/json;' $URL_SGX_WALLET
```
Above produces on success:
```
{"id":2,"jsonrpc":"2.0","result":{"errorMessage":"","result":true,"status":0}}
```
Next, generate client certificate signed by root ones:
```
cd cert
./create_client_cert
ls -1
cat client.crt
openssl x509 -inform PEM -in client.crt > client.pem
cat client.pem
cd ..
```
Finally, do a test call such as importing BLS key:
```
export URL_SGX_WALLET="https://127.0.0.1:1026"
curl \
-X POST --data '{ "jsonrpc": "2.0", "id": 1, "method": "importBLSKeyShare", "params": { "keyShareName": "nBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3C4ceRhzMAZnG87PwlkzMROHsm3B", "n": 2, "t": 2, "index" : 1, "keyShare": "21043165427057050523208250969869713544622230829814517880078280390613973680760" } }' -H 'content-type:application/json;' \
-v --cacert ./cert/rootCA.pem --key $KEY_PEM_FILE --cert ./cert/client.pem $URL_SGX_WALLET -k
```
Above produces on success:
```
{"id":1,"jsonrpc":"2.0","result":{"encryptedKeyShare":"0400020000000000040effffff02000000000000000000000b000000000000ff0000000000000000cecb5d7bd507cb936464fdb6b88cfe80e38eae963af6a39b6b05cdfba5521c60000000f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000080000000000000000000000000000000875c0520e8d6739c440e0e5073633861769fc1d31d627e9a72c66d43871c62bce2cc48e821341e10784242c4c8aad6ca73a491cbf7453c2ff012b6b3d9d96823c0256992d9792ea60269789b2d51ae87c75fe522dbcb8053458c1bca421cbc57f4a58e4e5689d534ca0303db83c7a9e88cd23afe3a39e1a3801371c95e7ffa54e834c6be8853983dcaa1fa9f5e6959a5","errorMessage":"","status":0}}
```
If you change .edl file, you need to re-run configure too.
......@@ -135,3 +201,4 @@ If you change .edl file, you need to re-run configure too.
All contributions to sgxwallet are made under the [GNU Affero General Public License v3](https://www.gnu.org/licenses/agpl-3.0.en.html). See [LICENSE](LICENSE).
Copyright (C) 2019-Present SKALE Labs.
......@@ -25,7 +25,7 @@
#include <fstream>
#include <sstream>
#include <third_party/cryptlite/sha256.h>
#include <jsonrpccpp/server/connectors/httpserver.h>
#include <stdio.h>
......@@ -54,26 +54,47 @@ void set_cert_created1(bool b){
SGXRegistrationServer::SGXRegistrationServer(AbstractServerConnector &connector,
serverVersion_t type)
: AbstractRegServer(connector, type), is_cert_created(false) {}
serverVersion_t type, bool auto_sign)
: AbstractRegServer(connector, type), is_cert_created(false), cert_auto_sign(auto_sign) {}
Json::Value SignSertificateImpl(const std::string& cert){
Json::Value SignSertificateImpl(const std::string& cert, bool auto_sign = false){
Json::Value result;
result["status"] = 0;
result["errorMessage"] = "";
try{
//std::hash = cryptlite::sha256::hash_hex(cert);
std::cerr << " going to create csr" << std::endl;
std::ofstream outfile ("cert/test.csr");
std::ofstream outfile ("cert/client.csr");
outfile << cert << std::endl;
outfile.close();
std::string csrPath = "cert/client.csr";
if (access(csrPath.c_str(), F_OK) != 0){
throw RPCException(FILE_NOT_FOUND, "Csr does not exist");
}
result["result"] = true;
std::thread thr(set_cert_created1, true);
thr.detach();
// std::thread timeout_thr (std::bind(&SGXRegistrationServer::set_cert_created, this, true));
if (auto_sign) {
std::string genCert = "cd cert && ./create_client_cert";
if (system(genCert.c_str()) == 0){
std::cerr << "CLIENT CERTIFICATE IS SUCCESSFULLY GENERATED" << std::endl;
}
else{
std::cerr << "CLIENT CERTIFICATE GENERATION FAILED" << std::endl;
exit(-1);
}
}
} catch (RPCException &_e) {
std::cerr << " err str " << _e.errString << std::endl;
result["status"] = _e.status;
......@@ -95,7 +116,7 @@ Json::Value GetSertificateImpl(const std::string& hash){
result["cert"] = "";
}
else {
std::ifstream infile("cert/test_cert.crt");
std::ifstream infile("cert/client.crt");
if (!infile.is_open()) {
throw RPCException(FILE_NOT_FOUND, "Certificate does not exist");
} else {
......@@ -104,6 +125,9 @@ Json::Value GetSertificateImpl(const std::string& hash){
cert = ss.str();
infile.close();
system("cd cert && rm -rf client.crt");
result["cert"] = cert;
result["status"] = 0;
}
......@@ -120,8 +144,9 @@ Json::Value GetSertificateImpl(const std::string& hash){
Json::Value SGXRegistrationServer::SignCertificate(const std::string& cert){
std::cerr << "Enter SignCertificate " << std::endl;
lock_guard<recursive_mutex> lock(m);
return SignSertificateImpl(cert);
return SignSertificateImpl(cert, cert_auto_sign);
}
Json::Value SGXRegistrationServer::GetCertificate(const std::string& hash){
......@@ -136,28 +161,28 @@ void SGXRegistrationServer::set_cert_created(bool b){
int init_registration_server() {
std::string certPath = "cert/SGXCACertificate.crt";
std::string keyPath = "cert/SGXCACertificate.key";
if (access(certPath.c_str(), F_OK) != 0){
std::cerr << "CERTIFICATE IS GOING TO BE CREATED" << std::endl;
int init_registration_server(bool sign_automatically) {
std::string genCert = "cd cert && ./self-signed-tls -c=US -s=California -l=San-Francisco -o=\"Skale Labs\" -u=\"Department of Software Engineering\" -n=\"SGXCACertificate\" -e=info@skalelabs.com";
if (system(genCert.c_str()) == 0){
std::cerr << "CERTIFICATE IS SUCCESSFULLY GENERATED" << std::endl;
}
else{
std::cerr << "CERTIFICATE GENERATION FAILED" << std::endl;
exit(-1);
}
}
// std::string certPath = "cert/SGXCACertificate.crt";
// std::string keyPath = "cert/SGXCACertificate.key";
//
// if (access(certPath.c_str(), F_OK) != 0){
// std::cerr << "CERTIFICATE IS GOING TO BE CREATED" << std::endl;
//
// std::string genCert = "cd cert && ./self-signed-tls -c=US -s=California -l=San-Francisco -o=\"Skale Labs\" -u=\"Department of Software Engineering\" -n=\"SGXCACertificate\" -e=info@skalelabs.com";
//
// if (system(genCert.c_str()) == 0){
// std::cerr << "CERTIFICATE IS SUCCESSFULLY GENERATED" << std::endl;
// }
// else{
// std::cerr << "CERTIFICATE GENERATION FAILED" << std::endl;
// exit(-1);
// }
// }
hs2 = new HttpServer(1027);
hs2 = new HttpServer( 1027 );
sr = new SGXRegistrationServer(*hs2,
JSONRPC_SERVER_V2); // hybrid server (json-rpc 1.0 & 2.0)
JSONRPC_SERVER_V2, sign_automatically); // hybrid server (json-rpc 1.0 & 2.0)
if (!sr->StartListening()) {
cerr << "Registration server could not start listening" << endl;
......
......@@ -34,10 +34,13 @@ using namespace std;
class SGXRegistrationServer: public AbstractRegServer {
std::recursive_mutex m;
bool is_cert_created;
bool cert_auto_sign;
//std::string hash;
public:
SGXRegistrationServer(AbstractServerConnector &connector, serverVersion_t type);
SGXRegistrationServer(AbstractServerConnector &connector, serverVersion_t type, bool auto_sign = false);
void set_cert_created(bool b);
......@@ -47,7 +50,7 @@ public:
};
extern int init_registration_server();
extern int init_registration_server(bool sign_automatically = false);
#endif // SGXD_SGXREGISTRATIONSERVER_H
\ No newline at end of file
......@@ -75,36 +75,55 @@ void debug_print(){
levelDb->visitKeys(&v, 100000000);
}
int init_server() {
std::string certPath = "cert/SGXServerCertificate.crt";
std::string keyPath = "cert/SGXServerCertificate.key";
int init_server(bool check_certs) {
std::string rootCAPath = "cert/rootCA.pem";
std::string keyCAPath = "cert/rootCA.key";
if (access(certPath.c_str(), F_OK) != 0){ //(!boost::filesystem::exists(certPath) ){
std::cerr << "NO!!! " << std::endl;
std::cerr << "CERTIFICATE IS GOING TO BE CREATED" << std::endl;
if (access(rootCAPath.c_str(), F_OK) != 0 || access(keyCAPath.c_str(), F_OK) != 0){
std::cerr << "YOU DO NOT HAVE ROOT CA CERTIFICATE" << std::endl;
std::cerr << "ROOT CA CERTIFICATE IS GOING TO BE CREATED" << std::endl;
std::string genCert = "cd cert && ./self-signed-tls -c=US -s=California -l=San-Francisco -o=\"Skale Labs\" -u=\"Department of Software Engineering\" -n=\"SGXServerCertificate\" -e=info@skalelabs.com";
std::string genRootCACert = "cd cert && ./create_CA";
if (system(genRootCACert.c_str()) == 0){
std::cerr << "ROOT CA CERTIFICATE IS SUCCESSFULLY GENERATED" << std::endl;
}
else{
std::cerr << "ROOT CA CERTIFICATE GENERATION FAILED" << std::endl;
exit(-1);
}
}
std::string certPath = "cert/SGXServerCert.crt";
std::string keyPath = "cert/SGXServerCert.key";
if (access(certPath.c_str(), F_OK) != 0 || access(certPath.c_str(), F_OK) != 0){
std::cerr << "YOU DO NOT HAVE SERVER CERTIFICATE " << std::endl;
std::cerr << "SERVER CERTIFICATE IS GOING TO BE CREATED" << std::endl;
std::string genCert = "cd cert && ./create_server_cert";
if (system(genCert.c_str()) == 0){
std::cerr << "CERTIFICATE IS SUCCESSFULLY GENERATED" << std::endl;
std::cerr << "SERVER CERTIFICATE IS SUCCESSFULLY GENERATED" << std::endl;
}
else{
std::cerr << "CERTIFICATE GENERATION FAILED" << std::endl;
std::cerr << "SERVER CERTIFICATE GENERATION FAILED" << std::endl;
exit(-1);
}
}
hs = new HttpServer(1026, certPath, keyPath, 10);
hs = new HttpServer( 1026, certPath, keyPath, rootCAPath, check_certs, 10);
s = new SGXWalletServer(*hs,
JSONRPC_SERVER_V2); // hybrid server (json-rpc 1.0 & 2.0)
if (!s->StartListening()) {
cerr << "Server could not start listening" << endl;
cerr << "SGX Server could not start listening" << endl;
exit(-1);
}
return 0;
}
//int init_server() { //without ssl
//
// hs = new HttpServer(1028);
......
......@@ -31,7 +31,7 @@
#endif
EXTERNC int init_server();
EXTERNC int init_server(bool check_certs );
......
......@@ -115,7 +115,7 @@ void init_enclave() {
int sgxServerInited = 0;
void init_all() {
void init_all(bool check_cert, bool sign_automatically) {
......@@ -124,8 +124,8 @@ void init_all() {
sgxServerInited = 1;
init_server();
init_registration_server();
init_server(check_cert);
init_registration_server(sign_automatically);
init_enclave();
std::cerr << "enclave inited" << std::endl;
init_daemon();
......
......@@ -30,7 +30,7 @@
#define EXTERNC
#endif
EXTERNC void init_all();
EXTERNC void init_all(bool check_cert, bool sign_automatically);
EXTERNC void init_daemon();
......
......@@ -25,6 +25,7 @@
#define SGXD_ABSTRACTREGSERVER_H
#include <jsonrpccpp/server.h>
#include <iostream>
class AbstractRegServer : public jsonrpc::AbstractServer<AbstractRegServer>
{
......@@ -37,7 +38,8 @@ public:
inline virtual void SignCertificateI(const Json::Value &request, Json::Value &response)
{
response = this->SignCertificate( request["certificate"].asString());
std::cerr << "SignCertificateI in abstr server " << std::endl;
response = this->SignCertificate( request["certificate"].asString());
}
inline virtual void GetCertificateI(const Json::Value &request, Json::Value &response)
{
......
This diff is collapsed.
[ ca ]
default_ca = CA_CLIENT # При подписи сертификатов
# использовать секцию CA_CLIENT
[ CA_CLIENT ]
dir = . # Каталог для служебных файлов
certs = $dir/certs # Каталог для сертификатов
new_certs_dir = $dir/new_certs # Каталог для новых сертификатов
database = $dir/index.txt # Файл с базой данных
# подписанных сертификатов
serial = $dir/serial # Файл содержащий серийный номер
RANDFILE = $dir/.rnd
# сертификата
# (в шестнадцатиричном формате)
certificate = ./rootCA.pem # Файл сертификата CA
private_key = ./rootCA.key # Файл закрытого ключа CA
default_days = 3650 # Срок действия подписываемого
# сертификата
default_crl_days = 7 # Срок действия CRL (см. $4)
default_md = sha256 # Алгоритм подписи
name_opt = ca_default
cert_opt = ca_default
policy = policy_anything # Название секции с описанием
# политики в отношении данных
# сертификата
[ policy_anything ]
countryName = optional # Код страны - не обязателен
stateOrProvinceName = optional # ......
localityName = optional # ......
organizationName = optional # ......
organizationalUnitName = optional # ......
commonName = supplied # ...... - обязателен
emailAddress = optional # ......
#!/bin/bash
# Generate root CA key
openssl genrsa -out rootCA.key 2048
# Create an X.509 cert from the CA key
openssl req -x509 -sha256 -nodes -days 1024 -newkey rsa:2048 -key rootCA.key -out rootCA.pem -subj "/CN=SGXCACertificate"
mkdir new_certs
touch index.txt
echo "01" > serial
#!/bin/bash
#sign csr
yes | openssl ca -config ca.config -in "client.csr" -out "client.crt"
#!/bin/bash
# Generate server key
openssl genrsa -out "SGXServerCert.key" 2048
# Create server certificate request
#openssl req -new -key "SGXServer.key" -out "SGXServer.csr" -subj "/CN=SGXCACertificate"
openssl req -new -sha256 -nodes -out "SGXServerCert.csr" -newkey rsa:2048 -keyout "SGXServerCert.key" -subj /CN=SGXServer
# Sign and generate the user certificate from the
#openssl x509 -req -in "SGXServer.csr" -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out "SGXServerCertificate.crt" -days 3650
yes | openssl ca -config ca.config -in "SGXServerCert.csr" -out "SGXServerCert.crt"
#!/bin/bash
# Directories
cur=$(pwd)
tmp=$(mktemp -d)
scriptName=$(basename "$0")
# Certificate Variables
OUTPATH="./"
VERBOSE=0
DURATION=3650 # 10 years
safeExit() {
if [ -d "$tmp" ]; then
if [ $VERBOSE -eq 1 ]; then
echo "Removing temporary directory '${tmp}'"
fi
rm -rf "$tmp"
fi
trap - INT TERM EXIT
exit
}
# Help Screen
help() {
echo -n "${scriptName} [OPTIONS] -c=US --state=California
Generate self-signed TLS certificate using OpenSSL
Options:
-c|--country Country Name (2 letter code)
-s|--state State or Province Name (full name)
-l|--locality Locality Name (eg, city)
-o|--organization Organization Name (eg, company)
-u|--unit Organizational Unit Name (eg, section)
-n|--common-name Common Name (e.g. server FQDN or YOUR name)
-e|--email Email Address
-p|--path Path to output generated keys
-d|--duration Validity duration of the certificate (in days)
-h|--help Display this help and exit
-v|--verbose Verbose output
"
}
# Test output path is valid
testPath() {
if [ ! -d $OUTPATH ]; then
echo "The specified directory \"${OUTPATH}\" does not exist"
exit 1
fi
}
# Process Arguments
while [ "$1" != "" ]; do
PARAM=$(echo "$1" | awk -F= '{print $1}')
VALUE=$(echo "$1" | awk -F= '{print $2}')
case $PARAM in
-h|--help) help; safeExit ;;
-c|--country) C=$VALUE ;;
-s|--state) ST=$VALUE ;;
-l|--locality) L=$VALUE ;;
-o|--organization) O=$VALUE ;;
-u|--unit) OU=$VALUE ;;
-n|--common-name) CN=$VALUE ;;
-e|--email) emailAddress=$VALUE ;;
-p|--path) OUTPATH=$VALUE; testPath ;;
-d|--duration) DURATION=$VALUE ;;
-v|--verbose) VERBOSE=1 ;;
*) echo "ERROR: unknown parameter \"$PARAM\""; help; exit 1 ;;
esac
shift
done
# Prompt for variables that were not provided in arguments
checkVariables() {
# Country
if [ -z "$C" ]; then
echo -n "Country Name (2 letter code) [AU]:"
read -r C
fi
# State
if [ -z "$ST" ]; then
echo -n "State or Province Name (full name) [Some-State]:"
read -r ST
fi
# Locality
if [ -z "$L" ]; then
echo -n "Locality Name (eg, city) []:"
read -r L
fi
# Organization
if [ -z "$O" ]; then
echo -n "Organization Name (eg, company) [Internet Widgits Pty Ltd]:"
read -r O
fi
# Organizational Unit
if [ -z "$OU" ]; then
echo -n "Organizational Unit Name (eg, section) []:"
read -r OU
fi
# Common Name
if [ -z "$CN" ]; then
echo -n "Common Name (e.g. server FQDN or YOUR name) []:"
read -r CN
fi
# Email Address
if [ -z "$emailAddress" ]; then
echo -n "Email Address []:"
read -r emailAddress
fi
}
# Show variable values
showVals() {
echo "Country: ${C}";
echo "State: ${ST}";
echo "Locality: ${L}";
echo "Organization: ${O}";
echo "Organization Unit: ${OU}";
echo "Common Name: ${CN}";
echo "Email: ${emailAddress}";
echo "Output Path: ${OUTPATH}";
echo "Certificate Duration (Days): ${DURATION}";
echo "Verbose: ${VERBOSE}";
}
# Init
init() {
cd "$tmp" || exit
pwd
}
# Cleanup
cleanup() {
echo "Cleaning up"
cd "$cur" || exit
rm -rf "$tmp"
}
buildCsrCnf() {
cat << EOF > "${tmp}/tmp.csr.cnf"
[req]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn
[dn]
C=${C}
ST=${ST}
L=${L}
O=${O}
OU=${OU}
CN=${CN}
emailAddress=${emailAddress}
EOF
}
buildExtCnf() {
cat << EOF > "${tmp}/v3.ext"
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = ${CN}
EOF
}
# Build TLS Certificate
build() {
# Santizie domain name for file name
FILENAME=${CN/\*\./}
# Generate CA key & crt
openssl genrsa -out "${tmp}/tmp.key" 2048
openssl req -x509 -new -nodes -key "${tmp}/tmp.key" -sha256 -days "${DURATION}" -out "${OUTPATH}${FILENAME}_CA.pem" -subj "/C=${C}/ST=${ST}/L=${L}/O=${O}/OU=${OU}/CN=${CN}/emailAddress=${emailAddress}"
# CSR Configuration
buildCsrCnf
# Create v3.ext configuration file
buildExtCnf
# Server key
openssl req -new -sha256 -nodes -out "${OUTPATH}${FILENAME}.csr" -newkey rsa:2048 -keyout "${OUTPATH}${FILENAME}.key" -config <( cat "${tmp}/tmp.csr.cnf" )
# Server certificate
openssl x509 -req -in "${OUTPATH}${FILENAME}.csr" -CA "${OUTPATH}${FILENAME}_CA.pem" -CAkey "${tmp}/tmp.key" -CAcreateserial -out "${OUTPATH}${FILENAME}.crt" -days "${DURATION}" -sha256 -extfile "${tmp}/v3.ext"
}
checkVariables
build
# showVals
safeExit
/usr/share/automake-1.16/compile
\ No newline at end of file
/usr/share/automake-1.15/compile
\ No newline at end of file
/usr/share/automake-1.16/depcomp
\ No newline at end of file
/usr/share/automake-1.15/depcomp
\ No newline at end of file
......@@ -3,8 +3,7 @@ FROM ubuntu:bionic
WORKDIR /usr/src/sdk
RUN apt-get update && apt-get install -yq --no-install-recommends python-yaml vim telnet git ca-certificates build-essential ocaml ocamlbuild automake autoconf libtool wget python libssl-dev libssl-dev libcurl4-openssl-dev protobuf-compiler git libprotobuf-dev alien cmake debhelper uuid-dev libxml2-dev
RUN apt install -y libprotobuf10 cmake flex bison libprocps-dev ccache autoconf texinfo libssl-dev libboost-all-dev libjsonrpccpp-dev libjsonrpccpp-tools
RUN apt install -y libprotobuf10 yasm cmake flex bison libprocps-dev ccache autoconf texinfo libssl-dev libboost-all-dev libjsonrpccpp-dev libjsonrpccpp-tools
COPY install-psw.patch ./
......@@ -18,18 +17,24 @@ RUN git clone -b sgx_2.5 --depth 1 https://github.com/intel/linux-sgx && \
cd .. && rm -rf linux-sgx/
# For debug purposes
# COPY jhi.conf /etc/jhi/jhi.conf
RUN git clone --recurse-submodules https://github.com/skalenetwork/sgxwallet.git
WORKDIR sgxwallet
RUN cd scripts; ./build.py
RUN autoreconf -vif
RUN automake
#RUN cd sgx-software-enable && make && ./sgx_enable
RUN cd scripts; ./build.py
### RUN autoreconf -vif
### RUN automake
RUN autoreconf -vif
RUN libtoolize --force
RUN aclocal
RUN autoheader || true
RUN automake --force-missing --add-missing
RUN autoconf
RUN ./configure
RUN cd libBLS; cmake -H. -Bbuild; cmake --build build -- -j$(nproc);
### RUN cd libBLS; cmake -H. -Bbuild; cmake --build build -- -j$(nproc);
RUN make
RUN wget --progress=dot:mega -O - https://github.com/intel/dynamic-application-loader-host-interface/archive/072d233296c15d0dcd1fb4570694d0244729f87b.tar.gz | tar -xz && \
cd dynamic-application-loader-host-interface-072d233296c15d0dcd1fb4570694d0244729f87b && \
......
#!/bin/bash
#sudo service docker start
#sudo docker build -t sgxcontainer .
sudo docker build --no-cache -t sgxcontainer .
/usr/share/automake-1.16/install-sh
\ No newline at end of file
/usr/share/automake-1.15/install-sh
\ No newline at end of file
#!/bin/bash
export UNIX_SYSTEM_NAME=`uname -s`
export NUMBER_OF_CPU_CORES=1
if [ "$UNIX_SYSTEM_NAME" = "Linux" ];
then
export NUMBER_OF_CPU_CORES=`grep -c ^processor /proc/cpuinfo`
export READLINK=readlink
export SO_EXT=so
fi
if [ "$UNIX_SYSTEM_NAME" = "Darwin" ];
then
#export NUMBER_OF_CPU_CORES=`system_profiler | awk '/Number Of CPUs/{print $4}{next;}'`
export NUMBER_OF_CPU_CORES=`sysctl -n hw.ncpu`
# required -> brew install coreutils
export READLINK=/usr/local/bin/greadlink
export SO_EXT=dylib
fi
INSTALL_ROOT_RELATIVE="../libBLS/deps/deps_inst/x86_or_x64/"
INSTALL_ROOT=`$READLINK -f $INSTALL_ROOT_RELATIVE`
TOP_CMAKE_BUILD_TYPE="Release"
if [ "$DEBUG" = "1" ];
then
DEBUG=1
TOP_CMAKE_BUILD_TYPE="Debug"
DEBUG_D="d"
CONF_DEBUG_OPTIONS="--enable-debug"
else
DEBUG=0
DEBUG_D=""
CONF_DEBUG_OPTIONS=""
fi
export OPENSSL_SRC_RELATIVE="../libBLS/deps/openssl"
export OPENSSL_SRC=`$READLINK -f $OPENSSL_SRC_RELATIVE`
git clone https://github.com/madler/zlib.git
cd zlib
./configure --static --prefix=$INSTALL_ROOT
make
make install
cd ..
git clone https://github.com/jonathanmarvens/argtable2.git
cd argtable2
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT -DCMAKE_BUILD_TYPE=$TOP_CMAKE_BUILD_TYPE ..
make
make install
cd ../..
tar -xzf ./pre_downloaded/jsoncpp.tar.gz
cd jsoncpp
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT -DCMAKE_BUILD_TYPE=$TOP_CMAKE_BUILD_TYPE \
-DBUILD_SHARED_LIBS=NO \
-DBUILD_STATIC_LIBS=YES \
..
make
make install
cd ../..
git clone https://github.com/curl/curl.git
cd curl
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT -DOPENSSL_ROOT_DIR=$OPENSSL_SRC -DBUILD_CURL_EXE=OFF -DBUILD_TESTING=OFF -DCMAKE_USE_LIBSSH2=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_LDAP=ON -DCURL_STATICLIB=ON -DCMAKE_BUILD_TYPE=$TOP_CMAKE_BUILD_TYPE ..
echo " " >> lib/curl_config.h
echo "#define HAVE_POSIX_STRERROR_R 1" >> lib/curl_config.h
echo " " >> lib/curl_config.h
### Set HAVE_POSIX_STRERROR_R to 1 in build/lib/curl_config.h
make
make install
cd ../..
git clone https://github.com/scottjg/libmicrohttpd.git
cd libmicrohttpd
MHD_HTTPS_OPT=""
if [ "$WITH_GCRYPT" = "yes" ];
then
MHD_HTTPS_OPT="--enable-https"
fi
./bootstrap
./configure --enable-static --disable-shared --with-pic --prefix=$INSTALL_ROOT $MHD_HTTPS_OPT
make
make install
cd ..
#tar -xzf ./pre_downloaded/libjson-rpc-cpp.tar.gz
git clone https://github.com/skalenetwork/libjson-rpc-cpp.git --recursive
cd libjson-rpc-cpp
git checkout develop
git pull
rn -rf build || true
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT -DCMAKE_BUILD_TYPE=$TOP_CMAKE_BUILD_TYPE \
-DBUILD_SHARED_LIBS=NO \
-DBUILD_STATIC_LIBS=YES \
-DUNIX_DOMAIN_SOCKET_SERVER=YES \
-DUNIX_DOMAIN_SOCKET_CLIENT=YES \
-DFILE_DESCRIPTOR_SERVER=YES \
-DFILE_DESCRIPTOR_CLIENT=YES \
-DTCP_SOCKET_SERVER=YES \
-DTCP_SOCKET_CLIENT=YES \
-DREDIS_SERVER=NO \
-DREDIS_CLIENT=NO \
-DHTTP_SERVER=YES \
-DHTTP_CLIENT=YES \
-DCOMPILE_TESTS=NO \
-DCOMPILE_STUBGEN=YES \
-DCOMPILE_EXAMPLES=NO \
-DWITH_COVERAGE=NO \
-DARGTABLE_INCLUDE_DIR=../../argtable2/src \
-DARGTABLE_LIBRARY=$INSTALL_ROOT/lib/libargtable2${DEBUG_D}.a \
-DJSONCPP_INCLUDE_DIR=$INSTALL_ROOT/include \
..
make
make install
cd ../..
Subproject commit f69e2c2c3d022f60143e2bfb97eae4313abb34d1
Subproject commit 78ea56c3b5251e9d840ef65705bb2c5f8f193662
/usr/share/automake-1.16/missing
\ No newline at end of file
/usr/share/automake-1.15/missing
\ No newline at end of file
#!/usr/bin/env python
#------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Bash script to build cpp-ethereum within TravisCI.
#
# The documentation for cpp-ethereum is hosted at http://cpp-ethereum.org
......@@ -22,7 +22,7 @@
# along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>
#
# (c) 2016 cpp-ethereum contributors.
#------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
#
# Copyright (C) 2018-2019 SKALE Labs
#
......@@ -49,116 +49,81 @@
import sys
import os
import subprocess
os.chdir("..");
topDir = os.getcwd();
os.chdir("..")
topDir = os.getcwd()
print("Starting build")
print("Top directory is:" + topDir )
print("Top directory is:" + topDir)
makeExecutable = subprocess.check_output(["which", "make"])
SCRIPTS_DIR = topDir + "/scripts"
GMP_DIR = topDir + "/sgx-gmp"
SSL_DIR = topDir + "/intel-sgx-ssl"
GMP_DIR = topDir + "/sgx-gmp"
SSL_DIR = topDir + "/intel-sgx-ssl"
SSL_SOURCE_DIR = SSL_DIR + "/openssl_source"
SSL_MAKE_DIR = SSL_DIR + "/Linux"
SGX_SDK_DIR_SSL = topDir + "/sgx-sdk-build/sgxsdk"
LEVELDB_DIR = topDir + "/leveldb"
LEVELDB_BUILD_DIR = LEVELDB_DIR + "/build"
GMP_BUILD_DIR = topDir + "/gmp-build"
TGMP_BUILD_DIR = topDir + "/tgmp-build"
SDK_DIR = topDir + "/sgx-sdk-build"
BLS_DIR = topDir + "/libBLS"
BLS_BUILD_DIR = BLS_DIR + "/build"
JSON_LIBS_DIR = topDir + "/jsonrpc"
#subprocess.call(["git", "submodule", "update", "--init"])
subprocess.call(["git", "submodule", "update", "--init"])
subprocess.call(["rm", "-f", "install-sh"])
subprocess.call(["rm", "-f", "compile"])
subprocess.call(["rm", "-f", "missing"])
subprocess.call(["rm", "-f", "depcomp"])
subprocess.call(["rm", "-rf", GMP_BUILD_DIR])
subprocess.call(["rm", "-rf", TGMP_BUILD_DIR])
subprocess.call(["rm", "-rf", SDK_DIR])
subprocess.call(["rm", "-rf", GMP_BUILD_DIR])
subprocess.call(["rm", "-rf", TGMP_BUILD_DIR])
subprocess.call(["rm", "-rf", SDK_DIR])
assert subprocess.call(["cp", "configure.gmp", GMP_DIR + "/configure"]) == 0
os.chdir(LEVELDB_DIR)
assert subprocess.call(["bash", "-c", "mkdir -p build"]) == 0
os.chdir(LEVELDB_BUILD_DIR)
assert subprocess.call(["bash", "-c", "cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build ."]) == 0
os.chdir(LEVELDB_DIR);
assert subprocess.call(["bash","-c", "mkdir -p build"]) == 0
os.chdir(LEVELDB_BUILD_DIR);
assert subprocess.call(["bash","-c", "cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build ."]) == 0
os.chdir(BLS_DIR);
assert subprocess.call(["bash","-c", "cmake -H. -Bbuild && cmake --build build -- -j8"]) == 0
#os.chdir(BLS_BUILD_DIR);
# assert subprocess.call(["bash","-c", "make"]) == 0
os.chdir(BLS_DIR + "/deps")
assert subprocess.call(["bash", "-c", "./build.sh"]) == 0
os.chdir(BLS_DIR)
assert subprocess.call(["bash", "-c", "cmake -H. -Bbuild"]) == 0
os.chdir(BLS_DIR + "/build")
assert subprocess.call(["bash", "-c", "make"]) == 0
os.chdir(JSON_LIBS_DIR)
assert subprocess.call(["bash", "-c", "./build.sh"]) == 0
os.chdir(SCRIPTS_DIR)
assert subprocess.call(["bash", "-c", "./sgx_linux_x64_sdk_2.5.100.49891.bin --prefix=" + topDir + "/sgx-sdk-build"]) == 0
assert subprocess.call(["bash","-c", "./sgx_linux_x64_sdk_2.5.100.49891.bin --prefix=" + topDir + "/sgx-sdk-build"]) == 0
os.chdir(GMP_DIR);
assert subprocess.call(["bash", "-c", "./configure --prefix=" + TGMP_BUILD_DIR + " --disable-shared " +
" --enable-static --with-pic --enable-sgx --with-sgxsdk=" + SDK_DIR + "/sgxsdk" ]) == 0
os.chdir(GMP_DIR)
assert subprocess.call(["bash", "-c", "./configure --prefix=" + TGMP_BUILD_DIR + " --disable-shared --enable-static --with-pic --enable-sgx --with-sgxsdk=" + SDK_DIR + "/sgxsdk"]) == 0
assert subprocess.call(["make", "install"]) == 0
assert subprocess.call(["make", "clean"]) == 0
assert subprocess.call(["bash", "-c", "./configure --prefix=" + GMP_BUILD_DIR + " --disable-shared --enable-static --with-pic --with-sgxsdk=" + SDK_DIR + "/sgxsdk"]) == 0
assert subprocess.call(["bash", "-c", "./configure --prefix=" + GMP_BUILD_DIR + " --disable-shared " +
" --enable-static --with-pic --with-sgxsdk=" + SDK_DIR + "/sgxsdk"]) == 0
assert subprocess.call(["make", "install"]) == 0
assert subprocess.call(["make", "clean"]) == 0
os.chdir(topDir)
assert subprocess.call(["cp", "sgx_tgmp.h", TGMP_BUILD_DIR + "/include/sgx_tgmp.h"]) == 0
os.chdir(SSL_DIR);
print("===>>> Downloading vanilla openssl source package")
os.chdir(SSL_SOURCE_DIR);
os.chdir(SSL_DIR)
print "===>>> Downloading vanilla openssl source package"
os.chdir(SSL_SOURCE_DIR)
assert subprocess.call(["wget", "https://www.openssl.org/source/openssl-1.1.1b.tar.gz"]) == 0
print("===>>> Making SSL project")
os.chdir(SSL_MAKE_DIR);
assert subprocess.call(["make", "SGX_SDK=" + SGX_SDK_DIR_SSL, "all"]) == 0
print "===>>> Making SSL project"
os.chdir(SSL_MAKE_DIR)
#assert subprocess.call(["make", "SGX_SDK=" + SGX_SDK_DIR_SSL, "all", "test"]) == 0
assert subprocess.call(["make", "SGX_SDK=" + SGX_SDK_DIR_SSL, "all" ]) == 0
os.chdir(topDir)
print("Build successfull.")
apt install -y libprotobuf10 cmake flex bison libprocps-dev ccache autoconf texinfo libssl-dev libboost-all-dev libjsonrpccpp-dev libjsonrpccpp-tools
dpkg -i libsgx-enclave-common_2.5.101.50123-bionic1_amd64.deb
sudo dpkg -i *.deb
sudo apt install cmake flex bison yasm ccache autoconf texinfo libgcrypt20-dev libgnutls28-dev
This diff is collapsed.
This diff is collapsed.
ECDSAUtils.o: ECDSAUtils.c ECDSAUtils.h ../tgmp-build/include/sgx_tgmp.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h \
domain_parameters.h point.h signature.h curves.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/string.h
ECDSAUtils.h:
../tgmp-build/include/sgx_tgmp.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h:
domain_parameters.h:
point.h:
signature.h:
curves.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/string.h:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
curves.o: curves.c ../tgmp-build/include/sgx_tgmp.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdio.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h \
domain_parameters.h curves.h point.h
../tgmp-build/include/sgx_tgmp.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdio.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h:
domain_parameters.h:
curves.h:
point.h:
domain_parameters.o: domain_parameters.c ../tgmp-build/include/sgx_tgmp.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/string.h \
domain_parameters.h point.h
../tgmp-build/include/sgx_tgmp.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/string.h:
domain_parameters.h:
point.h:
numbertheory.o: numbertheory.c \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdio.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h \
../tgmp-build/include/sgx_tgmp.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h \
numbertheory.h
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdio.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h:
../tgmp-build/include/sgx_tgmp.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h:
numbertheory.h:
point.o: point.c \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdio.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h \
../tgmp-build/include/sgx_tgmp.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/string.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/assert.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h \
domain_parameters.h point.h numbertheory.h
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdio.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h:
../tgmp-build/include/sgx_tgmp.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/string.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/assert.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h:
domain_parameters.h:
point.h:
numbertheory.h:
secure_enclave.o: secure_enclave.c secure_enclave_t.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdint.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/stdint.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/wchar.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_edger8r.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_defs.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_error.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_eid.h \
/home/kladko/sgxwallet/tgmp-build/include/sgx_tgmp.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_tcrypto.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_attributes.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_key.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_report.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_tseal.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_tcrypto.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_trts.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/math.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/float.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/string.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdio.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h \
domain_parameters.h point.h signature.h curves.h DH_dkg.h \
../sgxwallet_common.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/unistd.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/types.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/endian.h
secure_enclave_t.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdint.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/stdint.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/wchar.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_edger8r.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_defs.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_error.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_eid.h:
/home/kladko/sgxwallet/tgmp-build/include/sgx_tgmp.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_tcrypto.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_attributes.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_key.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_report.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_tseal.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_tcrypto.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_trts.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/math.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/float.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/string.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdio.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h:
domain_parameters.h:
point.h:
signature.h:
curves.h:
DH_dkg.h:
../sgxwallet_common.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/unistd.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/types.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/endian.h:
secure_enclave_t.o: secure_enclave_t.c secure_enclave_t.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdint.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/stdint.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/wchar.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_edger8r.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_defs.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_error.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_eid.h \
/home/kladko/sgxwallet/tgmp-build/include/sgx_tgmp.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_trts.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_lfence.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/errno.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/mbusafecrt.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/string.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h
secure_enclave_t.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdint.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/stdint.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/wchar.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_edger8r.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_defs.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_error.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_eid.h:
/home/kladko/sgxwallet/tgmp-build/include/sgx_tgmp.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_trts.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/sgx_lfence.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/errno.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/mbusafecrt.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/string.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h:
sha1.o: sha1.c \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdint.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/stdint.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdio.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/string.h
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdint.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/stdint.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdio.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/string.h:
signature.o: signature.c \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdio.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h \
../tgmp-build/include/sgx_tgmp.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h \
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/assert.h \
domain_parameters.h point.h signature.h numbertheory.h
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdio.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h:
../tgmp-build/include/sgx_tgmp.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/stdbool.h:
/home/kladko/sgxwallet/sgx-sdk-build/sgxsdk/include/tlibc/assert.h:
domain_parameters.h:
point.h:
signature.h:
numbertheory.h:
......@@ -63,7 +63,7 @@ ENCLAVE_KEY=$(ENCLAVE)_private.pem
## Additional Automake flags needed to build the enclave.
##
AM_CPPFLAGS += -Wall -Wno-implicit-function-declaration $(TGMP_CPPFLAGS) -I../trusted_libff -I../sgx-sdk-build/sgxsdk/include/libcxx \
AM_CPPFLAGS += -Wall -Wno-implicit-function-declaration $(TGMP_CPPFLAGS) -I./trusted_libff -I../trusted_libff -I../sgx-sdk-build/sgxsdk/include/libcxx \
-I../intel-sgx-ssl/Linux/package/include
AM_CXXFLAGS += -fno-builtin
......@@ -79,7 +79,7 @@ CLEANFILES+= secure_enclave_t.c secure_enclave_t.h
## SGX_EDGER8R_FLAGS=
## Put your sources here. Don't forget to list the _t.c and _t.h
## Put your sources here. Don't forget to list the _t.c and _t.h
## files. You can't use the $(ENCLAVE) variable in the build
## target name (i.e., $(ENCLAVE)_SOURCES will not work).
......@@ -91,16 +91,16 @@ secure_enclave_SOURCES = secure_enclave_t.c secure_enclave_t.h \
../trusted_libff/libff/algebra/curves/alt_bn128/alt_bn128_g1.cpp $(ENCLAVE_KEY) $(ENCLAVE_CONFIG)
## Add additional linker flags to AM_LDFLAGS here. Don't put
## Add additional linker flags to AM_LDFLAGS here. Don't put
## libraries flags here (see below).
##
## Be sure to use += to add to, and not replace, the default
## Be sure to use += to add to, and not replace, the default
## AM_LDFLAGS.
AM_LDFLAGS += $(TGMP_LDFLAGS)
AM_LDFLAGS += $(TGMP_LDFLAGS) -L./tgmp-build/lib -L../tgmp-build/lib
## This line is REQUIRED. It can't be generically defined for
## This line is REQUIRED. It can't be generically defined for
## automake, so you must specify it for your enclave. Note that you
## can't say $(ENCLAVE)_LDADD here: you must spell out the enclave name.
## If you add flags to it, you MUST include @SGX_ENCLAVE_LDADD@ as part
......@@ -111,7 +111,7 @@ secure_enclave_LDADD = @SGX_ENCLAVE_LDADD@
## Place any additional trusted libraries that your enclave may need in
## SGX_EXTRA_TLIBS. This will ensure they get place inside the
## SGX_EXTRA_TLIBS. This will ensure they get place inside the
## --startgroup and --endgroup flags. (This would be where you'd add
## SGXSSL libraries, and your trusted c++ library
......@@ -123,9 +123,8 @@ SGX_EXTRA_TLIBS=-lsgx_tgmp -lsgx_tservice -lsgx_urts -lsgx_tcxx ../intel-sgx-ss
##
## In general, you shouldn't need to use the program-specific LDFLAGS
## instead of AM_LDFLAGS. But, if you need to, then you'll need to ensure
## @SGX_ENCLAVE_LDFLAGS@ is included in the definition as this will
## @SGX_ENCLAVE_LDFLAGS@ is included in the definition as this will
## override AM_LDFLAGS.
##
## secure_enclave_LDFLAGS = @SGX_ENCLAVE_LDFLAGS@
##
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -137,15 +137,7 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/BLSEnclave.Po ./$(DEPDIR)/DH_dkg.Po \
./$(DEPDIR)/DKGUtils.Po ./$(DEPDIR)/alt_bn128_g1.Po \
./$(DEPDIR)/alt_bn128_g2.Po ./$(DEPDIR)/alt_bn128_init.Po \
./$(DEPDIR)/curves.Po ./$(DEPDIR)/domain_parameters.Po \
./$(DEPDIR)/numbertheory.Po ./$(DEPDIR)/point.Po \
./$(DEPDIR)/secure_enclave.Po ./$(DEPDIR)/secure_enclave_t.Po \
./$(DEPDIR)/signature.Po ./$(DEPDIR)/signed_enclave_debug.Po \
./$(DEPDIR)/signed_enclave_rel.Po
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
......@@ -330,10 +322,12 @@ SGXSSL_BINDIR = @SGXSSL_BINDIR@
AM_CFLAGS = @SGX_ENCLAVE_CFLAGS@
AM_CPPFLAGS = @SGX_ENCLAVE_CPPFLAGS@ -Wall \
-Wno-implicit-function-declaration $(TGMP_CPPFLAGS) \
-I../trusted_libff -I../sgx-sdk-build/sgxsdk/include/libcxx \
-I./trusted_libff -I../trusted_libff \
-I../sgx-sdk-build/sgxsdk/include/libcxx \
-I../intel-sgx-ssl/Linux/package/include
AM_CXXFLAGS = @SGX_ENCLAVE_CXXFLAGS@ @SGX_ENCLAVE_CFLAGS@ -fno-builtin
AM_LDFLAGS = @SGX_ENCLAVE_LDFLAGS@ $(TGMP_LDFLAGS)
AM_LDFLAGS = @SGX_ENCLAVE_LDFLAGS@ $(TGMP_LDFLAGS) -L./tgmp-build/lib \
-L../tgmp-build/lib
CLEANFILES = $(ENCLAVE).signed.so secure_enclave_t.c \
secure_enclave_t.h
@ENCLAVE_RELEASE_SIGN_TRUE@nodist_signed_enclave_rel_SOURCES = signed_enclave_rel.c
......@@ -371,8 +365,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_srcdir)/build-aux/sgx_enclave.am $(am__empty):
......@@ -437,27 +431,21 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BLSEnclave.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DH_dkg.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DKGUtils.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alt_bn128_g1.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alt_bn128_g2.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alt_bn128_init.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curves.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/domain_parameters.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numbertheory.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/point.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secure_enclave.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secure_enclave_t.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signature.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signed_enclave_debug.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signed_enclave_rel.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BLSEnclave.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DH_dkg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DKGUtils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alt_bn128_g1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alt_bn128_g2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alt_bn128_init.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curves.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/domain_parameters.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numbertheory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/point.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secure_enclave.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secure_enclave_t.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signature.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signed_enclave_debug.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signed_enclave_rel.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
......@@ -581,10 +569,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
......@@ -657,21 +642,7 @@ clean: clean-am
clean-am: clean-generic clean-libexecPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -f ./$(DEPDIR)/BLSEnclave.Po
-rm -f ./$(DEPDIR)/DH_dkg.Po
-rm -f ./$(DEPDIR)/DKGUtils.Po
-rm -f ./$(DEPDIR)/alt_bn128_g1.Po
-rm -f ./$(DEPDIR)/alt_bn128_g2.Po
-rm -f ./$(DEPDIR)/alt_bn128_init.Po
-rm -f ./$(DEPDIR)/curves.Po
-rm -f ./$(DEPDIR)/domain_parameters.Po
-rm -f ./$(DEPDIR)/numbertheory.Po
-rm -f ./$(DEPDIR)/point.Po
-rm -f ./$(DEPDIR)/secure_enclave.Po
-rm -f ./$(DEPDIR)/secure_enclave_t.Po
-rm -f ./$(DEPDIR)/signature.Po
-rm -f ./$(DEPDIR)/signed_enclave_debug.Po
-rm -f ./$(DEPDIR)/signed_enclave_rel.Po
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
......@@ -717,21 +688,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/BLSEnclave.Po
-rm -f ./$(DEPDIR)/DH_dkg.Po
-rm -f ./$(DEPDIR)/DKGUtils.Po
-rm -f ./$(DEPDIR)/alt_bn128_g1.Po
-rm -f ./$(DEPDIR)/alt_bn128_g2.Po
-rm -f ./$(DEPDIR)/alt_bn128_init.Po
-rm -f ./$(DEPDIR)/curves.Po
-rm -f ./$(DEPDIR)/domain_parameters.Po
-rm -f ./$(DEPDIR)/numbertheory.Po
-rm -f ./$(DEPDIR)/point.Po
-rm -f ./$(DEPDIR)/secure_enclave.Po
-rm -f ./$(DEPDIR)/secure_enclave_t.Po
-rm -f ./$(DEPDIR)/signature.Po
-rm -f ./$(DEPDIR)/signed_enclave_debug.Po
-rm -f ./$(DEPDIR)/signed_enclave_rel.Po
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
......@@ -751,19 +708,19 @@ uninstall-am: uninstall-libexecPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-generic clean-libexecPROGRAMS cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am \
install-libexecPROGRAMS install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-libexecPROGRAMS
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libexecPROGRAMS cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-libexecPROGRAMS \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-libexecPROGRAMS
.PRECIOUS: Makefile
......
......@@ -38,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "BLSCrypto.h"
#include "ServerInit.h"
#include <stdbool.h>
void usage() {
fprintf(stderr, "usage: sgxwallet\n");
......@@ -52,26 +52,40 @@ int updated;
int main(int argc, char *argv[]) {
bool check_client_cert = true;
bool sign_automatically = false;
int opt;
while ((opt = getopt(argc, argv, "h")) != -1) {
if (argc > 1 && strlen(argv[1])==1){
fprintf(stderr, "option is too short %s\n", argv[1]);
exit(1);
}
while ((opt = getopt(argc, argv, "csh")) != -1) {
switch (opt) {
case 'h':
// case 'h':
// if (strlen(argv[1]) == 2 ) {
// fprintf(stderr, "-c client certificate will not be checked\n");
// fprintf(stderr, "-s client certificate will be signed automatically\n");
// exit(0);
// } else {
// fprintf(stderr, "unknown flag %s\n", argv[1]);
// exit(1);
// }
case 'c':
check_client_cert = false;
break;
case 's':
sign_automatically = true;
break;
case '?': // fprintf(stderr, "unknown flag\n");
exit(1);
default:
usage();
break;
}
}
argc -= optind;
argv += optind;
if (argc != 0)
usage();
init_all();
init_all(check_client_cert, sign_automatically);
while (true) {
sleep(10);
......
......@@ -136,7 +136,7 @@ char* encryptTestKey() {
TEST_CASE("BLS key encrypt", "[bls-key-encrypt]") {
init_all();
init_all(false, false);
char* key = encryptTestKey();
REQUIRE(key != nullptr);
......@@ -147,7 +147,7 @@ TEST_CASE("BLS key encrypt/decrypt", "[bls-key-encrypt-decrypt]") {
{
init_all();
init_all(false, false);
int errStatus = -1;
char* errMsg = (char*) calloc(BUF_LEN, 1);
......@@ -173,7 +173,7 @@ TEST_CASE("BLS key encrypt/decrypt", "[bls-key-encrypt-decrypt]") {
TEST_CASE("BLS key import", "[bls-key-import]") {
reset_db();
init_all();
init_all(false, false);
......@@ -215,7 +215,8 @@ TEST_CASE("Server BLS sign test", "[bls-server-sign]") {
reset_db();
init_all();
init_all(false, false);
auto result = importBLSKeyShareImpl( TEST_BLS_KEY_SHARE, TEST_BLS_KEY_NAME, 2, 2, 1);
......@@ -741,7 +742,7 @@ std::string ConvertDecToHex(std::string dec, int numBytes = 32){
TEST_CASE("BLS_DKG test", "[bls_dkg]") {
std::cerr<< "test started" << std::endl;
init_all();
init_all(false, false);
cerr << "Server inited" << endl;
HttpClient client("http://localhost:1028");
StubClient c(client, JSONRPC_CLIENT_V2);
......@@ -857,7 +858,7 @@ TEST_CASE("API test", "[api_test]") {
//std::cerr << __GNUC__ << std::endl;
cerr << "API test started" << endl;
init_all();
init_all(false, false);
//HttpServer httpserver(1025);
//SGXWalletServer s(httpserver,
// JSONRPC_SERVER_V2); // hybrid server (json-rpc 1.0 & 2.0)
......@@ -956,7 +957,7 @@ TEST_CASE("API test", "[api_test]") {
}
TEST_CASE("getServerStatus test", "[getServerStatus_test]") {
init_all();
init_all( false, false );
HttpClient client("http://localhost:1028");
StubClient c(client, JSONRPC_CLIENT_V2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment