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 remove signature reference test. #1604

Merged
merged 1 commit into from
Feb 14, 2019

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Feb 13, 2019

An important (and easy for implementations to miss) aspect of the CHECKSIG opcodes is that the full signature (signature plus hash type) that is being checked is first removed from the script prior to calculating the signature hash against which the signature is verified.

It appears the test in the upstream btcsuite code for this was removed during the initial Decred port instead of being converted as it should have been.

Consequently, this converts the relevant test so it is correct for Decred and adds it to the reference tests. Note that the first of the two added tests is to ensure the original signature is valid prior to testing the actual removal condition.

@davecgh davecgh added this to the 1.5.0 milestone Feb 13, 2019
An important (and easy for implementations to miss) aspect of the
CHECKSIG opcodes is that the full signature (signature plus hash type)
that is being checked is first removed from the script prior to
calculating the signature hash against which the signature is verified.

It appears the test in the upstream btcsuite code for this was removed
during the initial Decred port instead of being converted as it should
have been.

Consequently, this converts the relevant test so it is correct for
Decred and adds it to the reference tests.  Note that the first of the
two added tests is to ensure the original signature is valid prior to
testing the actual removal condition.
@davecgh davecgh force-pushed the txscript_removedata_test branch from ce25e2a to 1f5abad Compare February 14, 2019 20:10
@davecgh davecgh merged commit 1f5abad into decred:master Feb 14, 2019
@davecgh davecgh deleted the txscript_removedata_test branch February 14, 2019 20:35
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