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

update sha* alg definitions #40

Closed
wants to merge 3 commits into from

Conversation

omsmith
Copy link

@omsmith omsmith commented May 25, 2018

Working on updating the test fixtures to codify it, but do believe these should all support both ecdsa and rsa. Should be the "correct" ones to use vs the "RSA-SHA*" aliases.

Ref: auth0/node-jwa#26

@calvinmetcalf
Copy link
Contributor

ok so the key test would be one that

  1. works in current node
  2. didn't work previously here
  3. works with this change

Copy link
Author

@omsmith omsmith left a comment

Choose a reason for hiding this comment

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

I updated the tests to run the same fixtures for each equivalent algorithm. Let me know if you'd like me to take a different approach / change less, or provide a separate reproduction showing the behaviour.


t.ok(nCrypto.createVerify(f.scheme).update(message).verify(pub, nSig), 'node validate node sig')
t.ok(nCrypto.createVerify(f.scheme).update(message).verify(pub, bSig), 'node validate browser sig')
t.equals(nSig.toString('hex'), f.signature, 'node compare to known')
Copy link
Author

Choose a reason for hiding this comment

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

Tests were failing before I added the id/tag to the other definitions, so I added this as a sanity check. This was consistently "OK", meaning node was doing the expected thing.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok this is a good check

"hash": "sha256",
"id": ""
"id": "3031300d060960864801650304020105000420"
Copy link
Author

Choose a reason for hiding this comment

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

Added these to get RSA going, which is the only thing it impacts (as I'm sure you know). Although, it is a little weird to do

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah this file was just set up before I latter learned how weird some of the names were handled in node

@omsmith omsmith closed this Sep 28, 2021
@omsmith omsmith deleted the update-alg-compat branch September 28, 2021 02:29
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.

2 participants