Skip to content

CBST2-08: Validate participant ID for Dirk signer #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion crates/signer/src/manager/dirk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,22 @@ fn load_distributed_accounts(
continue;
};

if participant_id == 0 {
warn!(
"Skiping invalid participant ID (0) for account {} in host {host_name}",
account.name
);
continue
}

match consensus_accounts.get_mut(&public_key) {
Some(Account::Distributed(DistributedAccount { participants, .. })) => {
participants.insert(participant_id as u32, channel.clone());
if participants.insert(participant_id as u32, channel.clone()).is_some() {
warn!(
"Duplicated participant ID ({participant_id}) for account {} in host {host_name}. Keeping this host",
account.name
);
}
}
None => {
let Ok((wallet, name)) = decompose_name(&account.name) else {
Expand Down
Loading