Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
typescript
duniter
Commits
f190823f
Commit
f190823f
authored
4 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
[fex] security: remove options --salt & --password
parent
1f3a021b
No related branches found
No related tags found
1 merge request
!1329
Duniter launcher
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/modules/keypair/index.ts
+0
-21
0 additions, 21 deletions
app/modules/keypair/index.ts
test/fast/modules/keypair/keypair-module-test.ts
+0
-13
0 additions, 13 deletions
test/fast/modules/keypair/keypair-module-test.ts
with
0 additions
and
34 deletions
app/modules/keypair/index.ts
+
0
−
21
View file @
f190823f
...
...
@@ -27,11 +27,6 @@ export const KeypairDependency = {
},
cliOptions
:
[
{
value
:
"
--salt <salt>
"
,
desc
:
"
Salt to generate the keypair
"
},
{
value
:
"
--passwd <password>
"
,
desc
:
"
Password to generate the keypair
"
,
},
{
value
:
"
--keyN <N>
"
,
desc
:
...
...
@@ -98,22 +93,6 @@ export const KeypairDependency = {
logger
:
any
,
confDAL
:
any
)
=>
{
if
(
(
program
.
keyN
||
program
.
keyr
||
program
.
keyp
)
&&
!
(
program
.
salt
&&
program
.
passwd
)
)
{
throw
Error
(
"
Missing --salt and --passwd options along with --keyN|keyr|keyp option
"
);
}
// If we have salt and password, convert it to keypair
if
(
program
.
salt
||
program
.
passwd
)
{
const
salt
=
program
.
salt
||
""
;
const
key
=
program
.
passwd
||
""
;
conf
.
pair
=
await
Scrypt
(
salt
,
key
);
}
// If no keypair has been loaded, try the default .yml file
if
(
!
conf
.
pair
||
!
conf
.
pair
.
pub
||
!
conf
.
pair
.
sec
)
{
const
ymlContent
=
await
confDAL
.
coreFS
.
read
(
"
keyring.yml
"
);
...
...
This diff is collapsed.
Click to expand it.
test/fast/modules/keypair/keypair-module-test.ts
+
0
−
13
View file @
f190823f
...
...
@@ -18,19 +18,6 @@ const should = require('should');
describe
(
'
Module usage
'
,
()
=>
{
it
(
'
wrong options should throw
'
,
async
()
=>
{
let
errMessage
;
try
{
const
stack
=
Statics
.
minimalStack
();
stack
.
registerDependency
(
KeypairDependency
,
'
duniter-keypair
'
);
await
stack
.
executeStack
([
'
node
'
,
'
index.js
'
,
'
config
'
,
'
--memory
'
,
'
--keyN
'
,
'
2048
'
]);
}
catch
(
e
)
{
errMessage
=
e
.
message
;
}
should
.
exist
(
errMessage
);
should
.
equal
(
errMessage
,
'
Missing --salt and --passwd options along with --keyN|keyr|keyp option
'
);
})
it
(
'
no options on brand new node should generate random key
'
,
async
()
=>
{
const
stack
=
Statics
.
minimalStack
();
stack
.
registerDependency
(
KeypairDependency
,
'
duniter-keypair
'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment