mirror of
https://github.com/block/buzz.git
synced 2026-10-27 12:40:30 +00:00
Reduce unnecessary attack surface
Validated changes: 02-early-execution/E02 Signed-off-by: Jordan Mecom <jm@squareup.com>
This commit is contained in:
@@ -53,8 +53,6 @@ pub fn verify_nip42_event(
|
||||
return Err(AuthError::InvalidSignature);
|
||||
}
|
||||
|
||||
buzz_core::verify_event(event).map_err(|_| AuthError::InvalidSignature)?;
|
||||
|
||||
let challenge = event
|
||||
.tags
|
||||
.find(TagKind::Challenge)
|
||||
@@ -65,6 +63,10 @@ pub fn verify_nip42_event(
|
||||
return Err(AuthError::ChallengeMismatch);
|
||||
}
|
||||
|
||||
// Reject proofs for another connection before hashing and Schnorr verification.
|
||||
// Matching a challenge never replaces cryptographic verification.
|
||||
buzz_core::verify_event(event).map_err(|_| AuthError::InvalidSignature)?;
|
||||
|
||||
let relay = event
|
||||
.tags
|
||||
.find(TagKind::Relay)
|
||||
|
||||
Reference in New Issue
Block a user