mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-31 10:41:08 +00:00
musig: Check session id reuse
Prevent saving another secnonce to the same session id since this might make nonce reuse possible.
This commit is contained in:
parent
e755614be5
commit
c9519c260b
@ -122,7 +122,9 @@ std::map<CPubKey, std::vector<CPubKey>> FlatSigningProvider::GetAllMuSig2Partici
|
||||
void FlatSigningProvider::SetMuSig2SecNonce(const uint256& session_id, MuSig2SecNonce&& nonce) const
|
||||
{
|
||||
if (!Assume(musig2_secnonces)) return;
|
||||
musig2_secnonces->emplace(session_id, std::move(nonce));
|
||||
auto [it, inserted] = musig2_secnonces->try_emplace(session_id, std::move(nonce));
|
||||
// No secnonce should exist for this session yet.
|
||||
Assert(inserted);
|
||||
}
|
||||
|
||||
std::optional<std::reference_wrapper<MuSig2SecNonce>> FlatSigningProvider::GetMuSig2SecNonce(const uint256& session_id) const
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user