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
09386fd2
Unverified
Commit
09386fd2
authored
Apr 17, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2454-add-logs-to-enclave
parent
a3130c56
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
15 deletions
+15
-15
SEKManager.cpp
SEKManager.cpp
+6
-6
SEKManager.h
SEKManager.h
+1
-1
secure_enclave.c
secure_enclave/secure_enclave.c
+4
-4
secure_enclave.edl
secure_enclave/secure_enclave.edl
+4
-4
No files found.
SEKManager.cpp
View file @
09386fd2
...
...
@@ -98,7 +98,7 @@ bool check_SEK(std::string SEK){
uint32_t
l
=
len
;
std
::
cerr
<<
" l is "
<<
l
<<
std
::
endl
;
status
=
set_
SEK_backup
(
eid
,
&
err_status
,
errMsg
.
data
(),
encr_SEK
.
data
(),
&
l
,
SEK
.
c_str
()
);
status
=
trustedSet
SEK_backup
(
eid
,
&
err_status
,
errMsg
.
data
(),
encr_SEK
.
data
(),
&
l
,
SEK
.
c_str
()
);
if
(
status
!=
SGX_SUCCESS
){
cerr
<<
"RPCException thrown with status "
<<
status
<<
endl
;
throw
SGXException
(
status
,
errMsg
.
data
());
...
...
@@ -133,7 +133,7 @@ void gen_SEK(){
char
SEK
[
65
];
memset
(
SEK
,
0
,
65
);
status
=
generate_
SEK
(
eid
,
&
err_status
,
errMsg
.
data
(),
encr_SEK
.
data
(),
&
enc_len
,
SEK
);
status
=
trustedGenerate
SEK
(
eid
,
&
err_status
,
errMsg
.
data
(),
encr_SEK
.
data
(),
&
enc_len
,
SEK
);
if
(
status
!=
SGX_SUCCESS
||
err_status
!=
0
){
throw
SGXException
(
status
,
errMsg
.
data
())
;
}
...
...
@@ -164,7 +164,7 @@ void gen_SEK(){
create_test_key
();
}
void
set_
SEK
(
std
::
shared_ptr
<
std
::
string
>
hex_encr_SEK
){
void
trustedSet
SEK
(
std
::
shared_ptr
<
std
::
string
>
hex_encr_SEK
){
vector
<
char
>
errMsg
(
1024
,
0
);
int
err_status
=
0
;
//vector<uint8_t> encr_SEK(1024, 0);
...
...
@@ -178,7 +178,7 @@ void set_SEK(std::shared_ptr<std::string> hex_encr_SEK){
throw
SGXException
(
INVALID_HEX
,
"Invalid encrypted SEK Hex"
);
}
status
=
set_
SEK
(
eid
,
&
err_status
,
errMsg
.
data
(),
encr_SEK
,
len
);
status
=
trustedSet
SEK
(
eid
,
&
err_status
,
errMsg
.
data
(),
encr_SEK
,
len
);
if
(
status
!=
SGX_SUCCESS
||
err_status
!=
0
){
cerr
<<
"RPCException thrown"
<<
endl
;
throw
SGXException
(
status
,
errMsg
.
data
())
;
...
...
@@ -210,7 +210,7 @@ void enter_SEK(){
// std::cerr << "your key is " << SEK << std::endl;
status
=
set_
SEK_backup
(
eid
,
&
err_status
,
errMsg
.
data
(),
encr_SEK
.
data
(),
&
enc_len
,
SEK
.
c_str
()
);
status
=
trustedSet
SEK_backup
(
eid
,
&
err_status
,
errMsg
.
data
(),
encr_SEK
.
data
(),
&
enc_len
,
SEK
.
c_str
()
);
if
(
status
!=
SGX_SUCCESS
){
cerr
<<
"RPCException thrown with status "
<<
status
<<
endl
;
throw
SGXException
(
status
,
errMsg
.
data
());
...
...
@@ -231,7 +231,7 @@ void initSEK(){
gen_SEK
();
}
else
{
set_
SEK
(
encr_SEK_ptr
);
trustedSet
SEK
(
encr_SEK_ptr
);
}
}
...
...
SEKManager.h
View file @
09386fd2
...
...
@@ -35,7 +35,7 @@
void
gen_SEK
();
#ifdef __cplusplus
void
set_
SEK
(
std
::
shared_ptr
<
std
::
string
>
hex_encr_SEK
);
void
trustedSet
SEK
(
std
::
shared_ptr
<
std
::
string
>
hex_encr_SEK
);
#endif
#ifdef __cplusplus
...
...
secure_enclave/secure_enclave.c
View file @
09386fd2
...
...
@@ -703,7 +703,7 @@ void trustedGetEncryptedSecretShare(int *err_status, char *err_string, uint8_t *
//free(cypher);
}
void
complaint_r
esponse
(
int
*
err_status
,
char
*
err_string
,
uint8_t
*
encrypted_DHkey
,
uint8_t
*
encrypted_dkg_secret
,
void
trustedComplaintR
esponse
(
int
*
err_status
,
char
*
err_string
,
uint8_t
*
encrypted_DHkey
,
uint8_t
*
encrypted_dkg_secret
,
uint32_t
*
dec_len
,
char
*
DH_key
,
char
*
s_shareG2
,
uint8_t
_t
,
uint8_t
_n
,
uint8_t
ind1
)
{
...
...
@@ -926,7 +926,7 @@ void trustedGetBlsPubKey(int *err_status, char *err_string, uint8_t *encrypted_k
}
}
void
generate_
SEK
(
int
*
err_status
,
char
*
err_string
,
void
trustedGenerate
SEK
(
int
*
err_status
,
char
*
err_string
,
uint8_t
*
encrypted_SEK
,
uint32_t
*
enc_len
,
char
*
SEK_hex
)
{
uint8_t
SEK_raw
[
SGX_AESGCM_KEY_SIZE
];
//unsigned char* rand_char = (unsigned char*)malloc(16);
...
...
@@ -956,7 +956,7 @@ void generate_SEK(int *err_status, char *err_string,
//free(rand_char);
}
void
set_
SEK
(
int
*
err_status
,
char
*
err_string
,
uint8_t
*
encrypted_SEK
,
uint64_t
encr_len
)
{
void
trustedSet
SEK
(
int
*
err_status
,
char
*
err_string
,
uint8_t
*
encrypted_SEK
,
uint64_t
encr_len
)
{
//memset(AES_key, 0, SGX_AESGCM_KEY_SIZE);
...
...
@@ -976,7 +976,7 @@ void set_SEK(int *err_status, char *err_string, uint8_t *encrypted_SEK, uint64_t
}
void
set_
SEK_backup
(
int
*
err_status
,
char
*
err_string
,
void
trustedSet
SEK_backup
(
int
*
err_status
,
char
*
err_string
,
uint8_t
*
encrypted_SEK
,
uint32_t
*
enc_len
,
const
char
*
SEK_hex
)
{
uint64_t
len
;
...
...
secure_enclave/secure_enclave.edl
View file @
09386fd2
...
...
@@ -153,7 +153,7 @@ enclave {
uint64_t key_len,
[out, count = 320] char* bls_pub_key);
public void
complaint_r
esponse(
public void
trustedComplaintR
esponse(
[user_check] int *err_status,
[out, count = 1024] char* err_string,
[in, count = 1024] uint8_t *encrypted_DHkey,
...
...
@@ -165,20 +165,20 @@ enclave {
uint8_t _n,
uint8_t ind1);
public void
generate_
SEK(
public void
trustedGenerate
SEK(
[user_check] int *err_status,
[out, count = 1024] char *err_string,
[out, count = 1024] uint8_t *encrypted_SEK,
[user_check] uint32_t *enc_len,
[out, count = 65] char* hex_SEK);
public void
set_
SEK(
public void
trustedSet
SEK(
[user_check] int *err_status,
[out, count = 1024] char *err_string,
[in, count = 1024] uint8_t *encrypted_SEK,
uint64_t encr_len);
public void
set_
SEK_backup(
public void
trustedSet
SEK_backup(
[user_check] int *err_status,
[out, count = 1024] char *err_string,
[out, count = 1024] uint8_t *encrypted_SEK,
...
...
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