# 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 { 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).