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

add support for calling ECDSA signatures RSA signatures, cuz node allows it #33

Merged
merged 3 commits into from
Mar 27, 2017

Conversation

calvinmetcalf
Copy link
Contributor

fix for #32

@calvinmetcalf
Copy link
Contributor Author

I'm going to go ahead and merge/publish this latter if nobody objects

@@ -63,6 +63,7 @@ fixtures.valid.ec.forEach(function (f) {
}

test(f.message, function (t) {
console.log(f.scheme)
Copy link
Member

Choose a reason for hiding this comment

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

random console.log

if (f.scheme !== 'DSA' && f.scheme.toLowerCase().indexOf('dsa') === -1) {
test(f.message + ' named rsa through', function (t) {
var scheme = 'RSA-' + f.scheme.toUpperCase()
console.log(scheme)
Copy link
Member

Choose a reason for hiding this comment

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

here too

}

hash = Buffer.concat([tag, hash])
Copy link
Member

@dcousens dcousens Nov 29, 2016

Choose a reason for hiding this comment

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

why did you move this in?

Doesn't really matter I suppose, just seems odd

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah it's because we only need the tag when it is an rsa key NOT when it's an ecdsa key so since we can't tell based on the signature type asked for we have to do it based on what rutine they are using, so this code path only is executed for rsa signatures never (ec)dsa

var priv = parseKeys(key)
if (priv.curve) {
if (signType !== 'ecdsa') throw new Error('wrong private key type')
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment here about why this is the case?
ecdsa/rsa seems strange

@dcousens
Copy link
Member

LGTM otherwise

@calvinmetcalf
Copy link
Contributor Author

Ok will update

@calvinmetcalf calvinmetcalf merged commit 7c2b956 into master Mar 27, 2017
@ljharb ljharb deleted the elliptical-curve-rsa-sic branch September 20, 2023 16:51
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