mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-12 11:19:08 -05:00
key: clear out secret data in DecodeExtKey
Same as in `DecodeSecret`, we should also clear out the secret data from
the vector resulting from the Base58Check parsing for xprv keys. Note
that the if condition is needed in order to avoid UB, see #14242 (commit
d855e4cac8
).
This commit is contained in:
parent
2a52718d73
commit
559a8dd9c0
1 changed files with 3 additions and 0 deletions
|
@ -274,6 +274,9 @@ CExtKey DecodeExtKey(const std::string& str)
|
|||
key.Decode(data.data() + prefix.size());
|
||||
}
|
||||
}
|
||||
if (!data.empty()) {
|
||||
memory_cleanse(data.data(), data.size());
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue