diff --git a/app/modules/keypair/index.ts b/app/modules/keypair/index.ts index a809f75fd2b2af3d665f6fa4443f7ad5a119748c..73d2b33dfcb773cd99ca4772099dad7775c31d89 100644 --- a/app/modules/keypair/index.ts +++ b/app/modules/keypair/index.ts @@ -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"); diff --git a/test/fast/modules/keypair/keypair-module-test.ts b/test/fast/modules/keypair/keypair-module-test.ts index 45998ad1e6b71463fa2f53ed9783c624435b67c5..1d755d1f53cf609363890a4af10550aee7b004fe 100644 --- a/test/fast/modules/keypair/keypair-module-test.ts +++ b/test/fast/modules/keypair/keypair-module-test.ts @@ -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');