export a constant for the number of required bytes at login time

allocate bytes for blockSeed when changing passwords
This commit is contained in:
ansuz
2018-06-22 11:37:48 +02:00
parent da35d94f73
commit 85bcaa51f7
2 changed files with 14 additions and 11 deletions

View File

@@ -717,14 +717,16 @@ define([
throw new Error("XXX");
var blockHash = LocalStore.getBlockHash();
var Cred, Block;
var Cred, Block, Login;
Nthen(function (waitFor) {
require([
'/customize/credential.js',
'/common/outer/login-block.js'
], waitFor(function (_Cred, _Block) {
'/common/outer/login-block.js',
'/customize/login.js'
], waitFor(function (_Cred, _Block, _Login) {
Cred = _Cred;
Block = _Block;
Login = _Login;
}));
}).nThen(function (waitFor) {
// Check if our drive is already owned
@@ -761,8 +763,9 @@ define([
}));
}).nThen(function (waitFor) {
// Drive content copied: get the new block location
Cred.deriveFromPassphrase(accountName, newPassword, 192, waitFor(function (bytes) {
newBlockSeed = null; // XXX
Cred.deriveFromPassphrase(accountName, newPassword, Login.requiredBytes, waitFor(function (bytes) {
var allocated = Login.allocateBytes(bytes);
newBlockSeed = allocated.blockSeed;
}));
}).nThen(function (waitFor) {
// Write the new login block