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
d3613375
Unverified
Commit
d3613375
authored
Oct 22, 2020
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-3374 fix leak
parent
6ff6f483
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
16 deletions
+12
-16
BLSCrypto.cpp
BLSCrypto.cpp
+1
-2
EnclaveCommon.cpp
secure_enclave/EnclaveCommon.cpp
+9
-9
secure_enclave.c
secure_enclave/secure_enclave.c
+0
-2
testw.cpp
testw.cpp
+2
-3
No files found.
BLSCrypto.cpp
View file @
d3613375
...
...
@@ -166,8 +166,7 @@ bool sign_aes(const char *_encryptedKeyHex, const char *_hashHex, size_t _t, siz
CHECK_STATE
(
_hashHex
);
CHECK_STATE
(
_sig
);
auto
hash
=
make_shared
<
array
<
uint8_t
,
32
>>
();
auto
hash
=
make_shared
<
array
<
uint8_t
,
32
>>
();
uint64_t
binLen
;
...
...
secure_enclave/EnclaveCommon.cpp
View file @
d3613375
...
...
@@ -82,8 +82,8 @@ string *stringFromFq(libff::alt_bn128_Fq *_fq) {
try
{
_fq
->
as_bigint
().
to_mpz
(
t
);
char
*
tmp
=
mpz_get_str
(
arr
,
10
,
t
);
ret
=
new
string
(
tmp
);
mpz_get_str
(
arr
,
10
,
t
);
ret
=
new
string
(
arr
);
}
catch
(
exception
&
e
)
{
LOG_ERROR
(
e
.
what
());
goto
clean
;
...
...
@@ -107,13 +107,13 @@ string *stringFromG1(libff::alt_bn128_G1 *_g1) {
try
{
_g1
->
to_affine_coordinates
();
auto
sX
=
stringFromFq
(
&
_g1
->
X
);
sX
=
stringFromFq
(
&
_g1
->
X
);
if
(
!
sX
)
{
goto
clean
;
}
auto
sY
=
stringFromFq
(
&
_g1
->
Y
);
sY
=
stringFromFq
(
&
_g1
->
Y
);
if
(
!
sY
)
{
goto
clean
;
...
...
@@ -131,8 +131,8 @@ string *stringFromG1(libff::alt_bn128_G1 *_g1) {
clean:
SAFE_
FRE
E
(
sX
);
SAFE_
FRE
E
(
sY
);
SAFE_
DELET
E
(
sX
);
SAFE_
DELET
E
(
sY
);
return
ret
;
...
...
@@ -226,7 +226,7 @@ bool enclave_sign(const char *_keyString, const char *_hashXString, const char *
}
try
{
auto
key
=
keyFromString
(
_keyString
);
key
=
keyFromString
(
_keyString
);
if
(
!
key
)
{
LOG_ERROR
(
"Null key"
);
...
...
@@ -243,13 +243,13 @@ bool enclave_sign(const char *_keyString, const char *_hashXString, const char *
sign
.
to_affine_coordinates
();
auto
r
=
stringFromG1
(
&
sign
);
r
=
stringFromG1
(
&
sign
);
memset
(
sig
,
0
,
BUF_LEN
);
strncpy
(
sig
,
r
->
c_str
(),
BUF_LEN
);
ret
=
true
;
ret
=
true
;
}
catch
(
exception
&
e
)
{
LOG_ERROR
(
e
.
what
());
...
...
secure_enclave/secure_enclave.c
View file @
d3613375
...
...
@@ -1118,8 +1118,6 @@ trustedGetBlsPubKey(int *errStatus, char *errString, uint8_t *encryptedPrivateKe
uint8_t
type
=
0
;
uint8_t
exportable
=
0
;
int
status
=
AES_decrypt
(
encryptedPrivateKey
,
key_len
,
skey_hex
,
BUF_LEN
,
&
type
,
&
exportable
);
...
...
testw.cpp
View file @
d3613375
...
...
@@ -657,8 +657,7 @@ TEST_CASE_METHOD(TestFixture, "AES_DKG test", "[aes-dkg]") {
string
hash
=
SAMPLE_HASH
;
auto
hash_arr
=
make_shared
<
array
<
uint8_t
,
32
>>
();
auto
hash_arr
=
make_shared
<
array
<
uint8_t
,
32
>>
();
uint64_t
binLen
;
...
...
@@ -723,8 +722,8 @@ TEST_CASE_METHOD(TestFixture, "AES encrypt/decrypt", "[aes-encrypt-decrypt]") {
status
=
trustedDecryptKey
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrypted_key
.
data
(),
encLen
,
decr_key
.
data
());
REQUIRE
(
status
==
0
);
REQUIRE
(
errStatus
==
0
);
REQUIRE
(
key
.
compare
(
decr_key
.
data
())
==
0
);
REQUIRE
(
errStatus
==
0
);
}
...
...
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