diff options
Diffstat (limited to 'bip39-standalone.html')
-rw-r--r-- | bip39-standalone.html | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bip39-standalone.html b/bip39-standalone.html index 367d9a2..ca18ea8 100644 --- a/bip39-standalone.html +++ b/bip39-standalone.html | |||
@@ -18964,6 +18964,10 @@ window.Entropy = new (function() { | |||
18964 | } | 18964 | } |
18965 | 18965 | ||
18966 | function calcBip32ExtendedKey(path) { | 18966 | function calcBip32ExtendedKey(path) { |
18967 | // Check there's a root key to derive from | ||
18968 | if (!bip32RootKey) { | ||
18969 | return bip32RootKey; | ||
18970 | } | ||
18967 | var extendedKey = bip32RootKey; | 18971 | var extendedKey = bip32RootKey; |
18968 | // Derive the key from the path | 18972 | // Derive the key from the path |
18969 | var pathBits = path.split("/"); | 18973 | var pathBits = path.split("/"); |
@@ -19098,6 +19102,10 @@ window.Entropy = new (function() { | |||
19098 | } | 19102 | } |
19099 | } | 19103 | } |
19100 | } | 19104 | } |
19105 | // Check root key exists or else derivation path is useless! | ||
19106 | if (!bip32RootKey) { | ||
19107 | return "No root key"; | ||
19108 | } | ||
19101 | // Check no hardened derivation path when using xpub keys | 19109 | // Check no hardened derivation path when using xpub keys |
19102 | var hardened = path.indexOf("'") > -1; | 19110 | var hardened = path.indexOf("'") > -1; |
19103 | var isXpubkey = !("privKey" in bip32RootKey); | 19111 | var isXpubkey = !("privKey" in bip32RootKey); |