Dobavili eshe fignju

parent 3c31e5a9
......@@ -18,7 +18,8 @@ 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);
EXTERNC bool sign(const char* encryptedKeyHex, const char* hashHex, size_t t, size_t n,
size_t signerIndex, char* _sig);
EXTERNC int char2int(char _input);
......
......@@ -88,9 +88,9 @@ 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 -ljsoncpp -lprocps
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 -ljsoncpp -lprocps intel-sgx-ssl/Linux/package/lib64/libsgx_usgxssl.a
testw_SOURCES=testw.cpp SGXWalletServer.cpp RPCException.cpp BLSCrypto.cpp ServerInit.cpp LevelDB.cpp BLSPrivateKeyShareSGX.cpp $(COMMON_SRC)
nodist_testw_SOURCES=${nodist_sgxwallet_SOURCES}
EXTRA_testw_DEPENDENCIES=${EXTRA_sgxwallet_DEPENDENCIES}
testw_LDADD= ${sgxwallet_LDADD}
\ No newline at end of file
testw_LDADD= ${sgxwallet_LDADD}
......@@ -33,5 +33,5 @@ SGX_UAE_SERVICE_LIB=@SGX_UAE_SERVICE_LIB@
if SGX_ENABLED
%_u.h %_u.c: %.edl
$(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR) $(SGX_EDGER8R_FLAGS) --untrusted $<
$(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR):/d/sgxwallet/intel-sgx-ssl/Linux/package/include $(SGX_EDGER8R_FLAGS) --untrusted $<
endif
......@@ -47,7 +47,7 @@ CLEANFILES = $(ENCLAVE).signed.so
## Rule to make trusted proxy functions from an EDL file.
%_t.h %_t.c: %.edl
$(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR) $(SGX_EDGER8R_FLAGS) --trusted $<
$(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR):/d/sgxwallet/intel-sgx-ssl/Linux/package/include $(SGX_EDGER8R_FLAGS) --trusted $<
## When building a debug enclave, go ahead and sign directly using the
## supplied private key.
......
......@@ -22,5 +22,5 @@ AM_CXXFLAGS=@SGX_TLIB_CXXFLAGS@
## Rule to make trusted proxy functions from an EDL file.
%_t.h %_t.c: %.edl
$(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR) $(SGX_EDGER8R_FLAGS) --trusted $<
$(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR):/d/sgxwallet/intel-sgx-ssl/Linux/package/include $(SGX_EDGER8R_FLAGS) --trusted $<
......@@ -113,7 +113,8 @@ secure_enclave_LDADD = @SGX_ENCLAVE_LDADD@
## --startgroup and --endgroup flags. (This would be where you'd add
## SGXSSL libraries, and your trusted c++ library
SGX_EXTRA_TLIBS=-lsgx_tgmp -lsgx_tservice -lsgx_urts -lsgx_tcxx ../intel-sgx-ssl/Linux/package/lib64/libsgx_tsgxssl_crypto.a
SGX_EXTRA_TLIBS=-lsgx_tgmp -lsgx_tservice -lsgx_urts -lsgx_tcxx ../intel-sgx-ssl/Linux/package/lib64/libsgx_tsgxssl_crypto.a \
../intel-sgx-ssl/Linux/package/lib64/libsgx_tsgxssl.a
......
......@@ -277,7 +277,7 @@ void ecdsa_sign_message(int *err_status, char *err_string, uint8_t *encrypted_ke
decrypt_key(err_status, err_string, encrypted_key, enc_len, key);
if (err_status != 0) {
if (*err_status != 0) {
return;
}
......
enclave {
from "sgx_tsgxssl.edl" import *;
trusted {
include "sgx_tgmp.h"
......
......@@ -94,6 +94,14 @@ char* encryptTestKey() {
}
class StartFromScratch {
public:
StartFromScratch() {
}
};
TEST_CASE("BLS key encrypt", "[bls-key-encrypt]") {
......@@ -162,17 +170,12 @@ TEST_CASE("BLS sign test", "[bls-sign]") {
strncpy(hexHashBuf, hexHash, BUF_LEN);
char sig[BUF_LEN];
REQUIRE(sign(encryptedKeyHex, hexHashBuf, 2, 2, 1, sig));
printf("Signature is: %s \n", sig );
}
TEST_CASE("Server BLS sign test", "[bls-server-sign]") {
......@@ -187,10 +190,8 @@ TEST_CASE("Server BLS sign test", "[bls-server-sign]") {
REQUIRE(result["encryptedKeyShare"] != "");
const char *hexHash = "001122334455667788" "001122334455667788" "001122334455667788" "001122334455667788";
REQUIRE_NOTHROW(result = blsSignMessageHashImpl(TEST_BLS_KEY_NAME, hexHash));
if (result["status"] != 0) {
......
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