1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Add support for IIS account migration.

This commit is contained in:
Ylian Saint-Hilaire 2017-11-02 18:44:27 -07:00
parent e75adafb05
commit c0d0166184
6 changed files with 89 additions and 19 deletions

14
pass.js
View file

@ -39,4 +39,16 @@ exports.hash = function (pwd, salt, fn) {
}
});
}
};
};
exports.iishash = function (type, pwd, salt, fn) {
if (type == 0) {
fn(null, pwd);
} else if (type == 1) {
const hash = crypto.createHash('sha1');
hash.update(Buffer.concat([new Buffer(salt, 'base64'), new Buffer(pwd, 'utf16le')]));
fn(null, hash.digest().toString('base64'));
} else {
fn('invalid type');
}
};