crypto_password_hash/3: fail if the number of iterations is too high
Discussed in #527.
This commit is contained in:
@@ -5285,7 +5285,10 @@ impl MachineState {
|
|||||||
u64::try_from(n).unwrap()
|
u64::try_from(n).unwrap()
|
||||||
}
|
}
|
||||||
Ok(Number::Integer(n)) => {
|
Ok(Number::Integer(n)) => {
|
||||||
n.to_u64().unwrap()
|
match n.to_u64() {
|
||||||
|
Some(i) => { i }
|
||||||
|
None => { self.fail = true; return Ok(()); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
unreachable!()
|
unreachable!()
|
||||||
|
|||||||
Reference in New Issue
Block a user