Skip to content

Conversation

@dcousens
Copy link
Contributor

This avoids the problem where a user may accidentally give an invalid seed Buffer which could be catastrophically interpreted as a seed of 0.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling ddcde03 on dcousens:hdstrict into 656de37 on bitcoinjs:master.

src/hdnode.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

@dcousens Since when are "atmost" and "atleast" actual words? ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ha. I feel like they are, but it appears you are correct. Will fix.
On Jul 11, 2014 6:10 PM, "Wei Lu" notifications@github.com wrote:

In src/hdnode.js:

@@ -51,6 +51,10 @@ HDNode.HIGHEST_BIT = 0x80000000
HDNode.LENGTH = 78

HDNode.fromSeedBuffer = function(seed, network) {

  • assert(Buffer.isBuffer(seed), 'Expected Buffer, got' + seed)
  • assert(seed.length >= 16, 'Seed should be atleast 128 bits')
  • assert(seed.length <= 64, 'Seed should be atmost 512 bits')

@dcousens https://github.com/dcousens Since when are "atmost" and
"atleast" actual words? ;)


Reply to this email directly or view it on GitHub
https://github.com/bitcoinjs/bitcoinjs-lib/pull/242/files#r14810498.

@dcousens
Copy link
Contributor Author

@weilu fixed spelling and added a separate commit for something that was causing me problems in Transaction.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling a90a8e0 on dcousens:hdstrict into 656de37 on bitcoinjs:master.

@dcousens dcousens changed the title HDNode: enforces sane seed lengths HDNode: enforces sane seed lengths and Transaction input Jul 11, 2014
weilu added a commit that referenced this pull request Jul 11, 2014
HDNode: enforces sane seed lengths and Transaction input
@weilu weilu merged commit 490b348 into bitcoinjs:master Jul 11, 2014
@dcousens dcousens deleted the hdstrict branch July 11, 2014 10:28
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