Skip to content

Commit

Permalink
fix: validate challenge to sign
Browse files Browse the repository at this point in the history
  • Loading branch information
leanmendoza committed Oct 4, 2024
1 parent ec56b11 commit 3da572b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/src/comms/adapter/archipelago.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ impl ArchipelagoManager {

let challenge_to_sign = challenge_msg.challenge_to_sign.clone();

if !challenge_to_sign.starts_with("dcl-") {
tracing::error!("invalid challenge to sign");
return;
}

// TODO: should this block_on be async? the ephemeral wallet is sync
let signature = futures_lite::future::block_on(
self.ephemeral_auth_chain
Expand Down
5 changes: 5 additions & 0 deletions lib/src/comms/adapter/ws_room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ impl WebSocketRoom {

let challenge_to_sign = challenge_msg.challenge_to_sign.clone();

if !challenge_to_sign.starts_with("dcl-") {
tracing::error!("invalid challenge to sign");
return;
}

// TODO: should this block_on be async? the ephemeral wallet is sync
let signature = futures_lite::future::block_on(
self.ephemeral_auth_chain
Expand Down

0 comments on commit 3da572b

Please sign in to comment.