Browse Source

string entropy check

custom-ac-example
pbca26 7 years ago
parent
commit
b588f627d6
  1. 2
      main.js
  2. 1
      package.json
  3. 2
      routes/appConfig.js
  4. 7
      routes/shepherd/auth.js

2
main.js

@ -288,8 +288,8 @@ function createWindow(status, hideLoadingWindow) {
firstLoginPH: null, firstLoginPH: null,
secondaryLoginPH: null, secondaryLoginPH: null,
}; };
mainWindow.nnVoteChain = 'VOTE2018'; mainWindow.nnVoteChain = 'VOTE2018';
mainWindow.checkStringEntropy = shepherd.checkStringEntropy;
/*for (let i = 0; i < process.argv.length; i++) { /*for (let i = 0; i < process.argv.length; i++) {
if (process.argv[i].indexOf('nvote') > -1) { if (process.argv[i].indexOf('nvote') > -1) {

1
package.json

@ -48,6 +48,7 @@
"js-sha256": "^0.7.1", "js-sha256": "^0.7.1",
"marketmaker": "git://github.com/pbca26/marketmaker", "marketmaker": "git://github.com/pbca26/marketmaker",
"nodejs-aes256": "^1.0.1", "nodejs-aes256": "^1.0.1",
"passwd-strength": "https://github.com/pbca26/passwd-strength",
"portscanner": "^2.1.1", "portscanner": "^2.1.1",
"ps-node": "^0.1.5", "ps-node": "^0.1.5",
"remote-file-size": "^3.0.3", "remote-file-size": "^3.0.3",

2
routes/appConfig.js

@ -71,7 +71,7 @@ const appConfig = {
experimentalFeatures: { experimentalFeatures: {
display: true, display: true,
initDisplay: true, initDisplay: true,
displayName: 'Enable experimental features', displayName: 'Enable advanced features',
type: 'boolean', type: 'boolean',
}, },
dataDir: { dataDir: {

7
routes/shepherd/auth.js

@ -1,3 +1,5 @@
const passwdStrength = require('passwd-strength');
module.exports = (shepherd) => { module.exports = (shepherd) => {
/* /*
* type: GET * 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; return shepherd;
}; };
Loading…
Cancel
Save