mirror of https://github.com/keeweb/keeweb.git
fixed configs for portable installations
This commit is contained in:
parent
b9f37c22d9
commit
ccce95d4fe
|
@ -823,14 +823,16 @@ function saveConfig(name, data, key) {
|
||||||
|
|
||||||
data = Buffer.from(data);
|
data = Buffer.from(data);
|
||||||
|
|
||||||
const crypto = require('crypto');
|
if (configEncryptionKey) {
|
||||||
const cipher = crypto.createCipheriv(
|
const crypto = require('crypto');
|
||||||
'aes-256-cbc',
|
const cipher = crypto.createCipheriv(
|
||||||
key.slice(0, 32),
|
'aes-256-cbc',
|
||||||
key.slice(32, 48)
|
key.slice(0, 32),
|
||||||
);
|
key.slice(32, 48)
|
||||||
|
);
|
||||||
|
|
||||||
data = Buffer.concat([cipher.update(data), cipher.final()]);
|
data = Buffer.concat([cipher.update(data), cipher.final()]);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return reject(`Error writing config data ${name}: ${err}`);
|
return reject(`Error writing config data ${name}: ${err}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue