Skip to content

Commit 7157816

Browse files
committed
Preserve config canary string.
1 parent 9e4c7e6 commit 7157816

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

admin/config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function Config(filename) {
2222
this.salt = null;
2323
this.dkey = null;
2424
this.values = { };
25+
this.canary = "";
2526
this.filename = filename;
2627
}
2728

@@ -37,6 +38,8 @@ Config.prototype.load = async function() {
3738
};
3839
}
3940

41+
this.canary = data.canary || "";
42+
4043
this.salt = data.salt;
4144

4245
const password = await prompt.getPassword(colorify("Password (config-store): ", "bold"));
@@ -77,7 +80,8 @@ Config.prototype.save = function() {
7780
ciphertext: ciphertext.toString("base64"),
7881
iv: iv.toString("base64"),
7982
salt: this.salt,
80-
hmac: hmac
83+
hmac: hmac,
84+
canary: this.canary
8185
};
8286

8387
fs.writeFileSync(this.filename, JSON.stringify(data, null, 2));

0 commit comments

Comments
 (0)