Reduce unnecessary attack surface

Validated changes: 02-early-execution/E02

Signed-off-by: Jordan Mecom <jm@squareup.com>
This commit is contained in:
Jordan Mecom
2026-10-21 15:09:17 -07:00
parent 1a54eec3db
commit 2f65941738

View File

@@ -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)