mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-22 00:12:09 +03:00
Fix FIDO reset over NFC
This commit is contained in:
parent
5cbe5c1200
commit
675eba042a
1
NEWS
1
NEWS
@ -9,6 +9,7 @@
|
||||
** PIV: Add output format for public key when generating keys.
|
||||
** Desktop: Window hidden/shown state no longer saved when closing the app,
|
||||
use --hidden to start the app in a hidden to systray state.
|
||||
** Desktop: Fix FIDO reset over NFC.
|
||||
** Windows: Add option to launch Windows Settings for FIDO management.
|
||||
** Android: Increase read timeout for NFC, improving compatibility with older YubiKeys.
|
||||
|
||||
|
@ -124,10 +124,11 @@ class Ctap2Node(RpcNode):
|
||||
removed = False
|
||||
while not event.wait(0.5):
|
||||
try:
|
||||
with dev.open_connection(FidoConnection):
|
||||
if removed:
|
||||
sleep(1.0) # Wait for the device to settle
|
||||
return dev.open_connection(FidoConnection)
|
||||
conn = dev.open_connection(FidoConnection)
|
||||
if removed:
|
||||
sleep(1.0) # Wait for the device to settle
|
||||
return conn
|
||||
conn.close()
|
||||
except CardConnectionException:
|
||||
pass # Expected, ignore
|
||||
except NoCardException:
|
||||
|
@ -68,12 +68,19 @@ class _ResetDialogState extends ConsumerState<ResetDialog> {
|
||||
StreamSubscription<InteractionEvent>? _subscription;
|
||||
InteractionEvent? _interaction;
|
||||
int _currentStep = -1;
|
||||
final _totalSteps = 3;
|
||||
late final int _totalSteps;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
final nfc = widget.data.node.transport == Transport.nfc;
|
||||
_totalSteps = nfc ? 2 : 3;
|
||||
}
|
||||
|
||||
String _getMessage() {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final nfc = widget.data.node.transport == Transport.nfc;
|
||||
if (_currentStep == 3) {
|
||||
if (_currentStep == _totalSteps) {
|
||||
return l10n.l_fido_app_reset;
|
||||
}
|
||||
return switch (_interaction) {
|
||||
@ -104,7 +111,7 @@ class _ResetDialogState extends ConsumerState<ResetDialog> {
|
||||
title: Text(l10n.s_factory_reset),
|
||||
key: factoryResetCancel,
|
||||
onCancel: switch (_application) {
|
||||
Capability.fido2 => _currentStep < 3
|
||||
Capability.fido2 => _currentStep < _totalSteps
|
||||
? () {
|
||||
_currentStep = -1;
|
||||
_subscription?.cancel();
|
||||
@ -113,7 +120,7 @@ class _ResetDialogState extends ConsumerState<ResetDialog> {
|
||||
_ => null,
|
||||
},
|
||||
actions: [
|
||||
if (_currentStep < 3)
|
||||
if (_currentStep < _totalSteps)
|
||||
TextButton(
|
||||
onPressed: switch (_application) {
|
||||
Capability.fido2 => _subscription == null
|
||||
|
@ -2,4 +2,4 @@
|
||||
// This file is generated by running ./set-version.py <version> <build>
|
||||
|
||||
const String version = '6.4.0';
|
||||
const int build = 60400;
|
||||
const int build = 60401;
|
||||
|
@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
|
||||
# This field is updated by running ./set-version.py <version>
|
||||
# DO NOT MANUALLY EDIT THIS!
|
||||
version: 6.4.0+60400
|
||||
version: 6.4.0+60401
|
||||
|
||||
environment:
|
||||
sdk: '>=3.0.0 <4.0.0'
|
||||
|
Loading…
Reference in New Issue
Block a user