Skip to content

Commit

Permalink
Update hmac.js
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekrp authored May 3, 2021
1 parent 1a7c320 commit 67f18e8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cryptojs/hmac.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,4 +35,4 @@ module.exports = function (RED) {
}

RED.nodes.registerType("hmac", DigestNode);
};
};

0 comments on commit 67f18e8

Please sign in to comment.