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
cde81090
Unverified
Commit
cde81090
authored
Jul 23, 2020
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2830 remove extra logs
parent
db9556e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
13 deletions
+3
-13
ECDSACrypto.cpp
ECDSACrypto.cpp
+2
-2
secure_enclave.c
secure_enclave/secure_enclave.c
+1
-11
No files found.
ECDSACrypto.cpp
View file @
cde81090
...
...
@@ -182,8 +182,6 @@ vector <string> ecdsaSignHash(const char *encryptedKeyHex, const char *hashHex,
goto
clean
;
}
pubKeyStr
=
getECDSAPubKey
(
encryptedKeyHex
);
status
=
trustedEcdsaSignAES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encryptedKey
.
data
(),
decLen
,
(
unsigned
char
*
)
hashHex
,
signatureR
.
data
(),
...
...
@@ -210,6 +208,8 @@ vector <string> ecdsaSignHash(const char *encryptedKeyHex, const char *hashHex,
/* Now verify signature */
pubKeyStr
=
getECDSAPubKey
(
encryptedKeyHex
);
if
(
!
verifyECDSASig
(
pubKeyStr
,
hashHex
,
signatureR
.
data
(),
signatureS
.
data
(),
base
))
{
exception
=
make_shared
<
SGXException
>
(
667
,
"ECDSA did not verify"
);
goto
clean
;
...
...
secure_enclave/secure_enclave.c
View file @
cde81090
...
...
@@ -1034,8 +1034,6 @@ void trustedGetPublicEcdsaKeyAES(int *errStatus, char *errString,
int
status
=
AES_decrypt
(
encryptedPrivateKey
,
enc_len
,
skey
);
skey
[
enc_len
-
SGX_AESGCM_MAC_SIZE
-
SGX_AESGCM_IV_SIZE
]
=
'\0'
;
LOG_INFO
(
"ENCRYPTED SKEY"
);
LOG_INFO
(
skey
);
if
(
status
!=
0
)
{
snprintf
(
errString
,
BUF_LEN
,
"AES_decrypt failed with status %d"
,
status
);
...
...
@@ -1059,17 +1057,14 @@ void trustedGetPublicEcdsaKeyAES(int *errStatus, char *errString,
return
;
}
LOG_INFO
(
"SET STR SUCCESS"
);
//Public key
point
Pkey
=
point_init
();
signature_extract_public_key
(
Pkey
,
privateKeyMpz
,
curve
);
LOG_INFO
(
"SIGNATURE EXTRACT PK SUCCESS"
);
point
Pkey_test
=
point_init
();
point_multiplication
(
Pkey_test
,
privateKeyMpz
,
curve
->
G
,
curve
);
LOG_INFO
(
"POINT MULTIPLICATION SUCCESS"
);
if
(
!
point_cmp
(
Pkey
,
Pkey_test
))
{
snprintf
(
errString
,
BUF_LEN
,
"Points are not equal"
);
...
...
@@ -1082,14 +1077,11 @@ void trustedGetPublicEcdsaKeyAES(int *errStatus, char *errString,
return
;
}
LOG_INFO
(
"POINTS CMP SUCCESS"
);
int
len
=
mpz_sizeinbase
(
Pkey
->
x
,
ECDSA_SKEY_BASE
)
+
2
;
char
arr_x
[
len
];
mpz_get_str
(
arr_x
,
ECDSA_SKEY_BASE
,
Pkey
->
x
);
LOG_INFO
(
"GET STR X SUCCESS"
);
LOG_INFO
(
arr_x
);
int
n_zeroes
=
64
-
strlen
(
arr_x
);
for
(
int
i
=
0
;
i
<
n_zeroes
;
i
++
)
{
...
...
@@ -1100,13 +1092,11 @@ void trustedGetPublicEcdsaKeyAES(int *errStatus, char *errString,
char
arr_y
[
mpz_sizeinbase
(
Pkey
->
y
,
ECDSA_SKEY_BASE
)
+
2
];
mpz_get_str
(
arr_y
,
ECDSA_SKEY_BASE
,
Pkey
->
y
);
LOG_INFO
(
"GET STR Y SUCCESS"
);
LOG_INFO
(
arr_y
);
n_zeroes
=
64
-
strlen
(
arr_y
);
for
(
int
i
=
0
;
i
<
n_zeroes
;
i
++
)
{
pub_key_y
[
i
]
=
'0'
;
}
strncpy
(
pub_key_y
+
n_zeroes
,
arr_y
,
1024
-
n_zeroes
);
// ??????????????????????????????????? SIGSEGV
strncpy
(
pub_key_y
+
n_zeroes
,
arr_y
,
1024
-
n_zeroes
);
mpz_clear
(
privateKeyMpz
);
domain_parameters_clear
(
curve
);
...
...
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