From 9d0198fc9f7854497ae61c5c44c2d966277e0383 Mon Sep 17 00:00:00 2001 From: AlefrankM Date: Tue, 15 Nov 2022 14:23:18 -0400 Subject: [PATCH] refactor: decrypt private key --- src/metis/controllers/cryptoLoginController.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/metis/controllers/cryptoLoginController.js b/src/metis/controllers/cryptoLoginController.js index dbdf313..7f344f6 100644 --- a/src/metis/controllers/cryptoLoginController.js +++ b/src/metis/controllers/cryptoLoginController.js @@ -263,13 +263,19 @@ module.exports = (app, jobs, websocket) => { }, decryptPrivateKey: async (req, res) => { - const { passphrase, privateKeyArmored, config } = req.body + const { passphrase, privateKeyArmored } = req.body + + const config = { + preferredHashAlgorithm: enums.hash.sha256, + preferredSymmetricAlgorithm: enums.symmetric.aes128 + } const privateKey = await readPrivateKey({ armoredKey: privateKeyArmored, config }) const data = await decryptKey({ privateKey, passphrase }) + res.json(data) },