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
755819ae
Unverified
Commit
755819ae
authored
Aug 20, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Seal/unseal fails
parent
aa034c4c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
22 deletions
+42
-22
SGXException.h
SGXException.h
+4
-0
ServerInit.cpp
ServerInit.cpp
+36
-15
secure_enclave.c
secure_enclave/secure_enclave.c
+2
-7
No files found.
SGXException.h
View file @
755819ae
...
...
@@ -36,6 +36,10 @@ public:
SGXException
(
int32_t
_status
,
const
char
*
_errString
)
:
status
(
_status
),
errString
(
_errString
)
{}
std
::
string
getMessage
()
{
return
"SGXException:status:"
+
std
::
to_string
(
status
)
+
":"
+
errString
;
}
};
#endif //SGXD_RPCEXCEPTION_H
ServerInit.cpp
View file @
755819ae
...
...
@@ -54,6 +54,7 @@
#include "CSRManagerServer.h"
#include "BLSCrypto.h"
#include "ServerInit.h"
#include "SGXException.h"
#include "SGXWalletServer.hpp"
void
initUserSpace
()
{
...
...
@@ -104,23 +105,43 @@ void initEnclave(uint32_t _logLevel) {
spdlog
::
info
(
"Enclave libtgmp library and logging initialized successfully"
);
}
void
initAll
(
uint32_t
_logLevel
,
bool
_checkCert
,
bool
_autoSign
)
{
static
atomic
<
int
>
sgxServerInited
(
0
);
void
initAll
(
uint32_t
_logLevel
,
bool
_checkCert
,
bool
_autoSign
)
{
cout
<<
"Running sgxwallet version:"
<<
SGXWalletServer
::
getVersion
()
<<
endl
;
static
atomic
<
bool
>
sgxServerInited
(
false
);
static
mutex
initMutex
;
CHECK_STATE
(
sgxServerInited
!=
1
)
sgxServerInited
=
1
;
initEnclave
(
_logLevel
);
initUserSpace
();
initSEK
();
lock_guard
<
mutex
>
lock
(
initMutex
);
if
(
useHTTPS
)
{
SGXWalletServer
::
initHttpsServer
(
_checkCert
);
SGXRegistrationServer
::
initRegistrationServer
(
_autoSign
);
CSRManagerServer
::
initCSRManagerServer
();
}
else
{
SGXWalletServer
::
initHttpServer
();
if
(
sgxServerInited
)
return
;
try
{
cout
<<
"Running sgxwallet version:"
<<
SGXWalletServer
::
getVersion
()
<<
endl
;
CHECK_STATE
(
sgxServerInited
!=
1
)
sgxServerInited
=
1
;
initEnclave
(
_logLevel
);
initUserSpace
();
initSEK
();
if
(
useHTTPS
)
{
SGXWalletServer
::
initHttpsServer
(
_checkCert
);
SGXRegistrationServer
::
initRegistrationServer
(
_autoSign
);
CSRManagerServer
::
initCSRManagerServer
();
}
else
{
SGXWalletServer
::
initHttpServer
();
}
sgxServerInited
=
true
;
}
catch
(
SGXException
&
_e
)
{
spdlog
::
error
(
_e
.
getMessage
());
}
catch
(
exception
&
_e
)
{
spdlog
::
error
(
_e
.
what
());
}
}
catch
(...)
{
exception_ptr
p
=
current_exception
();
printf
(
"Exception %s
\n
"
,
p
.
__cxa_exception_type
()
->
name
());
spdlog
::
error
(
"Unknown exception"
);
}
};
secure_enclave/secure_enclave.c
View file @
755819ae
...
...
@@ -229,14 +229,9 @@ void trustedGenerateSEK(int *errStatus, char *errString,
SAFE_CHAR_BUF
(
errS
,
BUF_LEN
);
sprintf
(
errS
,
"status $d"
,
status
);
LOG_ERROR
(
errS
);
CHECK_STATUS
(
"seal/unseal SEK failed after SEK generation in unseal"
);
return
;
// CHECK_STATUS("seal/unseal SEK failed after SEK generation in unseal");
*
enc_len
=
sealedLen
;
...
...
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