mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-09 12:29:27 +00:00
Add recent bloat checks added to signer to substrate_signer as well
This commit is contained in:
parent
09c3c9cc9e
commit
ef0c901455
1 changed files with 14 additions and 4 deletions
|
@ -233,9 +233,14 @@ impl<D: Db> SubstrateSigner<D> {
|
||||||
let preprocesses = match preprocesses
|
let preprocesses = match preprocesses
|
||||||
.drain()
|
.drain()
|
||||||
.map(|(l, preprocess)| {
|
.map(|(l, preprocess)| {
|
||||||
machine
|
let mut preprocess_ref = preprocess.as_ref();
|
||||||
.read_preprocess::<&[u8]>(&mut preprocess.as_ref())
|
let res = machine
|
||||||
.map(|preprocess| (l, preprocess))
|
.read_preprocess::<&[u8]>(&mut preprocess_ref)
|
||||||
|
.map(|preprocess| (l, preprocess));
|
||||||
|
if !preprocess_ref.is_empty() {
|
||||||
|
todo!("malicious signer: extra bytes");
|
||||||
|
}
|
||||||
|
res
|
||||||
})
|
})
|
||||||
.collect::<Result<_, _>>()
|
.collect::<Result<_, _>>()
|
||||||
{
|
{
|
||||||
|
@ -283,7 +288,12 @@ impl<D: Db> SubstrateSigner<D> {
|
||||||
let shares = match shares
|
let shares = match shares
|
||||||
.drain()
|
.drain()
|
||||||
.map(|(l, share)| {
|
.map(|(l, share)| {
|
||||||
machine.read_share::<&[u8]>(&mut share.as_ref()).map(|share| (l, share))
|
let mut share_ref = share.as_ref();
|
||||||
|
let res = machine.read_share::<&[u8]>(&mut share_ref).map(|share| (l, share));
|
||||||
|
if !share_ref.is_empty() {
|
||||||
|
todo!("malicious signer: extra bytes");
|
||||||
|
}
|
||||||
|
res
|
||||||
})
|
})
|
||||||
.collect::<Result<_, _>>()
|
.collect::<Result<_, _>>()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue