-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Conversation
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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]) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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
LGTM otherwise |
Ok will update |
fix for #32