diff --git a/main.js b/main.js index be91c60..7646286 100644 --- a/main.js +++ b/main.js @@ -288,8 +288,8 @@ function createWindow(status, hideLoadingWindow) { firstLoginPH: null, secondaryLoginPH: null, }; - mainWindow.nnVoteChain = 'VOTE2018'; + mainWindow.checkStringEntropy = shepherd.checkStringEntropy; /*for (let i = 0; i < process.argv.length; i++) { if (process.argv[i].indexOf('nvote') > -1) { diff --git a/package.json b/package.json index a05927e..eadb790 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "js-sha256": "^0.7.1", "marketmaker": "git://github.com/pbca26/marketmaker", "nodejs-aes256": "^1.0.1", + "passwd-strength": "https://github.com/pbca26/passwd-strength", "portscanner": "^2.1.1", "ps-node": "^0.1.5", "remote-file-size": "^3.0.3", diff --git a/routes/appConfig.js b/routes/appConfig.js index fcfeb60..2cb85c6 100644 --- a/routes/appConfig.js +++ b/routes/appConfig.js @@ -71,7 +71,7 @@ const appConfig = { experimentalFeatures: { display: true, initDisplay: true, - displayName: 'Enable experimental features', + displayName: 'Enable advanced features', type: 'boolean', }, dataDir: { diff --git a/routes/shepherd/auth.js b/routes/shepherd/auth.js index 12c4aa6..9c1ff73 100644 --- a/routes/shepherd/auth.js +++ b/routes/shepherd/auth.js @@ -1,3 +1,5 @@ +const passwdStrength = require('passwd-strength'); + module.exports = (shepherd) => { /* * type: GET @@ -43,5 +45,10 @@ module.exports = (shepherd) => { } }; + shepherd.checkStringEntropy = (str) => { + // https://tools.ietf.org/html/rfc4086#page-35 + return passwdStrength(str) < 29 ? false : true; + }; + return shepherd; }; \ No newline at end of file diff --git a/routes/shepherd/electrum/merkle.js b/routes/shepherd/electrum/merkle.js index 82a52c4..665e462 100644 --- a/routes/shepherd/electrum/merkle.js +++ b/routes/shepherd/electrum/merkle.js @@ -163,4 +163,4 @@ module.exports = (shepherd) => { }); return shepherd; -}; +}; \ No newline at end of file