about:webauthn listen() passes manage() a ~16.7 hour timeout (60 * 1000 * 1000 ms) instead of ~60 seconds
Categories
(Core :: DOM: Web Authentication, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox153 | --- | fixed |
People
(Reporter: florian, Assigned: jschanck)
References
Details
Attachments
(1 external file)
In AuthrsService::listen() (dom/webauthn/authrs_bridge/src/lib.rs), the interactive management session is started with:
self.usb_token_manager.lock().unwrap().manage(60 * 1000 * 1000, status_tx, state_callback);
That timeout flows through StateMachine::manage -> Transaction::new -> RunLoop::new_with_timeout(fun, timeout_ms), which treats it as milliseconds (Duration::from_millis(timeout_ms) in the runloop crate). The sibling register() and sign() calls pass timeout_ms (the WebAuthn request timeout, in ms), confirming the unit.
60 * 1000 * 1000 = 60,000,000 ms is about 16.7 hours. The expression reads like "60 seconds in microseconds", so the intended value was almost certainly 60 * 1000 (60,000 ms = 60 s). As written, the device-discovery RunLoop timeout is effectively never reached, so the listen() device monitor never self-terminates; it stops only when explicitly cancelled.
This is why the shutdown hang in bug 2046936 was unbounded rather than self-resolving after ~60s.
Suggested fix: pass 60 * 1000 (or the intended bound) to manage().
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Comment 1•5 months ago
|
||
Comment 4•5 months ago
|
||
| bugherder | ||
Comment 5•5 months ago
|
||
| bugherder | ||
Updated•5 months ago
|
Description
•