It contains a non-DER-conformant ASN1 integer as a signature: 0xffda47bfc776bcd269da4832626ac332adfca6dd835e8ecd83cd1ebe7d709b0e
Document the non-DER-conformance of one test in tx_valid.json. #10679
pull schildbach wants to merge 1 commits into bitcoin:master from schildbach:tx-valid-comment changing 1 files +1 −1-
schildbach commented at 6:42 AM on June 27, 2017: contributor
- fanquake added the label Docs and Output on Jun 27, 2017
- fanquake added the label Tests on Jun 27, 2017
-
gmaxwell commented at 7:14 PM on June 27, 2017: contributor
Please document how it's not DER conformant too.
-
schildbach commented at 1:51 PM on June 28, 2017: contributor
Here is the code in BouncyCastle that checks ASN1 integers. How would you describe this code? Check if it's a "Two's complement"?
if (bytes[0] == 0 && (bytes[1] & 0x80) == 0) { throw new IllegalArgumentException("malformed integer"); } if (bytes[0] == (byte)0xff && (bytes[1] & 0x80) != 0) { throw new IllegalArgumentException("malformed integer"); } -
laanwj commented at 10:10 AM on June 29, 2017: member
secp256k1 calls it "Excessive 0xFF padding" (and if it would pass that one, it's also negative) https://github.com/bitcoin-core/secp256k1/blob/master/src/ecdsa_impl.h#L120
So it's DER conformant just not strict DER conformant?
-
gmaxwell commented at 7:02 PM on June 30, 2017: contributor
I think I would just call it negative. It's perfectly valid to encode negative numbers in DER but they don't make sense in signatures-- so for some inexplicable reason OpenSSL just ignored the sign.
-
c1c845e827
Document the non-strict-DER-conformance of one test in tx_valid.json.
In a signature, it contains an ASN1 integer which isn't strict-DER conformant due to excessive 0xff padding: 0xffda47bfc776bcd269da4832626ac332adfca6dd835e8ecd83cd1ebe7d709b0e
- schildbach force-pushed on Jun 30, 2017
-
schildbach commented at 7:31 PM on June 30, 2017: contributor
Thanks, I changed the wording and added a reference to BIP66. What I don't understand is why this test is in tx_valid.json and not in tx_invalid.json. BIP66 declares such sigs as invalid. Or do the tests run pre-BIP66?
-
sipa commented at 7:50 PM on June 30, 2017: member
Each test specifies its own flags. If nothing is specified, the flags are 0, I believe. So no BIP66 rules in this test.
- laanwj referenced this in commit 31b2612bbf on Aug 23, 2017
- laanwj closed this on Aug 23, 2017
- PastaPastaPasta referenced this in commit 318a051b42 on Sep 19, 2019
- PastaPastaPasta referenced this in commit 6c91194a86 on Sep 19, 2019
- PastaPastaPasta referenced this in commit 6dd38458f4 on Sep 23, 2019
- PastaPastaPasta referenced this in commit a04c0cb3a4 on Sep 24, 2019
- PastaPastaPasta referenced this in commit dcb49a1a7a on Nov 19, 2019
- PastaPastaPasta referenced this in commit 8c149cb132 on Nov 21, 2019
- PastaPastaPasta referenced this in commit 1e2506c3a1 on Dec 9, 2019
- PastaPastaPasta referenced this in commit 2746b92039 on Jan 1, 2020
- PastaPastaPasta referenced this in commit 24096fb60a on Jan 2, 2020
- PastaPastaPasta referenced this in commit e58fed348f on Jan 2, 2020
- ckti referenced this in commit 82dd338e91 on Mar 28, 2021
- DrahtBot locked this on Sep 8, 2021