Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #381. Set secret string before using jws when alg is none #382

Merged
merged 2 commits into from
Aug 17, 2017
Merged

Fix for #381. Set secret string before using jws when alg is none #382

merged 2 commits into from
Aug 17, 2017

Conversation

rhysmccaig
Copy link

Fix for #381.

  • When secret is Falsy, but algorithm is set to none, make secret a non zero length string before using jws.sign()/createSign()
  • Added 2 unit tests

@@ -67,7 +67,11 @@ module.exports = function (payload, secretOrPrivateKey, options, callback) {
}

if (!secretOrPrivateKey) {
Copy link
Contributor

@ziluvatar ziluvatar Aug 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we modify the if statement to take that situation into account? Something like (!secretOrPrivateKey && options.algorithm !== 'none') what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants