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 +};