open-standards/wai/http-conformance/falsify/sig-key-lenient.patch
Transaction Science 0be54c6987 Leave wai-quantum on its own verifier; the rule goes back into wai-rs
wai-quantum belongs to another line of work that is shipping releases, and
moving it was not needed to put every signature check written in wai-rs on one
strict verifier. This undoes c37c3e9a and the quantum-ops part of 9b5854aa:
wai/wai-sig is gone, wai-rs/src/sig.rs is the rule again (under the `ed25519`
feature), and wai-quantum, its Cargo.toml and lock, every other workspace's
lock, the quantum-ops corpus and wai_quantum_ops_vectors are as main has them.
wai-quantum's lenient checks are reported to its owner instead.

The JWP, signer and packaging weak-key cases stay; they verify through
wai::sig. The two HTTP falsify patches are cut against wai-rs/src/sig.rs again,
and wai-http and wai-pack fire on claim-conformance/_ed25519.py, which their
Python verifiers read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 14:33:18 -04:00

25 lines
1.1 KiB
Diff

# must fail: playlist_receipt_sig_key_identity playlist_receipt_sig_key_identity_long playlist_receipt_sig_r_small_order
# keys read as the library reads them, and the equation checked leniently (wai::sig)
diff --git a/wai/wai-rs/src/sig.rs b/wai/wai-rs/src/sig.rs
index 48a10219..7a770fae 100644
--- a/wai/wai-rs/src/sig.rs
+++ b/wai/wai-rs/src/sig.rs
@@ -64,9 +64,6 @@ fn below_l(s: &[u8; 32]) -> bool {
/// large order.
pub fn strict_key(bytes: &[u8; 32]) -> Result<VerifyingKey, SigError> {
let key = VerifyingKey::from_bytes(bytes).map_err(|_| SigError::BadKey)?;
- if key.to_edwards().compress().to_bytes() != *bytes || key.is_weak() {
- return Err(SigError::BadKey);
- }
Ok(key)
}
@@ -77,7 +74,7 @@ pub fn verify_strict(pubkey: &[u8; 32], msg: &[u8], sig: &[u8; 64]) -> Result<()
if !below_l(s) {
return Err(SigError::BadSignature);
}
- key.verify_strict(msg, &Signature::from_bytes(sig)).map_err(|_| SigError::BadSignature)
+ ed25519_dalek::Verifier::verify(&key, msg, &Signature::from_bytes(sig)).map_err(|_| SigError::BadSignature)
}
/// The identity point, canonically encoded (y = 1).