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
b7f14fde
Unverified
Commit
b7f14fde
authored
Aug 28, 2019
by
a72d9e2bad9edfd58d6c0248c12c953b71d409d2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added gmp
parent
86eb1073
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
secure_enclave.c
secure_enclave/secure_enclave.c
+6
-3
secure_enclave.edl
secure_enclave/secure_enclave.edl
+9
-0
No files found.
secure_enclave/secure_enclave.c
View file @
b7f14fde
...
...
@@ -139,11 +139,10 @@ void encrypt_key(int *err_status, unsigned char *key,
*
err_status
=
-
7
;
if
(
strcmp
(
key
,
key
)
!=
0
)
if
(
strcmp
(
key
,
key
2
)
!=
0
)
return
;
*
err_status
=
0
;
}
void
decrypt_key
(
int
*
err_status
,
unsigned
char
*
encrypted_key
,
...
...
@@ -153,7 +152,8 @@ void decrypt_key(int *err_status, unsigned char *encrypted_key,
*
err_status
=
-
6
;
sgx_status_t
status
=
sgx_unseal_data
((
const
sgx_sealed_data_t
*
)
encrypted_key
,
NULL
,
0
,
key
,
&
decLen
);
sgx_status_t
status
=
sgx_unseal_data
(
(
const
sgx_sealed_data_t
*
)
encrypted_key
,
NULL
,
0
,
key
,
&
decLen
);
if
(
status
!=
SGX_SUCCESS
)
{
*
err_status
=
status
;
...
...
@@ -164,3 +164,6 @@ void decrypt_key(int *err_status, unsigned char *encrypted_key,
}
}
void
sign_message
(
int
*
err_status
,
unsigned
char
*
encrypted_key
,
uint32_t
enc_len
,
unsigned
char
*
message
,
unsigned
char
*
signature
)
{}
\ No newline at end of file
secure_enclave/secure_enclave.edl
View file @
b7f14fde
...
...
@@ -32,6 +32,15 @@ enclave {
uint32_t enc_len,
[out, count = 128] unsigned char* key );
public void sign_message (
[user_check] int *err_status,
[in, count = 1024] unsigned char* encrypted_key,
uint32_t enc_len,
[in, count = 1024] unsigned char* message,
[out, count = 1024] unsigned char* signature);
};
...
...
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