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
b0e6277d
Unverified
Commit
b0e6277d
authored
Jun 11, 2020
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2002 fix memory leak
parent
9d81af95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
secure_enclave.c
secure_enclave/secure_enclave.c
+4
-3
No files found.
secure_enclave/secure_enclave.c
View file @
b0e6277d
...
...
@@ -1389,7 +1389,6 @@ void trustedGetEncryptedSecretShareAES(int *errStatus, char *errString, uint8_t
char
*
s_share
[
ECDSA_SKEY_LEN
];
if
(
calc_secret_share
(
decryptedDkgPoly
,
s_share
,
_t
,
_n
,
ind
)
!=
0
)
{
*
errStatus
=
-
1
;
...
...
@@ -1430,14 +1429,18 @@ void trustedGetPublicSharesAES(int *errStatus, char *errString, uint8_t *encrypt
if
(
status
!=
SGX_SUCCESS
)
{
snprintf
(
errString
,
BUF_LEN
,
"aes decrypt data - encrypted_dkg_secret failed with status %d"
,
status
);
*
errStatus
=
status
;
free
(
decrypted_dkg_secret
);
return
;
}
if
(
calc_public_shares
(
decrypted_dkg_secret
,
public_shares
,
_t
)
!=
0
)
{
*
errStatus
=
-
1
;
snprintf
(
errString
,
BUF_LEN
,
"t does not match polynomial in db"
);
free
(
decrypted_dkg_secret
);
return
;
}
free
(
decrypted_dkg_secret
);
}
void
trustedDkgVerifyAES
(
int
*
errStatus
,
char
*
errString
,
const
char
*
public_shares
,
const
char
*
s_share
,
...
...
@@ -1448,7 +1451,6 @@ void trustedDkgVerifyAES(int *errStatus, char *errString, const char *public_sha
memset
(
skey
,
0
,
ECDSA_SKEY_LEN
);
int
status
=
AES_decrypt
(
encryptedPrivateKey
,
enc_len
,
skey
);
if
(
status
!=
SGX_SUCCESS
)
{
snprintf
(
errString
,
BUF_LEN
,
"AES_decrypt failed (in trustedDkgVerifyAES) with status %d"
,
status
);
*
errStatus
=
status
;
...
...
@@ -1459,7 +1461,6 @@ void trustedDkgVerifyAES(int *errStatus, char *errString, const char *public_sha
memset
(
encr_sshare
,
0
,
ECDSA_SKEY_LEN
);
strncpy
(
encr_sshare
,
s_share
,
ECDSA_SKEY_LEN
-
1
);
char
common_key
[
ECDSA_SKEY_LEN
];
memset
(
common_key
,
0
,
ECDSA_SKEY_LEN
);
...
...
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