Preserve config canary string.
This commit is contained in:
parent
9e4c7e609d
commit
7157816fa5
|
@ -22,6 +22,7 @@ function Config(filename) {
|
|||
this.salt = null;
|
||||
this.dkey = null;
|
||||
this.values = { };
|
||||
this.canary = "";
|
||||
this.filename = filename;
|
||||
}
|
||||
|
||||
|
@ -37,6 +38,8 @@ Config.prototype.load = async function() {
|
|||
};
|
||||
}
|
||||
|
||||
this.canary = data.canary || "";
|
||||
|
||||
this.salt = data.salt;
|
||||
|
||||
const password = await prompt.getPassword(colorify("Password (config-store): ", "bold"));
|
||||
|
@ -77,7 +80,8 @@ Config.prototype.save = function() {
|
|||
ciphertext: ciphertext.toString("base64"),
|
||||
iv: iv.toString("base64"),
|
||||
salt: this.salt,
|
||||
hmac: hmac
|
||||
hmac: hmac,
|
||||
canary: this.canary
|
||||
};
|
||||
|
||||
fs.writeFileSync(this.filename, JSON.stringify(data, null, 2));
|
||||
|
|
Loading…
Reference in New Issue