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
8a5f3dd0
Unverified
Commit
8a5f3dd0
authored
Jul 28, 2020
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2977 clean up
parent
3f8c8844
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
14 deletions
+3
-14
ECDSAImpl.c
ECDSAImpl.c
+0
-5
Makefile.am
Makefile.am
+3
-5
secure_enclave.c
secure_enclave/secure_enclave.c
+0
-4
No files found.
ECDSAImpl.c
deleted
100644 → 0
View file @
3f8c8844
#include "secure_enclave/Point.c"
#include "secure_enclave/DomainParameters.c"
#include "secure_enclave/NumberTheory.c"
#include "secure_enclave/Signature.c"
#include "secure_enclave/Curves.c"
\ No newline at end of file
Makefile.am
View file @
8a5f3dd0
...
@@ -54,8 +54,7 @@ AM_CPPFLAGS += -DSGXWALLET_VERSION="$(WALLET_VERSION)" -Wall -DSKALE_SGX=1 -DBIN
...
@@ -54,8 +54,7 @@ AM_CPPFLAGS += -DSGXWALLET_VERSION="$(WALLET_VERSION)" -Wall -DSKALE_SGX=1 -DBIN
## Additional targets to remove with 'make clean'. You must list
## Additional targets to remove with 'make clean'. You must list
## any edger8r generated files here.
## any edger8r generated files here.
CLEANFILES
=
$(COMMON_ENCLAVE_SRC)
secure_enclave.edl
\
CLEANFILES
=
$(COMMON_ENCLAVE_SRC)
secure_enclave.edl secure_enclave.signed.so
secure_enclave.signed.so
## The build target
## The build target
...
@@ -67,11 +66,10 @@ bin_PROGRAMS = sgxwallet testw cert_util
...
@@ -67,11 +66,10 @@ bin_PROGRAMS = sgxwallet testw cert_util
## have to be explicitly listed.
## have to be explicitly listed.
COMMON_SRC
=
InvalidStateException.cpp Exception.cpp InvalidArgumentException.cpp Log.cpp
\
COMMON_SRC
=
InvalidStateException.cpp Exception.cpp InvalidArgumentException.cpp Log.cpp
\
SGXWalletServer.cpp SGXRegistrationServer.cpp CSRManagerServer.cpp BLSCrypto.cpp
\
SGXWalletServer.cpp SGXRegistrationServer.cpp CSRManagerServer.cpp BLSCrypto.cpp ECDSACrypto.cpp
\
ECDSACrypto.cpp
\
DKGCrypto.cpp ServerInit.cpp BLSPrivateKeyShareSGX.cpp LevelDB.cpp ServerDataChecker.cpp SEKManager.cpp
\
DKGCrypto.cpp ServerInit.cpp BLSPrivateKeyShareSGX.cpp LevelDB.cpp ServerDataChecker.cpp SEKManager.cpp
\
third_party/intel/sgx_stub.c third_party/intel/sgx_detect_linux.c third_party/intel/create_enclave.c third_party/intel/oc_alloc.c
\
third_party/intel/sgx_stub.c third_party/intel/sgx_detect_linux.c third_party/intel/create_enclave.c third_party/intel/oc_alloc.c
\
ECDSAImpl.c
TestUtils.cpp sgxwallet.c
TestUtils.cpp sgxwallet.c
COMMON_ENCLAVE_SRC
=
secure_enclave_u.c secure_enclave_u.h
COMMON_ENCLAVE_SRC
=
secure_enclave_u.c secure_enclave_u.h
sgxwallet_SOURCES
=
sgxwall.cpp
$(COMMON_SRC)
sgxwallet_SOURCES
=
sgxwall.cpp
$(COMMON_SRC)
...
...
secure_enclave/secure_enclave.c
View file @
8a5f3dd0
...
@@ -998,10 +998,8 @@ void trustedGenerateEcdsaKeyAES(int *errStatus, char *errString,
...
@@ -998,10 +998,8 @@ void trustedGenerateEcdsaKeyAES(int *errStatus, char *errString,
*
enc_len
=
strlen
(
skey_str
)
+
SGX_AESGCM_MAC_SIZE
+
SGX_AESGCM_IV_SIZE
;
*
enc_len
=
strlen
(
skey_str
)
+
SGX_AESGCM_MAC_SIZE
+
SGX_AESGCM_IV_SIZE
;
stat
=
AES_decrypt
(
encryptedPrivateKey
,
*
enc_len
,
skey_str
);
stat
=
AES_decrypt
(
encryptedPrivateKey
,
*
enc_len
,
skey_str
);
if
(
stat
!=
0
)
{
if
(
stat
!=
0
)
{
snprintf
(
errString
+
19
+
strlen
(
skey_str
),
BUF_LEN
,
"ecdsa private key decr failed with status %d"
,
stat
);
snprintf
(
errString
+
19
+
strlen
(
skey_str
),
BUF_LEN
,
"ecdsa private key decr failed with status %d"
,
stat
);
*
errStatus
=
stat
;
*
errStatus
=
stat
;
...
@@ -1102,7 +1100,6 @@ void trustedGetPublicEcdsaKeyAES(int *errStatus, char *errString,
...
@@ -1102,7 +1100,6 @@ void trustedGetPublicEcdsaKeyAES(int *errStatus, char *errString,
static
uint64_t
sigCounter
=
0
;
static
uint64_t
sigCounter
=
0
;
static
domain_parameters
ecdsaCurve
=
NULL
;
static
domain_parameters
ecdsaCurve
=
NULL
;
void
trustedEcdsaSignAES
(
int
*
errStatus
,
char
*
errString
,
uint8_t
*
encryptedPrivateKey
,
uint32_t
enc_len
,
void
trustedEcdsaSignAES
(
int
*
errStatus
,
char
*
errString
,
uint8_t
*
encryptedPrivateKey
,
uint32_t
enc_len
,
unsigned
char
*
hash
,
char
*
sigR
,
char
*
sigS
,
uint8_t
*
sig_v
,
int
base
)
{
unsigned
char
*
hash
,
char
*
sigR
,
char
*
sigS
,
uint8_t
*
sig_v
,
int
base
)
{
LOG_DEBUG
(
__FUNCTION__
);
LOG_DEBUG
(
__FUNCTION__
);
...
@@ -1112,7 +1109,6 @@ void trustedEcdsaSignAES(int *errStatus, char *errString, uint8_t *encryptedPriv
...
@@ -1112,7 +1109,6 @@ void trustedEcdsaSignAES(int *errStatus, char *errString, uint8_t *encryptedPriv
domain_parameters_load_curve
(
ecdsaCurve
,
secp256k1
);
domain_parameters_load_curve
(
ecdsaCurve
,
secp256k1
);
}
}
char
skey
[
ECDSA_SKEY_LEN
];
char
skey
[
ECDSA_SKEY_LEN
];
int
status
=
AES_decrypt
(
encryptedPrivateKey
,
enc_len
,
skey
);
int
status
=
AES_decrypt
(
encryptedPrivateKey
,
enc_len
,
skey
);
...
...
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