This commit is contained in:
Christopher Jeffrey 2016-05-17 15:25:39 -07:00
parent 559cb62889
commit 370b5aeb24
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 6 additions and 6 deletions

View File

@ -366,11 +366,12 @@ HD.parsePath = function parsePath(path, max) {
if (max == null)
max = constants.hd.MAX_INDEX;
if (constants.hd.PATH_ROOTS.indexOf(path) !== -1)
return result;
if (constants.hd.PATH_ROOTS.indexOf(root) === -1)
if (root !== 'm'
&& root !== 'M'
&& root !== 'm\''
&& root !== 'M\'') {
throw new Error('Bad path root.');
}
for (i = 0; i < parts.length; i++) {
index = parts[i];

View File

@ -516,8 +516,7 @@ exports.hd = {
HARDENED: 0x80000000,
MAX_INDEX: 0x100000000,
MIN_ENTROPY: 128 / 8,
MAX_ENTROPY: 512 / 8,
PATH_ROOTS: ['m', 'M', 'm\'', 'M\'']
MAX_ENTROPY: 512 / 8
};
/**