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
05fb9b41
Unverified
Commit
05fb9b41
authored
Jun 05, 2020
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2002 fix sigill in test
parent
2dc5a146
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
28 deletions
+15
-28
EnclaveConstants.h
secure_enclave/EnclaveConstants.h
+8
-8
secure_enclave.c
secure_enclave/secure_enclave.c
+7
-7
secure_enclave.edl
secure_enclave/secure_enclave.edl
+0
-5
testw.cpp
testw.cpp
+0
-6
testw.py
testw.py
+0
-2
No files found.
secure_enclave/EnclaveConstants.h
View file @
05fb9b41
...
...
@@ -26,18 +26,18 @@
#define BUF_LEN 1024
#define
MAX_KEY_LENGTH 128
#define
MAX_COMPONENT_LENGTH 80
#define
MAX_COMPONENT_HEX_LENGTH MAX_COMPONENT_LENGTH * 2
#define
MAX_ENCRYPTED_KEY_LENGTH 1024
#define
MAX_SIG_LEN 1024
#define
MAX_ERR_LEN 1024
#define MAX_KEY_LENGTH 128
#define MAX_COMPONENT_LENGTH 80
#define MAX_COMPONENT_HEX_LENGTH MAX_COMPONENT_LENGTH * 2
#define MAX_ENCRYPTED_KEY_LENGTH 1024
#define MAX_SIG_LEN 1024
#define MAX_ERR_LEN 1024
#define SHA_256_LEN 32
#define ADD_ENTROPY_SIZE 32
#define
DKG_BUFER_LENGTH 2490//3060
#define
DKG_MAX_SEALED_LEN 3100
#define DKG_BUFER_LENGTH 2490//3060
#define DKG_MAX_SEALED_LEN 3100
#define SECRET_SHARE_NUM_BYTES 96
...
...
secure_enclave/secure_enclave.c
View file @
05fb9b41
...
...
@@ -407,17 +407,17 @@ void trustedEncryptKey(int *errStatus, char *errString, const char *key,
memset
(
errString
,
0
,
BUF_LEN
);
uint32_t
sealedLen
=
sgx_calc_sealed_data_size
(
0
,
MAX_KEY_LENGTH
);
uint32_t
sealedLen
=
sgx_calc_sealed_data_size
(
0
,
ECDSA_SKEY_LEN
);
if
(
sealedLen
>
BUF_LEN
)
{
*
errStatus
=
ENCRYPTED_KEY_TOO_LONG
;
snprintf
(
errString
,
BUF_LEN
,
"sealedLen > MAX_ENCRYPTED_KEY_LENGTH"
);
return
;
}
if
(
sealedLen
>
BUF_LEN
)
{
*
errStatus
=
ENCRYPTED_KEY_TOO_LONG
;
snprintf
(
errString
,
BUF_LEN
,
"sealedLen > MAX_ENCRYPTED_KEY_LENGTH"
);
return
;
}
memset
(
encryptedPrivateKey
,
0
,
BUF_LEN
);
sgx_status_t
status
=
sgx_seal_data
(
0
,
NULL
,
MAX_KEY_LENGTH
,
(
uint8_t
*
)
key
,
sealedLen
,
sgx_status_t
status
=
sgx_seal_data
(
0
,
NULL
,
ECDSA_SKEY_LEN
,
(
uint8_t
*
)
key
,
sealedLen
,
(
sgx_sealed_data_t
*
)
encryptedPrivateKey
);
if
(
status
!=
SGX_SUCCESS
)
{
*
errStatus
=
SEAL_KEY_FAILED
;
...
...
secure_enclave/secure_enclave.edl
View file @
05fb9b41
...
...
@@ -226,7 +226,6 @@ enclave {
uint32_t enc_len,
[out, count = SMALL_BUF_SIZE] char* key );
public void trustedGenDkgSecretAES (
[user_check] int *errStatus,
[out, count = SMALL_BUF_SIZE] char* err_string,
...
...
@@ -279,7 +278,6 @@ enclave {
int _ind,
[user_check] int* result);
public void trustedCreateBlsKeyAES(
[user_check]int *errStatus,
[out, count = SMALL_BUF_SIZE] char* err_string,
...
...
@@ -304,9 +302,6 @@ enclave {
[in, count = SMALL_BUF_SIZE] uint8_t* encrypted_key,
uint64_t key_len,
[out, count = 320] char* bls_pub_key);
};
...
...
testw.cpp
View file @
05fb9b41
...
...
@@ -322,8 +322,6 @@ public:
TEST_CASE_METHOD
(
TestFixture
,
"ECDSA keygen and signature test"
,
"[ecdsa-key-sig-gen]"
)
{
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
int
errStatus
=
0
;
vector
<
uint8_t
>
encrPrivKey
(
BUF_LEN
,
0
);
...
...
@@ -331,10 +329,8 @@ TEST_CASE_METHOD(TestFixture, "ECDSA keygen and signature test", "[ecdsa-key-sig
vector
<
char
>
pubKeyY
(
BUF_LEN
,
0
);
uint32_t
encLen
=
0
;
status
=
trustedGenerateEcdsaKey
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrPrivKey
.
data
(),
&
encLen
,
pubKeyX
.
data
(),
pubKeyY
.
data
());
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
...
...
@@ -352,8 +348,6 @@ TEST_CASE_METHOD(TestFixture, "ECDSA keygen and signature test", "[ecdsa-key-sig
}
TEST_CASE_METHOD
(
TestFixture
,
"ECDSA key gen"
,
"[ecdsa-key-gen]"
)
{
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
int
errStatus
=
0
;
vector
<
uint8_t
>
encrPrivKey
(
BUF_LEN
,
0
);
...
...
testw.py
View file @
05fb9b41
...
...
@@ -27,10 +27,8 @@ import getpass, os, subprocess
username
=
getpass
.
getuser
()
topDir
=
os
.
getcwd
()
+
"/sgxwallet"
print
(
"Starting build push"
)
print
(
"Top directory is:"
+
topDir
)
testList
=
[
"[cert-sign]"
,
"[get-server-status]"
,
"[get-server-version]"
,
...
...
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