add work-around to keep ct_eq from being optimized out

See #416 for details
This commit is contained in:
bunnie 2023-09-19 00:58:50 +08:00
parent bdf70ab0e4
commit 43b0beecd4

View file

@ -175,6 +175,8 @@ impl ClientPin {
.map_err(|_| Ctap2StatusCode::CTAP2_ERR_PIN_INVALID)?;
if !bool::from(pin_hash.ct_eq(&pin_hash_dec)) {
// this lines ensures that the equality check above works in Rust v1.72.
// log::trace!("ct_eq: {:?}", bool::from(pin_hash.ct_eq(&pin_hash_dec)));
self.get_mut_pin_protocol(pin_uv_auth_protocol)
.regenerate(env.rng());
if storage::pin_retries(env)? == 0 {