Skip to content

Commit

Permalink
Merge pull request #6253 from decentraland/chore/sync
Browse files Browse the repository at this point in the history
chore: sync main to dev
  • Loading branch information
lorux0 authored Oct 4, 2024
2 parents 0dbfb81 + ced5032 commit de0457e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ export class WebSocketAdapter implements MinimumCommunicationsAdapter {
return this.handleWelcomeMessage(message.welcomeMessage, ws)
}
case 'challengeMessage': {
if (!message.challengeMessage.challengeToSign.match(/^dcl-[^:]*$/)) {
throw new Error('Protocol error: invalid challenge')
}

const authChainJson = JSON.stringify(
Authenticator.signPayload(this.identity, message.challengeMessage.challengeToSign)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export async function createArchipelagoConnection(

switch (message.$case) {
case 'challengeResponse': {
if (!message.challengeResponse.challengeToSign.match(/^dcl-[^:]*$/)) {
throw new Error('Protocol error: invalid challenge')
}

const authChainJson = JSON.stringify(
Authenticator.signPayload(identity, message.challengeResponse.challengeToSign)
)
Expand Down

0 comments on commit de0457e

Please sign in to comment.