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
65e7bd3d
Unverified
Commit
65e7bd3d
authored
Sep 03, 2019
by
a72d9e2bad9edfd58d6c0248c12c953b71d409d2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing signature
parent
b4b0013a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
14 deletions
+8
-14
sgxd.c
sgxd.c
+1
-8
sgxd_common.h
sgxd_common.h
+7
-6
No files found.
sgxd.c
View file @
65e7bd3d
...
...
@@ -46,13 +46,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define ENCLAVE_NAME "secure_enclave.signed.so"
void
usage
()
{
fprintf
(
stderr
,
"usage: sgxd
\n
"
);
exit
(
1
);
...
...
@@ -151,7 +144,7 @@ int main(int argc, char *argv[]) {
gmp_printf
(
"Encrypt key completed with status: %d %s
\n
"
,
err_status
,
errMsg
);
unsigned
char
*
result
=
carray2Hex
(
encryptedKey
,
enc_len
);
char
*
result
=
carray2Hex
(
encryptedKey
,
enc_len
);
uint64_t
dec_len
;
...
...
sgxd_common.h
View file @
65e7bd3d
...
...
@@ -27,8 +27,8 @@ inline int char2int(char _input) {
inline
unsigned
char
*
carray2Hex
(
const
uint8_t
*
d
,
int
_len
)
{
unsigned
char
*
hex
=
malloc
(
2
*
_len
);
char
*
carray2Hex
(
const
uint8_t
*
d
,
int
_len
)
{
char
*
hex
=
(
char
*
)
calloc
(
2
*
_len
,
1
);
static
char
hexval
[
16
]
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
};
...
...
@@ -42,9 +42,9 @@ inline unsigned char *carray2Hex(const uint8_t *d, int _len) {
}
inline
uint8_t
*
hex2carray
(
unsigned
char
*
_hex
,
uint64_t
*
_bin_len
)
{
inline
uint8_t
*
hex2carray
(
char
*
_hex
,
uint64_t
*
_bin_len
)
{
uint64_t
len
=
strlen
(
(
char
*
)
_hex
);
uint64_t
len
=
strlen
(
_hex
);
if
(
len
==
0
&&
len
%
2
==
1
)
...
...
@@ -52,9 +52,9 @@ inline uint8_t* hex2carray(unsigned char * _hex, uint64_t *_bin_len) {
*
_bin_len
=
len
/
2
;
uint8_t
*
bin
=
malloc
(
len
/
2
);
uint8_t
*
bin
=
(
uint8_t
*
)
calloc
(
len
/
2
,
1
);
for
(
in
t
i
=
0
;
i
<
len
/
2
;
i
++
)
{
for
(
uint64_
t
i
=
0
;
i
<
len
/
2
;
i
++
)
{
int
high
=
char2int
((
char
)
_hex
[
i
*
2
]);
int
low
=
char2int
((
char
)
_hex
[
i
*
2
+
1
]);
...
...
@@ -69,4 +69,5 @@ inline uint8_t* hex2carray(unsigned char * _hex, uint64_t *_bin_len) {
}
#endif //SGXD_SGXD_COMMON_H
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