Skip to main content

verify_password_off_runtime

Function verify_password_off_runtime 

Source
pub async fn verify_password_off_runtime(
    stored: &str,
    password: &str,
) -> Result<bool, PasswordError>
Expand description

verify_password on tokio’s blocking pool.

600 000 iterations is ~85 ms of one core. Run inline in an async handler it holds a runtime worker for all of that, and a burst of logins stalls every other task scheduled on the same workers — the ACME listener included. Every verification an async caller makes goes through here; the synchronous function stays for the CLI and the tests.

A panic in the KDF resumes on the caller, exactly as it would have inline. A task cancelled because the runtime is shutting down verified nothing, and answers Ok(false).