X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git;a=blobdiff_plain;f=bip39-standalone.html;h=ca18ea8b609890fc6e2f706a02e07df8a29fb64d;hp=367d9a2fdc1d923728b3cf88e45a1c2f18a0f0c6;hb=0a1f0259d1cfe5217ca9c08f7fbd371a03703594;hpb=ba3cb9ecae2667e98af71f5b38a862ba604e8e1c 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() { } function calcBip32ExtendedKey(path) { + // Check there's a root key to derive from + if (!bip32RootKey) { + return bip32RootKey; + } var extendedKey = bip32RootKey; // Derive the key from the path var pathBits = path.split("/"); @@ -19098,6 +19102,10 @@ window.Entropy = new (function() { } } } + // Check root key exists or else derivation path is useless! + if (!bip32RootKey) { + return "No root key"; + } // Check no hardened derivation path when using xpub keys var hardened = path.indexOf("'") > -1; var isXpubkey = !("privKey" in bip32RootKey);