Merge pull request #423 from bitcoinjs/bip66adherance
adhere more closely to BIP66
This commit is contained in:
commit
a8f36ba515
3 changed files with 36 additions and 26 deletions
test
|
@ -66,7 +66,7 @@ describe('ECSignature', function () {
|
|||
})
|
||||
|
||||
fixtures.invalid.DER.forEach(function (f) {
|
||||
it('throws on ' + f.hex, function () {
|
||||
it('throws "' + f.exception + '" for ' + f.hex, function () {
|
||||
var buffer = new Buffer(f.hex, 'hex')
|
||||
|
||||
assert.throws(function () {
|
||||
|
|
14
test/fixtures/ecsignature.json
vendored
14
test/fixtures/ecsignature.json
vendored
|
@ -129,6 +129,14 @@
|
|||
}
|
||||
],
|
||||
"DER": [
|
||||
{
|
||||
"exception": "DER sequence too short",
|
||||
"hex": "ffffffffffffff"
|
||||
},
|
||||
{
|
||||
"exception": "DER sequence too long",
|
||||
"hex": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
|
||||
},
|
||||
{
|
||||
"exception": "Invalid sequence length",
|
||||
"hex": "30ff020400ffffff020400ffffff"
|
||||
|
@ -147,7 +155,11 @@
|
|||
},
|
||||
{
|
||||
"exception": "Invalid DER encoding",
|
||||
"hex": "300c020400ffffff020200ffffff"
|
||||
"hex": "300c0204ddffffff020200ffffff"
|
||||
},
|
||||
{
|
||||
"exception": "Invalid DER encoding \\(2\\)",
|
||||
"hex": "300c020400ffffff02dd00ffffff"
|
||||
},
|
||||
{
|
||||
"exception": "R length is zero",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue