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 recover (add more signature validation) #64

Merged
merged 2 commits into from
Jan 20, 2016
Merged

Fix recover (add more signature validation) #64

merged 2 commits into from
Jan 20, 2016

Conversation

fanatid
Copy link
Member

@fanatid fanatid commented Jan 18, 2016

See #63

@fanatid
Copy link
Member Author

fanatid commented Jan 18, 2016

Tests fails, I'll fix in few hours.

@@ -30,5 +32,9 @@ exports.verifySync = function (msg, signature, publicKey) {
}

var sigObj = {r: signature.slice(0, 32), s: signature.slice(32, 64)}
if (new BN(sigObj.s).cmp(ec.nh) === 1 || new BN(sigObj.r).isZero() || new BN(sigObj.s).isZero()) {
Copy link
Member

Choose a reason for hiding this comment

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

Should this or the equivalent go directly in elliptic?

Copy link
Member Author

Choose a reason for hiding this comment

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

Check elliptic and ec.verify already has isZero checks.

wanderer added a commit that referenced this pull request Jan 20, 2016
Fix recover (add more signature validation)
@wanderer wanderer merged commit 27c39d3 into cryptocoinjs:master Jan 20, 2016
@wanderer
Copy link
Member

lgtm

@fanatid fanatid deleted the fix/recover branch January 20, 2016 03:14
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

2 participants