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

txscript: Add new flag ScriptVerifyLowS #349

Merged
merged 1 commit into from
Mar 14, 2015
Merged

txscript: Add new flag ScriptVerifyLowS #349

merged 1 commit into from
Mar 14, 2015

Conversation

dajohi
Copy link
Member

@dajohi dajohi commented Mar 13, 2015

The ScriptVerifyLowS flag defines that script signatures must
comply with the DER format as well as have an S value less than
or equal to the half order.

@@ -367,6 +377,44 @@ func (s *Script) checkHashTypeEncoding(hashType SigHashType) error {
return nil
}

func (s *Script) checkLowDERSignature(sig []byte) error {
Copy link
Member

Choose a reason for hiding this comment

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

Missing a comment here.

Copy link
Member

Choose a reason for hiding this comment

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

After reviewing more, I personally don't think this function should exist at all. Rather, the checkSignatureEncoding function should check the flag at the appropriate place and do the check there:

if s.verifyLowS { /* do the checks and return error if no good */ }

I'd rather not check the signature (and bounds) multiple times.

The ScriptVerifyLowS flag defines that script signatures must
comply with the DER format as well as have an S value less than
or equal to the half order.
@davecgh
Copy link
Member

davecgh commented Mar 14, 2015

OK

@conformal-deploy conformal-deploy merged commit 369b352 into btcsuite:master Mar 14, 2015
@dajohi dajohi deleted the low_s branch March 14, 2015 19:30
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.

3 participants