Merge pull request from bitcoinjs/bip66adherance

adhere more closely to BIP66
This commit is contained in:
Daniel Cousens 2015-07-20 09:20:40 +10:00
commit a8f36ba515
3 changed files with 36 additions and 26 deletions

View file

@ -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 () {

View file

@ -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",