Commit 1b437894 authored by Martin Kreichgauer's avatar Martin Kreichgauer Committed by Commit Bot

device/fido/mac: invalidate LAContext before deleting it

This causes any pending Touch ID consent prompt to be dismissed when the
authenticator is deleted, e.g. because the transaction was cancelled.
Otherwise the dialog sticks around until the OS lets it time out.

(See https://developer.apple.com/documentation/localauthentication/lacontext/1514192-invalidate?changes=_2.)

Bug: 678128
Change-Id: Ic4102b54ec78781ed869fa6a7827885ace5345e1
Reviewed-on: https://chromium-review.googlesource.com/1137218Reviewed-by: default avatarJun Choi <hongjunchoi@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Martin Kreichgauer <martinkr@google.com>
Cr-Commit-Position: refs/heads/master@{#575729}
parent c034c9ed
......@@ -34,7 +34,12 @@ TouchIdContext::TouchIdContext()
callback_(),
weak_ptr_factory_(this) {}
TouchIdContext::~TouchIdContext() = default;
TouchIdContext::~TouchIdContext() {
// Invalidating the LAContext will dismiss any pending UI dialog (e.g. if the
// transaction was cancelled while we are waiting for a fingerprint). Simply
// releasing the LAContext does not have the same effect.
[context_ invalidate];
}
void TouchIdContext::PromptTouchId(std::string reason, Callback callback) {
callback_ = std::move(callback);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment