mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-09 04:39:08 +02:00
Merge bitcoin/bitcoin#31166: key: clear out secret data in DecodeExtKey
559a8dd9c0aafcecf00f9ccd9aabe5720bcebe8c key: clear out secret data in `DecodeExtKey` (Sebastian Falbesoner)
Pull request description:
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 d855e4cac8303ad4e34ac31cfa7634286589ce99).
ACKs for top commit:
davidgumberg:
utACK 559a8dd9c0
achow101:
ACK 559a8dd9c0aafcecf00f9ccd9aabe5720bcebe8c
tdb3:
cr ACK 559a8dd9c0aafcecf00f9ccd9aabe5720bcebe8c
laanwj:
Code review ACK 559a8dd9c0aafcecf00f9ccd9aabe5720bcebe8c
Tree-SHA512: c22499fe2899a9a5a58159ec55e94cf961570d8af06358d4a6d1943d567be9b88657af90d060d3083985ea957886a4f91bb762a2fcf3311007e7a535b42b0fde
This commit is contained in:
commit
02be3dced7
@ -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…
x
Reference in New Issue
Block a user