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
53b3e091
Unverified
Commit
53b3e091
authored
Jul 02, 2020
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2844 write backup key to file on the disk
parent
8f8749a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
SEKManager.cpp
SEKManager.cpp
+7
-2
testw.cpp
testw.cpp
+12
-0
testw.py
testw.py
+1
-0
No files found.
SEKManager.cpp
View file @
53b3e091
...
...
@@ -26,6 +26,7 @@
#include "BLSCrypto.h"
#include "LevelDB.h"
#include <fstream>
#include <iostream>
#include <algorithm>
...
...
@@ -130,8 +131,12 @@ void gen_SEK(){
carray2Hex
(
encr_SEK
.
data
(),
enc_len
,
hexEncrKey
.
data
());
cout
<<
"ATTENTION! THIS IS YOUR KEY FOR BACK UP. PLEASE COPY IT TO THE SAFE PLACE"
<<
endl
;
cout
<<
"YOUR KEY IS "
<<
SEK
<<
endl
;
std
::
ofstream
sek_file
(
"backup_key.txt"
);
sek_file
.
clear
();
cout
<<
"ATTENTION! YOUR BACKUP KEY WILL BE WROTE INTO backup_key.txt.
\n
"
<<
"PLEASE COPY IT TO THE SAFE PLACE AND THEN DELETE THE FILE MANUALLY"
<<
endl
;
sek_file
<<
SEK
;
if
(
!
autoconfirm
)
{
std
::
string
confirm_str
=
"I confirm"
;
...
...
testw.cpp
View file @
53b3e091
...
...
@@ -580,6 +580,18 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") {
}
TEST_CASE_METHOD
(
TestFixture
,
"Backup Key"
,
"[backup-key]"
)
{
HttpClient
client
(
RPC_ENDPOINT
);
StubClient
c
(
client
,
JSONRPC_CLIENT_V2
);
std
::
ifstream
sek_file
(
"backup_key.txt"
);
REQUIRE
(
sek_file
.
good
());
std
::
string
sek
;
sek_file
>>
sek
;
REQUIRE
(
sek
.
size
()
==
32
);
}
TEST_CASE_METHOD
(
TestFixture
,
"Get ServerStatus"
,
"[get-server-status]"
)
{
HttpClient
client
(
RPC_ENDPOINT
);
StubClient
c
(
client
,
JSONRPC_CLIENT_V2
);
...
...
testw.py
View file @
53b3e091
...
...
@@ -32,6 +32,7 @@ print("Top directory is:" + topDir)
testList
=
[
"[cert-sign]"
,
"[get-server-status]"
,
"[get-server-version]"
,
"[backup-key]"
,
"[ecdsa-key-gen]"
,
"[ecdsa-aes-key-gen]"
,
"[ecdsa-key-sig-gen]"
,
...
...
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