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
4407d56e
Unverified
Commit
4407d56e
authored
Aug 13, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-3067-cleanup-sgx
parent
af6fc348
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
+6
-9
CSRManagerServer.cpp
CSRManagerServer.cpp
+3
-6
Log.h
Log.h
+1
-1
SGXRegistrationServer.cpp
SGXRegistrationServer.cpp
+2
-2
No files found.
CSRManagerServer.cpp
View file @
4407d56e
...
@@ -40,7 +40,6 @@ CSRManagerServer::CSRManagerServer(AbstractServerConnector &connector,
...
@@ -40,7 +40,6 @@ CSRManagerServer::CSRManagerServer(AbstractServerConnector &connector,
serverVersion_t
type
)
:
abstractCSRManagerServer
(
connector
,
type
)
{}
serverVersion_t
type
)
:
abstractCSRManagerServer
(
connector
,
type
)
{}
Json
::
Value
getUnsignedCSRsImpl
()
{
Json
::
Value
getUnsignedCSRsImpl
()
{
spdlog
::
info
(
__FUNCTION__
);
INIT_RESULT
(
result
)
INIT_RESULT
(
result
)
try
{
try
{
...
@@ -50,12 +49,11 @@ Json::Value getUnsignedCSRsImpl() {
...
@@ -50,12 +49,11 @@ Json::Value getUnsignedCSRsImpl() {
}
}
}
HANDLE_SGX_EXCEPTION
(
result
);
}
HANDLE_SGX_EXCEPTION
(
result
);
return
result
;
RETURN_SUCCESS
(
result
)
}
}
Json
::
Value
signByHashImpl
(
const
string
&
hash
,
int
status
)
{
Json
::
Value
signByHashImpl
(
const
string
&
hash
,
int
status
)
{
Json
::
Value
result
;
INIT_RESULT
(
result
)
result
[
"errorMessage"
]
=
""
;
try
{
try
{
if
(
!
(
status
==
0
||
status
==
2
))
{
if
(
!
(
status
==
0
||
status
==
2
))
{
...
@@ -89,7 +87,6 @@ Json::Value signByHashImpl(const string &hash, int status) {
...
@@ -89,7 +87,6 @@ Json::Value signByHashImpl(const string &hash, int status) {
LevelDB
::
getCsrStatusDb
()
->
deleteKey
(
status_db_key
);
LevelDB
::
getCsrStatusDb
()
->
deleteKey
(
status_db_key
);
LevelDB
::
getCsrStatusDb
()
->
writeDataUnique
(
status_db_key
,
"-1"
);
LevelDB
::
getCsrStatusDb
()
->
writeDataUnique
(
status_db_key
,
"-1"
);
throw
SGXException
(
FAIL_TO_CREATE_CERTIFICATE
,
"CLIENT CERTIFICATE GENERATION FAILED"
);
throw
SGXException
(
FAIL_TO_CREATE_CERTIFICATE
,
"CLIENT CERTIFICATE GENERATION FAILED"
);
//exit(-1);
}
}
}
}
...
@@ -102,7 +99,7 @@ Json::Value signByHashImpl(const string &hash, int status) {
...
@@ -102,7 +99,7 @@ Json::Value signByHashImpl(const string &hash, int status) {
}
HANDLE_SGX_EXCEPTION
(
result
)
}
HANDLE_SGX_EXCEPTION
(
result
)
return
result
;
RETURN_SUCCESS
(
result
)
}
}
Json
::
Value
CSRManagerServer
::
getUnsignedCSRs
()
{
Json
::
Value
CSRManagerServer
::
getUnsignedCSRs
()
{
...
...
Log.h
View file @
4407d56e
...
@@ -74,7 +74,7 @@ public:
...
@@ -74,7 +74,7 @@ public:
};
};
#define INIT_RESULT(__RESULT__) Json::Value __RESULT__; \
#define INIT_RESULT(__RESULT__) Json::Value __RESULT__; \
int errStatus = UNKNOWN_ERROR; string errMsg(BUF_LEN, '\0');__RESULT__["status"] =
0
; __RESULT__["errorMessage"] = \
int errStatus = UNKNOWN_ERROR; string errMsg(BUF_LEN, '\0');__RESULT__["status"] =
UNKNOWN_ERROR
; __RESULT__["errorMessage"] = \
"Server error. Please see server log.";
"Server error. Please see server log.";
#define HANDLE_SGX_EXCEPTION(__RESULT__) \
#define HANDLE_SGX_EXCEPTION(__RESULT__) \
...
...
SGXRegistrationServer.cpp
View file @
4407d56e
...
@@ -112,7 +112,7 @@ Json::Value signCertificateImpl(const string &_csr, bool _autoSign = false) {
...
@@ -112,7 +112,7 @@ Json::Value signCertificateImpl(const string &_csr, bool _autoSign = false) {
}
HANDLE_SGX_EXCEPTION
(
result
)
}
HANDLE_SGX_EXCEPTION
(
result
)
return
result
;
RETURN_SUCCESS
(
result
)
}
}
Json
::
Value
getCertificateImpl
(
const
string
&
hash
)
{
Json
::
Value
getCertificateImpl
(
const
string
&
hash
)
{
...
@@ -147,7 +147,7 @@ Json::Value getCertificateImpl(const string &hash) {
...
@@ -147,7 +147,7 @@ Json::Value getCertificateImpl(const string &hash) {
}
HANDLE_SGX_EXCEPTION
(
result
)
}
HANDLE_SGX_EXCEPTION
(
result
)
return
result
;
RETURN_SUCCESS
(
result
)
}
}
...
...
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