mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Alternate handover batch TOCTOU fix (#397)
* Revert "Correct the prior documented TOCTOU" This reverts commitd50fe87801. * Correct the prior documented TOCTOUd50fe87801edited the challenge for the Batch to fix it. This won't produce Batch n+1 until Batch n is successfully published and verified. It's an alternative strategy able to be reviewed, with a much smaller impact to scope.
This commit is contained in:
@@ -146,9 +146,8 @@ async fn test_substrate_signer() {
|
||||
signers.get_mut(i).unwrap().events.pop_front().unwrap()
|
||||
{
|
||||
assert_eq!(signed_batch.batch, batch);
|
||||
// SubstrateSigner will believe this is the first batch for this set, hence `true`
|
||||
assert!(Public::from_raw(keys[&participant_one].group_key().to_bytes())
|
||||
.verify(&batch_message(true, &batch), &signed_batch.signature));
|
||||
.verify(&batch_message(&batch), &signed_batch.signature));
|
||||
} else {
|
||||
panic!("didn't get signed batch back");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user