Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
1a0d5457
Unverified
Commit
1a0d5457
authored
Jan 22, 2020
by
svetaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2003 Add changed files to git
parent
03c6d6dd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
6 deletions
+12
-6
DKGCrypto.cpp
DKGCrypto.cpp
+0
-1
Makefile.am
Makefile.am
+2
-2
ServerInit.cpp
ServerInit.cpp
+3
-0
secure_enclave.c
secure_enclave/secure_enclave.c
+7
-3
No files found.
DKGCrypto.cpp
View file @
1a0d5457
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
#include "sgxwallet.h"
#include "sgxwallet.h"
#include <iostream>
#include <iostream>
#include <memory>
#include <memory>
#include <memory>
#include "SGXWalletServer.hpp"
#include "SGXWalletServer.hpp"
#include "RPCException.h"
#include "RPCException.h"
...
...
Makefile.am
View file @
1a0d5457
...
@@ -67,7 +67,7 @@ COMMON_SRC = sgx_stub.c sgx_detect_linux.c create_enclave.c oc_alloc.c
...
@@ -67,7 +67,7 @@ COMMON_SRC = sgx_stub.c sgx_detect_linux.c create_enclave.c oc_alloc.c
COMMON_ENCLAVE_SRC
=
secure_enclave_u.c secure_enclave_u.h
COMMON_ENCLAVE_SRC
=
secure_enclave_u.c secure_enclave_u.h
sgxwallet_SOURCES
=
sgxwallet.c SGXWalletServer.cpp SGXRegistrationServer.cpp CSRManagerServer.cpp RPCException.cpp BLSCrypto.cpp ECDSACrypto.cpp
\
sgxwallet_SOURCES
=
sgxwallet.c SGXWalletServer.cpp SGXRegistrationServer.cpp CSRManagerServer.cpp RPCException.cpp BLSCrypto.cpp ECDSACrypto.cpp
\
DKGCrypto.cpp ServerInit.cpp BLSPrivateKeyShareSGX.cpp LevelDB.cpp ServerDataChecker.cpp
$(COMMON_SRC)
DKGCrypto.cpp ServerInit.cpp BLSPrivateKeyShareSGX.cpp LevelDB.cpp ServerDataChecker.cpp
SEKManager.cpp
$(COMMON_SRC)
nodist_sgxwallet_SOURCES
=
$(COMMON_ENCLAVE_SRC)
nodist_sgxwallet_SOURCES
=
$(COMMON_ENCLAVE_SRC)
...
@@ -102,7 +102,7 @@ sgxwallet_LDADD=-l$(SGX_URTS_LIB) -LlibBLS/deps/deps_inst/x86_or_x64/lib -Llevel
...
@@ -102,7 +102,7 @@ sgxwallet_LDADD=-l$(SGX_URTS_LIB) -LlibBLS/deps/deps_inst/x86_or_x64/lib -Llevel
testw_SOURCES
=
testw.cpp stubclient.cpp SGXWalletServer.cpp RPCException.cpp BLSCrypto.cpp ServerInit.cpp LevelDB.cpp
\
testw_SOURCES
=
testw.cpp stubclient.cpp SGXWalletServer.cpp RPCException.cpp BLSCrypto.cpp ServerInit.cpp LevelDB.cpp
\
DKGCrypto.cpp BLSPrivateKeyShareSGX.cpp ECDSACrypto.cpp ServerDataChecker.cpp SGXRegistrationServer.cpp CSRManagerServer.cpp
$(COMMON_SRC)
DKGCrypto.cpp BLSPrivateKeyShareSGX.cpp ECDSACrypto.cpp ServerDataChecker.cpp S
EKManager.cpp S
GXRegistrationServer.cpp CSRManagerServer.cpp
$(COMMON_SRC)
nodist_testw_SOURCES
=
${
nodist_sgxwallet_SOURCES
}
nodist_testw_SOURCES
=
${
nodist_sgxwallet_SOURCES
}
EXTRA_testw_DEPENDENCIES
=
${
EXTRA_sgxwallet_DEPENDENCIES
}
EXTRA_testw_DEPENDENCIES
=
${
EXTRA_sgxwallet_DEPENDENCIES
}
testw_LDADD
=
${
sgxwallet_LDADD
}
testw_LDADD
=
${
sgxwallet_LDADD
}
...
...
ServerInit.cpp
View file @
1a0d5457
...
@@ -52,6 +52,8 @@
...
@@ -52,6 +52,8 @@
#include "BLSCrypto.h"
#include "BLSCrypto.h"
#include "ServerInit.h"
#include "ServerInit.h"
#include "SEKManager.h"
#include <iostream>
#include <iostream>
#include "spdlog/spdlog.h"
#include "spdlog/spdlog.h"
...
@@ -88,6 +90,7 @@ void init_daemon() {
...
@@ -88,6 +90,7 @@ void init_daemon() {
std
::
shared_ptr
<
std
::
string
>
encr_SEK_ptr
=
levelDb
->
readString
(
"SEK"
);
std
::
shared_ptr
<
std
::
string
>
encr_SEK_ptr
=
levelDb
->
readString
(
"SEK"
);
if
(
encr_SEK_ptr
==
nullptr
){
if
(
encr_SEK_ptr
==
nullptr
){
spdlog
::
info
(
"SEK was not created yet"
);
spdlog
::
info
(
"SEK was not created yet"
);
generate_SEK
();
}
}
}
}
...
...
secure_enclave/secure_enclave.c
View file @
1a0d5457
...
@@ -53,7 +53,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
...
@@ -53,7 +53,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../sgxwallet_common.h"
#include "../sgxwallet_common.h"
uint8_t
Decrypted_dkg_poly
[
DKG_BUFER_LENGTH
]
;
uint8_t
Decrypted_dkg_poly
[
DKG_BUFER_LENGTH
];
uint8_t
SEK
[
32
];
void
*
(
*
gmp_realloc_func
)(
void
*
,
size_t
,
size_t
);
void
*
(
*
gmp_realloc_func
)(
void
*
,
size_t
,
size_t
);
...
@@ -900,9 +901,12 @@ void generate_SEK(int *err_status, char *err_string,
...
@@ -900,9 +901,12 @@ void generate_SEK(int *err_status, char *err_string,
unsigned
char
*
rand_char
=
(
unsigned
char
*
)
malloc
(
16
);
unsigned
char
*
rand_char
=
(
unsigned
char
*
)
malloc
(
16
);
sgx_read_rand
(
rand_char
,
16
);
sgx_read_rand
(
rand_char
,
16
);
carray2Hex
(
rand_char
,
16
,
SEK
);
uint32_t
sealedLen
=
sgx_calc_sealed_data_size
(
0
,
32
);
uint32_t
sealedLen
=
sgx_calc_sealed_data_size
(
0
,
32
);
memcpy
(
err_string
,
32
,
SEK
);
sgx_status_t
status
=
sgx_seal_data
(
0
,
NULL
,
32
,
(
uint8_t
*
)
rand_char
,
sealedLen
,(
sgx_sealed_data_t
*
)
encrypted_SEK
);
sgx_status_t
status
=
sgx_seal_data
(
0
,
NULL
,
32
,
(
uint8_t
*
)
SEK
,
sealedLen
,(
sgx_sealed_data_t
*
)
encrypted_SEK
);
if
(
status
!=
SGX_SUCCESS
)
{
if
(
status
!=
SGX_SUCCESS
)
{
snprintf
(
err_string
,
BUF_LEN
,
"seal SEK failed"
);
snprintf
(
err_string
,
BUF_LEN
,
"seal SEK failed"
);
*
err_status
=
status
;
*
err_status
=
status
;
...
@@ -911,7 +915,7 @@ void generate_SEK(int *err_status, char *err_string,
...
@@ -911,7 +915,7 @@ void generate_SEK(int *err_status, char *err_string,
*
enc_len
=
sealedLen
;
*
enc_len
=
sealedLen
;
free
(
rand_char
);
free
(
rand_char
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment