Skip to content

Conversation

@sipa
Copy link
Member

@sipa sipa commented Dec 19, 2012

0 and 128 were previously accepted as standard hash type.

Note that this function is not active in the current verification code.

@BitcoinPullTester
Copy link

@petertodd
Copy link
Contributor

Is the specification of the format signatures follow easily available? I assume it's an RFC or the like somewhere, (as well as whatever defines ASN-encoding) but what one? It'd be helpful if IsCanonicalSignature() had a comment directing people to what standard (and part of the standard) we're trying to try to check against. The forum link goes into more detail of course, but it's still not clear as to what standard exactly we're talking about.

I mean, normally it's fine leaving this stuff as "to be understood", but script.cpp is one of the most important things defining what is or isn't Bitcoin, and I'm sure there are a lot of people reading it and trying to understand it in detail. Making that easier to do doesn't hurt.

src/script.cpp Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: how about:
if (nHashType < SIGHASH_ALL || nHashType > SIGHASH_SINGLE)

0 and 128 were previously accepted as standard hash type.

Note that this function is not active in the current verification
code.
@BitcoinPullTester
Copy link

@sipa
Copy link
Member Author

sipa commented Dec 25, 2012

@petertodd Good idea. I'll try to add some references in comments soon.

gavinandresen added a commit that referenced this pull request Jan 23, 2013
Make IsCanonicalScript() check the hash type more thoroughly
@gavinandresen gavinandresen merged commit c429f2b into bitcoin:master Jan 23, 2013
@sipa sipa deleted the strictstrict branch May 3, 2013 18:52
laudney pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this pull request Mar 19, 2014
Make IsCanonicalScript() check the hash type more thoroughly
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants