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
  5. 2
      routes/shepherd/electrum/merkle.js

2
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) {

1
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",

2
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: {

7
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;
};

2
routes/shepherd/electrum/merkle.js

@ -163,4 +163,4 @@ module.exports = (shepherd) => {
});
return shepherd;
};
};
Loading…
Cancel
Save