From 67f18e8301c1f5f844a3092b2bae2d2578dd464a Mon Sep 17 00:00:00 2001 From: Vivek Rp Date: Tue, 4 May 2021 03:33:10 +0530 Subject: [PATCH] Update hmac.js --- cryptojs/hmac.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cryptojs/hmac.js b/cryptojs/hmac.js index d3176ac..bd792a3 100644 --- a/cryptojs/hmac.js +++ b/cryptojs/hmac.js @@ -9,6 +9,10 @@ module.exports = function (RED) { node.key = config.key; node.on('input', function (msg) { + // first check if secret key was sent via msg first. If true overwrite user entered secret key in configuration. + if(msg.secrectkey) { + node.key = msg.secrectkey; + } // check configurations if(!node.algorithm || !node.key) { // rising misconfiguration error @@ -31,4 +35,4 @@ module.exports = function (RED) { } RED.nodes.registerType("hmac", DigestNode); -}; \ No newline at end of file +};