Merge branch main into adamve/nfc_activity_widget

This commit is contained in:
Adam Velebil 2024-08-26 08:30:52 +02:00
commit b0599ecfdd
No known key found for this signature in database
GPG Key ID: C9B1E4A3CBBD2E10
34 changed files with 1458 additions and 609 deletions

View File

@ -1,2 +1,2 @@
FLUTTER=3.24.0
FLUTTER=3.24.1
PYVER=3.12.5

View File

@ -109,6 +109,7 @@ class OathManager(
private var pendingAction: OathAction? = null
private var refreshJob: Job? = null
private var addToAny = false
private val updateDeviceInfo = AtomicBoolean(false)
override fun onPause() {
// cancel any pending actions, except for addToAny
@ -288,6 +289,10 @@ class OathManager(
logger.debug(
"Successfully read Oath session info (and credentials if unlocked) from connected key"
)
if (updateDeviceInfo.getAndSet(false)) {
deviceManager.setDeviceInfo(getDeviceInfo(device))
}
} catch (e: Exception) {
// OATH not enabled/supported, try to get DeviceInfo over other USB interfaces
logger.error("Failed to connect to CCID: ", e)
@ -365,7 +370,7 @@ class OathManager(
}
private suspend fun reset(): String =
useOathSession(OathActionDescription.Reset) {
useOathSession(OathActionDescription.Reset, updateDeviceInfo = true) {
// note, it is ok to reset locked session
it.reset()
keyManager.removeKey(it.deviceId)
@ -399,7 +404,11 @@ class OathManager(
currentPassword: String?,
newPassword: String,
): String =
useOathSession(OathActionDescription.SetPassword, unlock = false) { session ->
useOathSession(
OathActionDescription.SetPassword,
unlock = false,
updateDeviceInfo = true
) { session ->
if (session.isAccessKeySet) {
if (currentPassword == null) {
throw Exception("Must provide current password to be able to change it")
@ -654,22 +663,30 @@ class OathManager(
private suspend fun <T> useOathSession(
oathActionDescription: OathActionDescription,
unlock: Boolean = true,
updateDeviceInfo: Boolean = false,
action: (YubiKitOathSession) -> T
): T {
// callers can decide whether the session should be unlocked first
unlockOnConnect.set(unlock)
// callers can request whether device info should be updated after session operation
this@OathManager.updateDeviceInfo.set(updateDeviceInfo)
return deviceManager.withKey(
onUsb = { useOathSessionUsb(it, action) },
onUsb = { useOathSessionUsb(it, updateDeviceInfo, action) },
onNfc = { useOathSessionNfc(oathActionDescription, action) }
)
}
private suspend fun <T> useOathSessionUsb(
device: UsbYubiKeyDevice,
updateDeviceInfo: Boolean = false,
block: (YubiKitOathSession) -> T
): T = device.withConnection<SmartCardConnection, T> {
block(getOathSession(it))
}.also {
if (updateDeviceInfo) {
deviceManager.setDeviceInfo(getDeviceInfo(device))
}
}
private suspend fun <T> useOathSessionNfc(

View File

@ -1,2 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<resources />
<resources>
<string name="p_ndef_set_otp">OTP-Code wurde erfolgreich von Ihrem YubiKey in die Zwischenablage kopiert.</string>
<string name="p_ndef_set_password">Passwort wurde erfolgreich von Ihrem YubiKey in die Zwischenablage kopiert.</string>
<string name="p_ndef_parse_failure">Beim Parsen des OTP-Codes von Ihrem YubiKey ist ein Fehler aufgetreten.</string>
<string name="p_ndef_set_clip_failure">Konnte während dem Versuch den OTP-Code von Ihrem YubiKey zu kopieren nicht auf die Zwischenablage zugreifen.</string>
</resources>

View File

@ -45,6 +45,7 @@ from ykman.pcsc import list_devices, YK_READER_NAME
from smartcard.Exceptions import SmartcardException, NoCardException
from smartcard.pcsc.PCSCExceptions import EstablishContextException
from smartcard.CardMonitoring import CardObserver, CardMonitor
from fido2.ctap import CtapError
from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePublicKey
from hashlib import sha256
from dataclasses import asdict
@ -349,6 +350,11 @@ class UsbDeviceNode(AbstractDeviceNode):
except (ValueError, OSError) as e:
logger.warning("Error opening connection", exc_info=True)
raise ConnectionException(self._device.fingerprint, "fido", e)
except Exception as e: # TODO: Replace with ConnectionError once added
if "Wrong" in str(e):
logger.warning("Error opening connection", exc_info=True)
raise ConnectionException(self._device.fingerprint, "fido", e)
raise
class _ReaderObserver(CardObserver):
@ -445,6 +451,14 @@ class ConnectionNode(RpcNode):
if e.sw == SW.INVALID_INSTRUCTION:
raise ChildResetException(f"SW: {e.sw}")
raise e
except CtapError as e:
if e.code == CtapError.ERR.CHANNEL_BUSY:
raise ChildResetException(str(e))
raise
except Exception as e: # TODO: Replace with ConnectionError once added
if "Wrong" in str(e):
raise ChildResetException(str(e))
raise
@property
def capabilities(self):
@ -521,16 +535,17 @@ class ScpConnectionNode(ConnectionNode):
self.fips_capable = info.fips_capable
self.scp_params = None
try:
scp = SecurityDomainSession(connection)
if self.fips_capable != 0:
scp = SecurityDomainSession(connection)
for ref in scp.get_key_information().keys():
if ref.kid == 0x13:
chain = scp.get_certificate_bundle(ref)
if chain:
pub_key = chain[-1].public_key()
assert isinstance(pub_key, EllipticCurvePublicKey) # nosec
self.scp_params = Scp11KeyParams(ref, pub_key)
break
for ref in scp.get_key_information().keys():
if ref.kid == 0x13:
chain = scp.get_certificate_bundle(ref)
if chain:
pub_key = chain[-1].public_key()
assert isinstance(pub_key, EllipticCurvePublicKey) # nosec
self.scp_params = Scp11KeyParams(ref, pub_key)
break
except NotSupportedError:
pass

View File

@ -401,8 +401,10 @@ class FingerprintNode(RpcNode):
self.bio.set_name(self.template_id, name)
self.name = name
self.refresh()
return dict()
@action
def delete(self, params, event, signal):
self.bio.remove_enrollment(self.template_id)
self.refresh()
return dict()

View File

@ -135,11 +135,18 @@ class PivNode(RpcNode):
pin_attempts = self.session.get_pin_attempts()
metadata = None
try:
self.session.get_bio_metadata()
supports_bio = True
except NotSupportedError:
supports_bio = False
return dict(
version=self.session.version,
authenticated=self._authenticated,
derived_key=self._pivman_data.has_derived_key,
stored_key=self._pivman_data.has_stored_key,
supports_bio=supports_bio,
chuid=self._get_object(OBJECT_ID.CHUID),
ccc=self._get_object(OBJECT_ID.CAPABILITY),
pin_attempts=pin_attempts,

View File

@ -20,7 +20,9 @@ mixin _$YubiKeyData {
String get name => throw _privateConstructorUsedError;
DeviceInfo get info => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of YubiKeyData
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$YubiKeyDataCopyWith<YubiKeyData> get copyWith =>
throw _privateConstructorUsedError;
}
@ -47,6 +49,8 @@ class _$YubiKeyDataCopyWithImpl<$Res, $Val extends YubiKeyData>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of YubiKeyData
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -70,6 +74,8 @@ class _$YubiKeyDataCopyWithImpl<$Res, $Val extends YubiKeyData>
) as $Val);
}
/// Create a copy of YubiKeyData
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$DeviceNodeCopyWith<$Res> get node {
@ -78,6 +84,8 @@ class _$YubiKeyDataCopyWithImpl<$Res, $Val extends YubiKeyData>
});
}
/// Create a copy of YubiKeyData
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$DeviceInfoCopyWith<$Res> get info {
@ -111,6 +119,8 @@ class __$$YubiKeyDataImplCopyWithImpl<$Res>
_$YubiKeyDataImpl _value, $Res Function(_$YubiKeyDataImpl) _then)
: super(_value, _then);
/// Create a copy of YubiKeyData
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -165,7 +175,9 @@ class _$YubiKeyDataImpl implements _YubiKeyData {
@override
int get hashCode => Object.hash(runtimeType, node, name, info);
@JsonKey(ignore: true)
/// Create a copy of YubiKeyData
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$YubiKeyDataImplCopyWith<_$YubiKeyDataImpl> get copyWith =>
@ -183,8 +195,11 @@ abstract class _YubiKeyData implements YubiKeyData {
String get name;
@override
DeviceInfo get info;
/// Create a copy of YubiKeyData
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$YubiKeyDataImplCopyWith<_$YubiKeyDataImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -238,7 +253,9 @@ mixin _$DeviceNode {
}) =>
throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of DeviceNode
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$DeviceNodeCopyWith<DeviceNode> get copyWith =>
throw _privateConstructorUsedError;
}
@ -262,6 +279,8 @@ class _$DeviceNodeCopyWithImpl<$Res, $Val extends DeviceNode>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of DeviceNode
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -302,6 +321,8 @@ class __$$UsbYubiKeyNodeImplCopyWithImpl<$Res>
_$UsbYubiKeyNodeImpl _value, $Res Function(_$UsbYubiKeyNodeImpl) _then)
: super(_value, _then);
/// Create a copy of DeviceNode
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -330,6 +351,8 @@ class __$$UsbYubiKeyNodeImplCopyWithImpl<$Res>
));
}
/// Create a copy of DeviceNode
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$DeviceInfoCopyWith<$Res>? get info {
@ -376,7 +399,9 @@ class _$UsbYubiKeyNodeImpl extends UsbYubiKeyNode {
@override
int get hashCode => Object.hash(runtimeType, path, name, pid, info);
@JsonKey(ignore: true)
/// Create a copy of DeviceNode
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$UsbYubiKeyNodeImplCopyWith<_$UsbYubiKeyNodeImpl> get copyWith =>
@ -463,8 +488,11 @@ abstract class UsbYubiKeyNode extends DeviceNode {
String get name;
UsbPid get pid;
DeviceInfo? get info;
/// Create a copy of DeviceNode
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$UsbYubiKeyNodeImplCopyWith<_$UsbYubiKeyNodeImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -488,6 +516,8 @@ class __$$NfcReaderNodeImplCopyWithImpl<$Res>
_$NfcReaderNodeImpl _value, $Res Function(_$NfcReaderNodeImpl) _then)
: super(_value, _then);
/// Create a copy of DeviceNode
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -534,7 +564,9 @@ class _$NfcReaderNodeImpl extends NfcReaderNode {
@override
int get hashCode => Object.hash(runtimeType, path, name);
@JsonKey(ignore: true)
/// Create a copy of DeviceNode
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$NfcReaderNodeImplCopyWith<_$NfcReaderNodeImpl> get copyWith =>
@ -618,8 +650,11 @@ abstract class NfcReaderNode extends DeviceNode {
DevicePath get path;
@override
String get name;
/// Create a copy of DeviceNode
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$NfcReaderNodeImplCopyWith<_$NfcReaderNodeImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -636,7 +671,9 @@ mixin _$ActionItem {
Key? get key => throw _privateConstructorUsedError;
Feature? get feature => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of ActionItem
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ActionItemCopyWith<ActionItem> get copyWith =>
throw _privateConstructorUsedError;
}
@ -669,6 +706,8 @@ class _$ActionItemCopyWithImpl<$Res, $Val extends ActionItem>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ActionItem
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -751,6 +790,8 @@ class __$$ActionItemImplCopyWithImpl<$Res>
_$ActionItemImpl _value, $Res Function(_$ActionItemImpl) _then)
: super(_value, _then);
/// Create a copy of ActionItem
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -867,7 +908,9 @@ class _$ActionItemImpl implements _ActionItem {
int get hashCode => Object.hash(runtimeType, icon, title, subtitle, shortcut,
trailing, intent, actionStyle, key, feature);
@JsonKey(ignore: true)
/// Create a copy of ActionItem
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ActionItemImplCopyWith<_$ActionItemImpl> get copyWith =>
@ -904,8 +947,11 @@ abstract class _ActionItem implements ActionItem {
Key? get key;
@override
Feature? get feature;
/// Create a copy of ActionItem
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ActionItemImplCopyWith<_$ActionItemImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -917,7 +963,9 @@ mixin _$WindowState {
bool get active => throw _privateConstructorUsedError;
bool get hidden => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of WindowState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$WindowStateCopyWith<WindowState> get copyWith =>
throw _privateConstructorUsedError;
}
@ -941,6 +989,8 @@ class _$WindowStateCopyWithImpl<$Res, $Val extends WindowState>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of WindowState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -989,6 +1039,8 @@ class __$$WindowStateImplCopyWithImpl<$Res>
_$WindowStateImpl _value, $Res Function(_$WindowStateImpl) _then)
: super(_value, _then);
/// Create a copy of WindowState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1057,7 +1109,9 @@ class _$WindowStateImpl implements _WindowState {
int get hashCode =>
Object.hash(runtimeType, focused, visible, active, hidden);
@JsonKey(ignore: true)
/// Create a copy of WindowState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$WindowStateImplCopyWith<_$WindowStateImpl> get copyWith =>
@ -1079,8 +1133,11 @@ abstract class _WindowState implements WindowState {
bool get active;
@override
bool get hidden;
/// Create a copy of WindowState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$WindowStateImplCopyWith<_$WindowStateImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1098,8 +1155,12 @@ mixin _$KeyCustomization {
@_ColorConverter()
Color? get color => throw _privateConstructorUsedError;
/// Serializes this KeyCustomization to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of KeyCustomization
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$KeyCustomizationCopyWith<KeyCustomization> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1126,6 +1187,8 @@ class _$KeyCustomizationCopyWithImpl<$Res, $Val extends KeyCustomization>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of KeyCustomization
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1172,6 +1235,8 @@ class __$$KeyCustomizationImplCopyWithImpl<$Res>
$Res Function(_$KeyCustomizationImpl) _then)
: super(_value, _then);
/// Create a copy of KeyCustomization
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1232,11 +1297,13 @@ class _$KeyCustomizationImpl implements _KeyCustomization {
(identical(other.color, color) || other.color == color));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, serial, name, color);
@JsonKey(ignore: true)
/// Create a copy of KeyCustomization
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$KeyCustomizationImplCopyWith<_$KeyCustomizationImpl> get copyWith =>
@ -1271,8 +1338,11 @@ abstract class _KeyCustomization implements KeyCustomization {
@JsonKey(includeIfNull: false)
@_ColorConverter()
Color? get color;
/// Create a copy of KeyCustomization
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$KeyCustomizationImplCopyWith<_$KeyCustomizationImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@ -581,6 +581,7 @@ class _AppPageState extends ConsumerState<AppPage> {
Expanded(child: body),
if (hasManage &&
!hasDetailsOrKeyActions &&
showDetailView &&
widget.capabilities != null &&
widget.capabilities?.first != Capability.u2f)
// Add a placeholder for the Manage/Details column. Exceptions are:
@ -684,8 +685,7 @@ class _AppPageState extends ConsumerState<AppPage> {
),
actions: [
if (widget.actionButtonBuilder == null &&
(widget.keyActionsBuilder != null &&
(!hasManage || !showDetailView)))
(widget.keyActionsBuilder != null && !hasManage))
Padding(
padding: const EdgeInsets.only(left: 4),
child: IconButton(

View File

@ -20,7 +20,9 @@ mixin _$Version {
int get minor => throw _privateConstructorUsedError;
int get patch => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of Version
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$VersionCopyWith<Version> get copyWith => throw _privateConstructorUsedError;
}
@ -42,6 +44,8 @@ class _$VersionCopyWithImpl<$Res, $Val extends Version>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Version
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -84,6 +88,8 @@ class __$$VersionImplCopyWithImpl<$Res>
_$VersionImpl _value, $Res Function(_$VersionImpl) _then)
: super(_value, _then);
/// Create a copy of Version
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -140,7 +146,9 @@ class _$VersionImpl extends _Version {
@override
int get hashCode => Object.hash(runtimeType, major, minor, patch);
@JsonKey(ignore: true)
/// Create a copy of Version
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$VersionImplCopyWith<_$VersionImpl> get copyWith =>
@ -158,8 +166,11 @@ abstract class _Version extends Version {
int get minor;
@override
int get patch;
/// Create a copy of Version
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$VersionImplCopyWith<_$VersionImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@ -81,8 +81,13 @@ mixin _$RpcResponse {
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
/// Serializes this RpcResponse to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of RpcResponse
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$RpcResponseCopyWith<RpcResponse> get copyWith =>
throw _privateConstructorUsedError;
}
@ -106,6 +111,8 @@ class _$RpcResponseCopyWithImpl<$Res, $Val extends RpcResponse>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of RpcResponse
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -139,6 +146,8 @@ class __$$SuccessImplCopyWithImpl<$Res>
_$SuccessImpl _value, $Res Function(_$SuccessImpl) _then)
: super(_value, _then);
/// Create a copy of RpcResponse
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -203,14 +212,16 @@ class _$SuccessImpl implements Success {
const DeepCollectionEquality().equals(other._flags, _flags));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_body),
const DeepCollectionEquality().hash(_flags));
@JsonKey(ignore: true)
/// Create a copy of RpcResponse
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$SuccessImplCopyWith<_$SuccessImpl> get copyWith =>
@ -306,8 +317,11 @@ abstract class Success implements RpcResponse {
@override
Map<String, dynamic> get body;
List<String> get flags;
/// Create a copy of RpcResponse
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$SuccessImplCopyWith<_$SuccessImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -331,6 +345,8 @@ class __$$SignalImplCopyWithImpl<$Res>
_$SignalImpl _value, $Res Function(_$SignalImpl) _then)
: super(_value, _then);
/// Create a copy of RpcResponse
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -388,12 +404,14 @@ class _$SignalImpl implements Signal {
const DeepCollectionEquality().equals(other._body, _body));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, status, const DeepCollectionEquality().hash(_body));
@JsonKey(ignore: true)
/// Create a copy of RpcResponse
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$SignalImplCopyWith<_$SignalImpl> get copyWith =>
@ -489,8 +507,11 @@ abstract class Signal implements RpcResponse {
String get status;
@override
Map<String, dynamic> get body;
/// Create a copy of RpcResponse
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$SignalImplCopyWith<_$SignalImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -514,6 +535,8 @@ class __$$RpcErrorImplCopyWithImpl<$Res>
_$RpcErrorImpl _value, $Res Function(_$RpcErrorImpl) _then)
: super(_value, _then);
/// Create a copy of RpcResponse
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -579,12 +602,14 @@ class _$RpcErrorImpl implements RpcError {
const DeepCollectionEquality().equals(other._body, _body));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, status, message, const DeepCollectionEquality().hash(_body));
@JsonKey(ignore: true)
/// Create a copy of RpcResponse
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$RpcErrorImplCopyWith<_$RpcErrorImpl> get copyWith =>
@ -682,8 +707,11 @@ abstract class RpcError implements RpcResponse {
String get message;
@override
Map<String, dynamic> get body;
/// Create a copy of RpcResponse
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$RpcErrorImplCopyWith<_$RpcErrorImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -697,8 +725,12 @@ mixin _$RpcState {
String get version => throw _privateConstructorUsedError;
bool get isAdmin => throw _privateConstructorUsedError;
/// Serializes this RpcState to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of RpcState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$RpcStateCopyWith<RpcState> get copyWith =>
throw _privateConstructorUsedError;
}
@ -721,6 +753,8 @@ class _$RpcStateCopyWithImpl<$Res, $Val extends RpcState>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of RpcState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -759,6 +793,8 @@ class __$$RpcStateImplCopyWithImpl<$Res>
_$RpcStateImpl _value, $Res Function(_$RpcStateImpl) _then)
: super(_value, _then);
/// Create a copy of RpcState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -805,11 +841,13 @@ class _$RpcStateImpl implements _RpcState {
(identical(other.isAdmin, isAdmin) || other.isAdmin == isAdmin));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, version, isAdmin);
@JsonKey(ignore: true)
/// Create a copy of RpcState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$RpcStateImplCopyWith<_$RpcStateImpl> get copyWith =>
@ -834,8 +872,11 @@ abstract class _RpcState implements RpcState {
String get version;
@override
bool get isAdmin;
/// Create a copy of RpcState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$RpcStateImplCopyWith<_$RpcStateImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@ -24,8 +24,12 @@ mixin _$FidoState {
bool get unlocked => throw _privateConstructorUsedError;
int? get pinRetries => throw _privateConstructorUsedError;
/// Serializes this FidoState to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of FidoState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$FidoStateCopyWith<FidoState> get copyWith =>
throw _privateConstructorUsedError;
}
@ -48,6 +52,8 @@ class _$FidoStateCopyWithImpl<$Res, $Val extends FidoState>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of FidoState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -91,6 +97,8 @@ class __$$FidoStateImplCopyWithImpl<$Res>
_$FidoStateImpl _value, $Res Function(_$FidoStateImpl) _then)
: super(_value, _then);
/// Create a copy of FidoState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -158,12 +166,14 @@ class _$FidoStateImpl extends _FidoState {
other.pinRetries == pinRetries));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,
const DeepCollectionEquality().hash(_info), unlocked, pinRetries);
@JsonKey(ignore: true)
/// Create a copy of FidoState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$FidoStateImplCopyWith<_$FidoStateImpl> get copyWith =>
@ -193,8 +203,11 @@ abstract class _FidoState extends FidoState {
bool get unlocked;
@override
int? get pinRetries;
/// Create a copy of FidoState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$FidoStateImplCopyWith<_$FidoStateImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -256,6 +269,9 @@ class _$PinResultCopyWithImpl<$Res, $Val extends PinResult>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PinResult
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@ -272,6 +288,9 @@ class __$$PinSuccessImplCopyWithImpl<$Res>
__$$PinSuccessImplCopyWithImpl(
_$PinSuccessImpl _value, $Res Function(_$PinSuccessImpl) _then)
: super(_value, _then);
/// Create a copy of PinResult
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@ -379,6 +398,8 @@ class __$$PinFailureImplCopyWithImpl<$Res>
_$PinFailureImpl _value, $Res Function(_$PinFailureImpl) _then)
: super(_value, _then);
/// Create a copy of PinResult
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -392,6 +413,8 @@ class __$$PinFailureImplCopyWithImpl<$Res>
));
}
/// Create a copy of PinResult
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$FidoPinFailureReasonCopyWith<$Res> get reason {
@ -425,7 +448,9 @@ class _$PinFailureImpl implements _PinFailure {
@override
int get hashCode => Object.hash(runtimeType, reason);
@JsonKey(ignore: true)
/// Create a copy of PinResult
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PinFailureImplCopyWith<_$PinFailureImpl> get copyWith =>
@ -498,7 +523,10 @@ abstract class _PinFailure implements PinResult {
factory _PinFailure(final FidoPinFailureReason reason) = _$PinFailureImpl;
FidoPinFailureReason get reason;
@JsonKey(ignore: true)
/// Create a copy of PinResult
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PinFailureImplCopyWith<_$PinFailureImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -562,6 +590,9 @@ class _$FidoPinFailureReasonCopyWithImpl<$Res,
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of FidoPinFailureReason
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@ -581,6 +612,8 @@ class __$$FidoInvalidPinImplCopyWithImpl<$Res>
_$FidoInvalidPinImpl _value, $Res Function(_$FidoInvalidPinImpl) _then)
: super(_value, _then);
/// Create a copy of FidoPinFailureReason
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -628,7 +661,9 @@ class _$FidoInvalidPinImpl implements FidoInvalidPin {
@override
int get hashCode => Object.hash(runtimeType, retries, authBlocked);
@JsonKey(ignore: true)
/// Create a copy of FidoPinFailureReason
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$FidoInvalidPinImplCopyWith<_$FidoInvalidPinImpl> get copyWith =>
@ -704,7 +739,10 @@ abstract class FidoInvalidPin implements FidoPinFailureReason {
int get retries;
bool get authBlocked;
@JsonKey(ignore: true)
/// Create a copy of FidoPinFailureReason
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$FidoInvalidPinImplCopyWith<_$FidoInvalidPinImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -723,6 +761,9 @@ class __$$FidoWeakPinImplCopyWithImpl<$Res>
__$$FidoWeakPinImplCopyWithImpl(
_$FidoWeakPinImpl _value, $Res Function(_$FidoWeakPinImpl) _then)
: super(_value, _then);
/// Create a copy of FidoPinFailureReason
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@ -820,8 +861,12 @@ mixin _$Fingerprint {
String get templateId => throw _privateConstructorUsedError;
String? get name => throw _privateConstructorUsedError;
/// Serializes this Fingerprint to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of Fingerprint
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$FingerprintCopyWith<Fingerprint> get copyWith =>
throw _privateConstructorUsedError;
}
@ -845,6 +890,8 @@ class _$FingerprintCopyWithImpl<$Res, $Val extends Fingerprint>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Fingerprint
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -883,6 +930,8 @@ class __$$FingerprintImplCopyWithImpl<$Res>
_$FingerprintImpl _value, $Res Function(_$FingerprintImpl) _then)
: super(_value, _then);
/// Create a copy of Fingerprint
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -930,11 +979,13 @@ class _$FingerprintImpl extends _Fingerprint {
(identical(other.name, name) || other.name == name));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, templateId, name);
@JsonKey(ignore: true)
/// Create a copy of Fingerprint
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$FingerprintImplCopyWith<_$FingerprintImpl> get copyWith =>
@ -960,8 +1011,11 @@ abstract class _Fingerprint extends Fingerprint {
String get templateId;
@override
String? get name;
/// Create a copy of Fingerprint
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$FingerprintImplCopyWith<_$FingerprintImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1030,6 +1084,9 @@ class _$FingerprintEventCopyWithImpl<$Res, $Val extends FingerprintEvent>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of FingerprintEvent
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@ -1049,6 +1106,8 @@ class __$$EventCaptureImplCopyWithImpl<$Res>
_$EventCaptureImpl _value, $Res Function(_$EventCaptureImpl) _then)
: super(_value, _then);
/// Create a copy of FingerprintEvent
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1088,7 +1147,9 @@ class _$EventCaptureImpl implements _EventCapture {
@override
int get hashCode => Object.hash(runtimeType, remaining);
@JsonKey(ignore: true)
/// Create a copy of FingerprintEvent
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$EventCaptureImplCopyWith<_$EventCaptureImpl> get copyWith =>
@ -1167,7 +1228,10 @@ abstract class _EventCapture implements FingerprintEvent {
factory _EventCapture(final int remaining) = _$EventCaptureImpl;
int get remaining;
@JsonKey(ignore: true)
/// Create a copy of FingerprintEvent
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$EventCaptureImplCopyWith<_$EventCaptureImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1191,6 +1255,8 @@ class __$$EventCompleteImplCopyWithImpl<$Res>
_$EventCompleteImpl _value, $Res Function(_$EventCompleteImpl) _then)
: super(_value, _then);
/// Create a copy of FingerprintEvent
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1204,6 +1270,8 @@ class __$$EventCompleteImplCopyWithImpl<$Res>
));
}
/// Create a copy of FingerprintEvent
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$FingerprintCopyWith<$Res> get fingerprint {
@ -1238,7 +1306,9 @@ class _$EventCompleteImpl implements _EventComplete {
@override
int get hashCode => Object.hash(runtimeType, fingerprint);
@JsonKey(ignore: true)
/// Create a copy of FingerprintEvent
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$EventCompleteImplCopyWith<_$EventCompleteImpl> get copyWith =>
@ -1317,7 +1387,10 @@ abstract class _EventComplete implements FingerprintEvent {
factory _EventComplete(final Fingerprint fingerprint) = _$EventCompleteImpl;
Fingerprint get fingerprint;
@JsonKey(ignore: true)
/// Create a copy of FingerprintEvent
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$EventCompleteImplCopyWith<_$EventCompleteImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1339,6 +1412,8 @@ class __$$EventErrorImplCopyWithImpl<$Res>
_$EventErrorImpl _value, $Res Function(_$EventErrorImpl) _then)
: super(_value, _then);
/// Create a copy of FingerprintEvent
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1377,7 +1452,9 @@ class _$EventErrorImpl implements _EventError {
@override
int get hashCode => Object.hash(runtimeType, code);
@JsonKey(ignore: true)
/// Create a copy of FingerprintEvent
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$EventErrorImplCopyWith<_$EventErrorImpl> get copyWith =>
@ -1456,7 +1533,10 @@ abstract class _EventError implements FingerprintEvent {
factory _EventError(final int code) = _$EventErrorImpl;
int get code;
@JsonKey(ignore: true)
/// Create a copy of FingerprintEvent
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$EventErrorImplCopyWith<_$EventErrorImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1473,8 +1553,12 @@ mixin _$FidoCredential {
String get userName => throw _privateConstructorUsedError;
String? get displayName => throw _privateConstructorUsedError;
/// Serializes this FidoCredential to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of FidoCredential
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$FidoCredentialCopyWith<FidoCredential> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1503,6 +1587,8 @@ class _$FidoCredentialCopyWithImpl<$Res, $Val extends FidoCredential>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of FidoCredential
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1561,6 +1647,8 @@ class __$$FidoCredentialImplCopyWithImpl<$Res>
_$FidoCredentialImpl _value, $Res Function(_$FidoCredentialImpl) _then)
: super(_value, _then);
/// Create a copy of FidoCredential
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1639,12 +1727,14 @@ class _$FidoCredentialImpl implements _FidoCredential {
other.displayName == displayName));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, rpId, credentialId, userId, userName, displayName);
@JsonKey(ignore: true)
/// Create a copy of FidoCredential
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$FidoCredentialImplCopyWith<_$FidoCredentialImpl> get copyWith =>
@ -1680,8 +1770,11 @@ abstract class _FidoCredential implements FidoCredential {
String get userName;
@override
String? get displayName;
/// Create a copy of FidoCredential
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$FidoCredentialImplCopyWith<_$FidoCredentialImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@ -36,7 +36,14 @@ class EnableEnterpriseAttestationDialog extends ConsumerWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(l10n.p_enable_ep_attestation_desc),
Text(
l10n.p_enable_ep_attestation_desc,
style: Theme.of(context)
.textTheme
.bodyMedium
?.copyWith(fontWeight: FontWeight.w700),
),
Text(l10n.p_enable_ep_attestation_disable_with_factory_reset),
]
.map((e) => Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),

View File

@ -30,6 +30,7 @@ import '../../app/views/app_list_item.dart';
import '../../app/views/app_page.dart';
import '../../app/views/message_page.dart';
import '../../app/views/message_page_not_initialized.dart';
import '../../core/models.dart';
import '../../core/state.dart';
import '../../exception/no_data_exception.dart';
import '../../management/models.dart';
@ -44,6 +45,14 @@ import 'key_actions.dart';
import 'pin_dialog.dart';
import 'pin_entry_form.dart';
List<Capability> _getCapabilities(YubiKeyData deviceData) => [
Capability.fido2,
if (deviceData.info.config.enabledCapabilities[Transport.usb]! &
Capability.piv.value !=
0)
Capability.piv
];
class FingerprintsScreen extends ConsumerWidget {
final YubiKeyData deviceData;
@ -52,10 +61,11 @@ class FingerprintsScreen extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final l10n = AppLocalizations.of(context)!;
final capabilities = _getCapabilities(deviceData);
return ref.watch(fidoStateProvider(deviceData.node.path)).when(
loading: () => AppPage(
title: l10n.s_fingerprints,
capabilities: const [Capability.fido2],
capabilities: capabilities,
centered: true,
delayedContent: true,
builder: (context, _) => const CircularProgressIndicator(),
@ -64,7 +74,7 @@ class FingerprintsScreen extends ConsumerWidget {
if (error is NoDataException) {
return MessagePageNotInitialized(
title: l10n.s_fingerprints,
capabilities: const [Capability.fido2],
capabilities: capabilities,
);
}
final enabled = deviceData
@ -73,7 +83,7 @@ class FingerprintsScreen extends ConsumerWidget {
if (Capability.fido2.value & enabled == 0) {
return MessagePage(
title: l10n.s_fingerprints,
capabilities: const [Capability.fido2],
capabilities: capabilities,
header: l10n.s_fido_disabled,
message: l10n.l_webauthn_req_fido2,
);
@ -85,17 +95,17 @@ class FingerprintsScreen extends ConsumerWidget {
},
data: (fidoState) {
return fidoState.unlocked
? _FidoUnlockedPage(deviceData.node, fidoState)
: _FidoLockedPage(deviceData.node, fidoState);
? _FidoUnlockedPage(deviceData, fidoState)
: _FidoLockedPage(deviceData, fidoState);
});
}
}
class _FidoLockedPage extends ConsumerWidget {
final DeviceNode node;
final YubiKeyData deviceData;
final FidoState state;
const _FidoLockedPage(this.node, this.state);
const _FidoLockedPage(this.deviceData, this.state);
@override
Widget build(BuildContext context, WidgetRef ref) {
@ -103,6 +113,14 @@ class _FidoLockedPage extends ConsumerWidget {
final hasFeature = ref.watch(featureProvider);
final hasActions = hasFeature(features.actions);
final capabilities = [
Capability.fido2,
if (deviceData.info.config.enabledCapabilities[Transport.usb]! &
Capability.piv.value !=
0)
Capability.piv
];
if (!state.hasPin) {
return MessagePage(
actionsBuilder: (context, expanded) => [
@ -112,13 +130,14 @@ class _FidoLockedPage extends ConsumerWidget {
onPressed: () async {
await showBlurDialog(
context: context,
builder: (context) => FidoPinDialog(node.path, state));
builder: (context) =>
FidoPinDialog(deviceData.node.path, state));
},
avatar: const Icon(Symbols.pin),
)
],
title: l10n.s_fingerprints,
capabilities: const [Capability.fido2],
capabilities: capabilities,
header: l10n.s_fingerprints_get_started,
message: l10n.p_set_fingerprints_desc,
keyActionsBuilder: hasActions ? _buildActions : null,
@ -129,7 +148,7 @@ class _FidoLockedPage extends ConsumerWidget {
if (state.forcePinChange) {
return MessagePage(
title: l10n.s_fingerprints,
capabilities: const [Capability.fido2],
capabilities: capabilities,
header: l10n.s_pin_change_required,
message: l10n.l_pin_change_required_desc,
keyActionsBuilder: hasActions ? _buildActions : null,
@ -141,7 +160,8 @@ class _FidoLockedPage extends ConsumerWidget {
onPressed: () async {
await showBlurDialog(
context: context,
builder: (context) => FidoPinDialog(node.path, state));
builder: (context) =>
FidoPinDialog(deviceData.node.path, state));
},
avatar: const Icon(Symbols.pin),
)
@ -151,25 +171,26 @@ class _FidoLockedPage extends ConsumerWidget {
return AppPage(
title: l10n.s_fingerprints,
capabilities: const [Capability.fido2],
capabilities: capabilities,
keyActionsBuilder: hasActions ? _buildActions : null,
builder: (context, _) => Column(
children: [
PinEntryForm(state, node),
PinEntryForm(state, deviceData.node),
],
),
);
}
Widget _buildActions(BuildContext context) =>
fingerprintsBuildActions(context, node, state, -1);
fingerprintsBuildActions(context, deviceData.node, state, -1);
}
class _FidoUnlockedPage extends ConsumerStatefulWidget {
final DeviceNode node;
final YubiKeyData deviceData;
final FidoState state;
_FidoUnlockedPage(this.node, this.state) : super(key: ObjectKey(node.path));
_FidoUnlockedPage(this.deviceData, this.state)
: super(key: ObjectKey(deviceData.node.path));
@override
ConsumerState<ConsumerStatefulWidget> createState() =>
@ -184,10 +205,12 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
final l10n = AppLocalizations.of(context)!;
final hasFeature = ref.watch(featureProvider);
final hasActions = hasFeature(features.actions);
final capabilities = _getCapabilities(widget.deviceData);
final data = ref.watch(fingerprintProvider(widget.node.path)).asData;
final data =
ref.watch(fingerprintProvider(widget.deviceData.node.path)).asData;
if (data == null) {
return _buildLoadingPage(context);
return _buildLoadingPage(context, capabilities);
}
final fingerprints = data.value;
if (fingerprints.isEmpty) {
@ -200,18 +223,18 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
await showBlurDialog(
context: context,
builder: (context) =>
AddFingerprintDialog(widget.node.path));
AddFingerprintDialog(widget.deviceData.node.path));
},
avatar: const Icon(Symbols.fingerprint),
)
],
title: l10n.s_fingerprints,
capabilities: const [Capability.fido2],
capabilities: capabilities,
header: l10n.s_fingerprints_get_started,
message: l10n.l_add_one_or_more_fps,
keyActionsBuilder: hasActions
? (context) =>
fingerprintsBuildActions(context, widget.node, widget.state, 0)
? (context) => fingerprintsBuildActions(
context, widget.deviceData.node, widget.state, 0)
: null,
keyActionsBadge: fingerprintsShowActionsNotifier(widget.state),
);
@ -219,7 +242,7 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
final fingerprint = _selected;
return FidoActions(
devicePath: widget.node.path,
devicePath: widget.deviceData.node.path,
actions: (context) => {
EscapeIntent: CallbackAction<EscapeIntent>(onInvoke: (intent) {
if (_selected != null) {
@ -266,7 +289,7 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
},
builder: (context) => AppPage(
title: l10n.s_fingerprints,
capabilities: const [Capability.fido2],
capabilities: capabilities,
detailViewBuilder: fingerprint != null
? (context) => Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
@ -306,8 +329,8 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
)
: null,
keyActionsBuilder: hasActions
? (context) => fingerprintsBuildActions(
context, widget.node, widget.state, fingerprints.length)
? (context) => fingerprintsBuildActions(context,
widget.deviceData.node, widget.state, fingerprints.length)
: null,
keyActionsBadge: fingerprintsShowActionsNotifier(widget.state),
builder: (context, expanded) {
@ -349,9 +372,11 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
);
}
Widget _buildLoadingPage(BuildContext context) => AppPage(
Widget _buildLoadingPage(
BuildContext context, List<Capability> capabilities) =>
AppPage(
title: AppLocalizations.of(context)!.s_fingerprints,
capabilities: const [Capability.fido2],
capabilities: capabilities,
centered: true,
delayedContent: true,
builder: (context, _) => const CircularProgressIndicator(),

View File

@ -52,11 +52,11 @@ Widget _fidoBuildActions(BuildContext context, DeviceNode node, FidoState state,
final authBlocked = state.pinBlocked;
final enterpriseAttestation = state.enterpriseAttestation;
final showEnterpriseAttestation = enterpriseAttestation != null &&
final showEnterpriseAttestation =
enterpriseAttestation != null && fingerprints == null;
final canEnableEnterpriseAttestation = enterpriseAttestation == false &&
!(state.alwaysUv && !state.hasPin) &&
!(!state.unlocked && state.hasPin);
final canEnableEnterpriseAttestation =
enterpriseAttestation == false && showEnterpriseAttestation;
return Column(
children: [
@ -129,8 +129,11 @@ Widget _fidoBuildActions(BuildContext context, DeviceNode node, FidoState state,
feature: features.enableEnterpriseAttestation,
icon: const Icon(Symbols.local_police),
title: l10n.s_ep_attestation,
subtitle:
enterpriseAttestation ? l10n.s_enabled : l10n.s_disabled,
subtitle: enterpriseAttestation
? l10n.s_enabled
: (state.alwaysUv && !state.hasPin)
? l10n.l_set_pin_first
: l10n.s_disabled,
onTap: canEnableEnterpriseAttestation
? (context) {
Navigator.of(context).popUntil((route) => route.isFirst);

View File

@ -379,7 +379,6 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
child: LayoutBuilder(builder: (context, constraints) {
final textTheme = Theme.of(context).textTheme;
final width = constraints.maxWidth;
final showLayoutOptions = width > 600;
return Consumer(
builder: (context, ref, child) {
final layout = ref.watch(passkeysLayoutProvider);
@ -426,9 +425,40 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
setState(() {});
},
),
if (searchController.text.isEmpty && showLayoutOptions)
...FlexLayout.values.map(
(e) => MouseRegion(
if (searchController.text.isEmpty) ...[
if (width >= 450)
...FlexLayout.values.map(
(e) => MouseRegion(
onEnter: (event) {
if (!searchFocus.hasFocus) {
setState(() {
_canRequestFocus = false;
});
}
},
onExit: (event) {
setState(() {
_canRequestFocus = true;
});
},
child: IconButton(
tooltip: e.getDisplayName(l10n),
onPressed: () {
ref
.read(passkeysLayoutProvider.notifier)
.setLayout(e);
},
icon: Icon(
e.icon,
color: e == layout
? Theme.of(context).colorScheme.primary
: null,
),
),
),
),
if (width < 450)
MouseRegion(
onEnter: (event) {
if (!searchFocus.hasFocus) {
setState(() {
@ -441,22 +471,47 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
_canRequestFocus = true;
});
},
child: IconButton(
tooltip: e.getDisplayName(l10n),
onPressed: () {
ref
.read(passkeysLayoutProvider.notifier)
.setLayout(e);
},
child: PopupMenuButton(
constraints: const BoxConstraints.tightFor(),
tooltip: l10n.s_select_layout,
popUpAnimationStyle:
AnimationStyle(duration: Duration.zero),
icon: Icon(
e.icon,
color: e == layout
? Theme.of(context).colorScheme.primary
: null,
layout.icon,
color: Theme.of(context).colorScheme.primary,
),
itemBuilder: (context) => [
...FlexLayout.values.map(
(e) => PopupMenuItem(
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Tooltip(
message: e.getDisplayName(l10n),
child: Icon(
e.icon,
color: e == layout
? Theme.of(context)
.colorScheme
.primary
: null,
),
),
],
),
onTap: () {
ref
.read(
passkeysLayoutProvider.notifier)
.setLayout(e);
},
),
)
],
),
),
),
)
]
],
),
onChanged: (value) {

View File

@ -58,7 +58,7 @@ Widget homeBuildActions(
? l10n.s_toggle_applications
: l10n.s_toggle_interfaces,
subtitle: interfacesLocked
? 'Requires factory reset' // TODO: Replace with l10n
? l10n.l_factory_reset_required
: (deviceData.info.version.major > 4
? l10n.l_toggle_applications_desc
: l10n.l_toggle_interfaces_desc),

File diff suppressed because it is too large Load Diff

View File

@ -291,8 +291,8 @@
"l_enter_fido2_pin": "Enter the FIDO2 PIN for your YubiKey",
"l_pin_blocked_reset": "PIN is blocked; factory reset the FIDO application",
"l_pin_blocked": "PIN is blocked",
"l_set_pin_first": "A PIN is required first",
"l_unlock_pin_first": "Unlock with PIN first",
"l_set_pin_first": "A PIN is required",
"l_unlock_pin_first": "Unlock with PIN",
"l_pin_soft_locked": "PIN has been blocked until the YubiKey is removed and reinserted",
"l_pin_change_required_desc": "A new PIN must be set before you can use this application",
"p_enter_current_pin_or_reset": "Enter your current PIN. If you don't know your PIN, you'll need to unblock it with the PUK or reset the YubiKey.",
@ -318,6 +318,7 @@
"s_ep_attestation_enabled": "Enterprise Attestation enabled",
"s_enable_ep_attestation": "Enable Enterprise Attestation",
"p_enable_ep_attestation_desc": "This will enable Enterprise Attestation, allowing authorized domains to uniquely identify your YubiKey.",
"p_enable_ep_attestation_disable_with_factory_reset": "Once enabled, Enterprise Attestation can only be disabled by performing a FIDO factory reset.",
"s_pin_required": "PIN required",
"p_pin_required_desc": "The action you are about to perform requires the PIV PIN to be entered.",
"l_piv_pin_blocked": "Blocked, use PUK to reset",
@ -370,8 +371,8 @@
"s_password_forgotten": "Password forgotten",
"l_keystore_unavailable": "OS Keystore unavailable",
"l_remember_pw_failed": "Failed to remember password",
"l_unlock_first": "Unlock with password first",
"l_set_password_first": "Set a password first",
"l_unlock_first": "Unlock with password",
"l_set_password_first": "Set a password",
"l_enter_oath_pw": "Enter the OATH password for your YubiKey",
"p_enter_current_password_or_reset": "Enter your current password. If you don't know your password, you'll need to reset the YubiKey.",
"p_enter_new_password": "Enter your new password. A password may contain letters, numbers and special characters.",
@ -440,7 +441,7 @@
"l_delete_account_desc": "Remove the account from your YubiKey",
"s_account_deleted": "Account deleted",
"p_warning_delete_account": "Warning! This action will delete the account from your YubiKey.",
"p_warning_disable_credential": "You will no longer be able to generate OTPs for this account. Make sure to first disable this credential from the website to avoid being locked out of your account.",
"p_warning_disable_credential": "You will no longer be able to generate OTPs for this account. Make sure to disable this credential from the website to avoid being locked out of your account.",
"s_account_name": "Account name",
"s_search_accounts": "Search accounts",
"l_accounts_used": "{used} of {capacity} accounts used",
@ -656,7 +657,9 @@
"p_subject_desc": "A distinguished name (DN) formatted in accordance to the RFC 4514 specification.",
"l_rfc4514_invalid": "Invalid RFC 4514 format",
"rfc4514_examples": "Examples:\nCN=Example Name\nCN=jsmith,DC=example,DC=net",
"s_allow_fingerprint": "Allow fingerprint",
"p_cert_options_desc": "Key algorithm to use, output format, and expiration date (certificate only).",
"p_cert_options_bio_desc": "Key algorithm to use, output format, expiration date (certificate only), and if biometrics can be used instead of PIN.",
"s_overwrite_slot": "Overwrite slot",
"p_overwrite_slot_desc": "This will permanently overwrite existing content in slot {slot}.",
"@p_overwrite_slot_desc": {
@ -799,6 +802,7 @@
"s_reset": "Reset",
"s_factory_reset": "Factory reset",
"l_factory_reset_desc": "Restore YubiKey defaults",
"l_factory_reset_required": "Factory reset required",
"l_oath_application_reset": "OATH application reset",
"l_fido_app_reset": "FIDO application reset",
"l_reset_failed": "Error performing reset: {message}",
@ -811,9 +815,9 @@
"p_factory_reset_an_app": "Factory reset an application on your YubiKey.",
"p_factory_reset_desc": "Data is stored in multiple applications on the YubiKey, some of which can be factory reset independently of each other.\n\nSelect an application above to reset.",
"p_warning_factory_reset": "Warning! This will irrevocably delete all OATH TOTP/HOTP accounts from your YubiKey.",
"p_warning_disable_credentials": "Your OATH credentials, as well as any password set, will be removed from this YubiKey. Make sure to first disable these from their respective web sites to avoid being locked out of your accounts.",
"p_warning_disable_credentials": "Your OATH credentials, as well as any password set, will be removed from this YubiKey. Make sure to disable these from their respective web sites to avoid being locked out of your accounts.",
"p_warning_deletes_accounts": "Warning! This will irrevocably delete all U2F and FIDO2 accounts, including passkeys, from your YubiKey.",
"p_warning_disable_accounts": "Your credentials, as well as any PIN set, will be removed from this YubiKey. Make sure to first disable these from their respective web sites to avoid being locked out of your accounts.",
"p_warning_disable_accounts": "Your credentials, as well as any PIN set, will be removed from this YubiKey. Make sure to disable these from their respective web sites to avoid being locked out of your accounts.",
"p_warning_piv_reset": "Warning! All data stored for PIV will be irrevocably deleted from your YubiKey.",
"p_warning_piv_reset_desc": "This includes private keys and certificates. Your PIN, PUK, and management key will be reset to their factory default values.",
"p_warning_global_reset": "Warning! This will irrevocably delete all saved data, including credentials, from your YubiKey.",

View File

@ -318,6 +318,7 @@
"s_ep_attestation_enabled": null,
"s_enable_ep_attestation": null,
"p_enable_ep_attestation_desc": null,
"p_enable_ep_attestation_disable_with_factory_reset": null,
"s_pin_required": "PIN requis",
"p_pin_required_desc": "L'action que vous allez effectuer nécessite la saisie du PIN PIV.",
"l_piv_pin_blocked": "Bloqué, utilisez PUK pour réinitialiser",
@ -656,7 +657,9 @@
"p_subject_desc": "DN (nom distinctif) formaté conformément à la spécification RFC 4514.",
"l_rfc4514_invalid": "Format RFC 4514 non valide",
"rfc4514_examples": "Exemples\u00a0:\nCN=exemple de nom\nCN=jsmith,DC=exemple,DC=net",
"s_allow_fingerprint": null,
"p_cert_options_desc": "Algorithme clé à utiliser, format de sortie et date d'expiration (certificat uniquement).",
"p_cert_options_bio_desc": null,
"s_overwrite_slot": "Écraser slot",
"p_overwrite_slot_desc": "Cela écrasera définitivement le contenu du slot {slot}.",
"@p_overwrite_slot_desc": {
@ -799,6 +802,7 @@
"s_reset": "Réinitialiser",
"s_factory_reset": "Réinitialisation usine",
"l_factory_reset_desc": "Restaurer les paramètres par défaut de la YubiKey",
"l_factory_reset_required": null,
"l_oath_application_reset": "Réinitialisation OATH",
"l_fido_app_reset": "Réinitialisation FIDO",
"l_reset_failed": "Erreur de réinitialisation\u00a0: {message}",

View File

@ -318,6 +318,7 @@
"s_ep_attestation_enabled": null,
"s_enable_ep_attestation": null,
"p_enable_ep_attestation_desc": null,
"p_enable_ep_attestation_disable_with_factory_reset": null,
"s_pin_required": "PINが必要",
"p_pin_required_desc": "実行しようとしているアクションでは、PIV PINを入力する必要があります。",
"l_piv_pin_blocked": "ブロックされています。リセットするにはPUKを使用してください",
@ -656,7 +657,9 @@
"p_subject_desc": "RFC 4514仕様に準拠した形式の識別名DN。",
"l_rfc4514_invalid": "無効なRFC 4514形式",
"rfc4514_examples": "例:\nCN=Example Name CN=jsmith,DC=example,\nDC=net",
"s_allow_fingerprint": null,
"p_cert_options_desc": "使用する鍵アルゴリズム、出力形式、および有効期限(証明書のみ)。",
"p_cert_options_bio_desc": null,
"s_overwrite_slot": "スロットを上書き",
"p_overwrite_slot_desc": "これにより、スロット{slot}内の既存コンテンツが完全に上書きされます。",
"@p_overwrite_slot_desc": {
@ -799,6 +802,7 @@
"s_reset": "リセット",
"s_factory_reset": "工場出荷時の状態にリセット",
"l_factory_reset_desc": "YubiKey の既定値を復元",
"l_factory_reset_required": null,
"l_oath_application_reset": "OATHアプリケーションのリセット",
"l_fido_app_reset": "FIDOアプリケーションのリセット",
"l_reset_failed": "リセットの実行エラー:{message}",

View File

@ -318,6 +318,7 @@
"s_ep_attestation_enabled": null,
"s_enable_ep_attestation": null,
"p_enable_ep_attestation_desc": null,
"p_enable_ep_attestation_disable_with_factory_reset": null,
"s_pin_required": "Wymagany PIN",
"p_pin_required_desc": "Czynność, którą zamierzasz wykonać, wymaga wprowadzenia kodu PIN PIV.",
"l_piv_pin_blocked": "Zablokowano, użyj PUK, aby zresetować",
@ -656,7 +657,9 @@
"p_subject_desc": "Nazwa wyróżniająca (DN) sformatowana zgodnie ze specyfikacją RFC 4514.",
"l_rfc4514_invalid": "Nieprawidłowy format RFC 4514",
"rfc4514_examples": "Przykłady:\nCN=Przykładowa Nazwa\nCN=jkowalski,DC=przyklad,DC=pl",
"s_allow_fingerprint": null,
"p_cert_options_desc": "Algorytm klucza do użycia, format wyjściowy i data wygaśnięcia (tylko certyfikat).",
"p_cert_options_bio_desc": null,
"s_overwrite_slot": "Nadpisz slot",
"p_overwrite_slot_desc": "Spowoduje to trwałe nadpisanie istniejącej zawartości w slocie {slot}.",
"@p_overwrite_slot_desc": {
@ -799,6 +802,7 @@
"s_reset": "Zresetuj",
"s_factory_reset": "Ustawienia fabryczne",
"l_factory_reset_desc": null,
"l_factory_reset_required": null,
"l_oath_application_reset": "Reset funkcji OATH",
"l_fido_app_reset": "Reset funkcji FIDO",
"l_reset_failed": "Błąd podczas resetowania: {message}",

View File

@ -26,8 +26,12 @@ mixin _$DeviceConfig {
int? get challengeResponseTimeout => throw _privateConstructorUsedError;
int? get deviceFlags => throw _privateConstructorUsedError;
/// Serializes this DeviceConfig to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of DeviceConfig
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$DeviceConfigCopyWith<DeviceConfig> get copyWith =>
throw _privateConstructorUsedError;
}
@ -55,6 +59,8 @@ class _$DeviceConfigCopyWithImpl<$Res, $Val extends DeviceConfig>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of DeviceConfig
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -107,6 +113,8 @@ class __$$DeviceConfigImplCopyWithImpl<$Res>
_$DeviceConfigImpl _value, $Res Function(_$DeviceConfigImpl) _then)
: super(_value, _then);
/// Create a copy of DeviceConfig
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -183,7 +191,7 @@ class _$DeviceConfigImpl implements _DeviceConfig {
other.deviceFlags == deviceFlags));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
@ -192,7 +200,9 @@ class _$DeviceConfigImpl implements _DeviceConfig {
challengeResponseTimeout,
deviceFlags);
@JsonKey(ignore: true)
/// Create a copy of DeviceConfig
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$DeviceConfigImplCopyWith<_$DeviceConfigImpl> get copyWith =>
@ -224,8 +234,11 @@ abstract class _DeviceConfig implements DeviceConfig {
int? get challengeResponseTimeout;
@override
int? get deviceFlags;
/// Create a copy of DeviceConfig
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$DeviceConfigImplCopyWith<_$DeviceConfigImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -250,8 +263,12 @@ mixin _$DeviceInfo {
int get fipsApproved => throw _privateConstructorUsedError;
int get resetBlocked => throw _privateConstructorUsedError;
/// Serializes this DeviceInfo to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$DeviceInfoCopyWith<DeviceInfo> get copyWith =>
throw _privateConstructorUsedError;
}
@ -290,6 +307,8 @@ class _$DeviceInfoCopyWithImpl<$Res, $Val extends DeviceInfo>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -358,6 +377,8 @@ class _$DeviceInfoCopyWithImpl<$Res, $Val extends DeviceInfo>
) as $Val);
}
/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$DeviceConfigCopyWith<$Res> get config {
@ -366,6 +387,8 @@ class _$DeviceInfoCopyWithImpl<$Res, $Val extends DeviceInfo>
});
}
/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$VersionCopyWith<$Res> get version {
@ -411,6 +434,8 @@ class __$$DeviceInfoImplCopyWithImpl<$Res>
_$DeviceInfoImpl _value, $Res Function(_$DeviceInfoImpl) _then)
: super(_value, _then);
/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -565,7 +590,7 @@ class _$DeviceInfoImpl extends _DeviceInfo {
other.resetBlocked == resetBlocked));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
@ -582,7 +607,9 @@ class _$DeviceInfoImpl extends _DeviceInfo {
fipsApproved,
resetBlocked);
@JsonKey(ignore: true)
/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$DeviceInfoImplCopyWith<_$DeviceInfoImpl> get copyWith =>
@ -639,8 +666,11 @@ abstract class _DeviceInfo extends DeviceInfo {
int get fipsApproved;
@override
int get resetBlocked;
/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$DeviceInfoImplCopyWith<_$DeviceInfoImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@ -29,8 +29,12 @@ mixin _$OathCredential {
int get period => throw _privateConstructorUsedError;
bool get touchRequired => throw _privateConstructorUsedError;
/// Serializes this OathCredential to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of OathCredential
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$OathCredentialCopyWith<OathCredential> get copyWith =>
throw _privateConstructorUsedError;
}
@ -61,6 +65,8 @@ class _$OathCredentialCopyWithImpl<$Res, $Val extends OathCredential>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of OathCredential
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -131,6 +137,8 @@ class __$$OathCredentialImplCopyWithImpl<$Res>
_$OathCredentialImpl _value, $Res Function(_$OathCredentialImpl) _then)
: super(_value, _then);
/// Create a copy of OathCredential
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -222,12 +230,14 @@ class _$OathCredentialImpl implements _OathCredential {
other.touchRequired == touchRequired));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, deviceId, id, issuer, name, oathType, period, touchRequired);
@JsonKey(ignore: true)
/// Create a copy of OathCredential
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$OathCredentialImplCopyWith<_$OathCredentialImpl> get copyWith =>
@ -270,8 +280,11 @@ abstract class _OathCredential implements OathCredential {
int get period;
@override
bool get touchRequired;
/// Create a copy of OathCredential
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$OathCredentialImplCopyWith<_$OathCredentialImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -286,8 +299,12 @@ mixin _$OathCode {
int get validFrom => throw _privateConstructorUsedError;
int get validTo => throw _privateConstructorUsedError;
/// Serializes this OathCode to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of OathCode
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$OathCodeCopyWith<OathCode> get copyWith =>
throw _privateConstructorUsedError;
}
@ -310,6 +327,8 @@ class _$OathCodeCopyWithImpl<$Res, $Val extends OathCode>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of OathCode
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -353,6 +372,8 @@ class __$$OathCodeImplCopyWithImpl<$Res>
_$OathCodeImpl _value, $Res Function(_$OathCodeImpl) _then)
: super(_value, _then);
/// Create a copy of OathCode
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -408,11 +429,13 @@ class _$OathCodeImpl implements _OathCode {
(identical(other.validTo, validTo) || other.validTo == validTo));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, value, validFrom, validTo);
@JsonKey(ignore: true)
/// Create a copy of OathCode
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$OathCodeImplCopyWith<_$OathCodeImpl> get copyWith =>
@ -440,8 +463,11 @@ abstract class _OathCode implements OathCode {
int get validFrom;
@override
int get validTo;
/// Create a copy of OathCode
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$OathCodeImplCopyWith<_$OathCodeImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -455,8 +481,12 @@ mixin _$OathPair {
OathCredential get credential => throw _privateConstructorUsedError;
OathCode? get code => throw _privateConstructorUsedError;
/// Serializes this OathPair to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of OathPair
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$OathPairCopyWith<OathPair> get copyWith =>
throw _privateConstructorUsedError;
}
@ -482,6 +512,8 @@ class _$OathPairCopyWithImpl<$Res, $Val extends OathPair>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of OathPair
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -500,6 +532,8 @@ class _$OathPairCopyWithImpl<$Res, $Val extends OathPair>
) as $Val);
}
/// Create a copy of OathPair
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$OathCredentialCopyWith<$Res> get credential {
@ -508,6 +542,8 @@ class _$OathPairCopyWithImpl<$Res, $Val extends OathPair>
});
}
/// Create a copy of OathPair
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$OathCodeCopyWith<$Res>? get code {
@ -545,6 +581,8 @@ class __$$OathPairImplCopyWithImpl<$Res>
_$OathPairImpl _value, $Res Function(_$OathPairImpl) _then)
: super(_value, _then);
/// Create a copy of OathPair
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -592,11 +630,13 @@ class _$OathPairImpl implements _OathPair {
(identical(other.code, code) || other.code == code));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, credential, code);
@JsonKey(ignore: true)
/// Create a copy of OathPair
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$OathPairImplCopyWith<_$OathPairImpl> get copyWith =>
@ -621,8 +661,11 @@ abstract class _OathPair implements OathPair {
OathCredential get credential;
@override
OathCode? get code;
/// Create a copy of OathPair
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$OathPairImplCopyWith<_$OathPairImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -640,8 +683,12 @@ mixin _$OathState {
bool get locked => throw _privateConstructorUsedError;
KeystoreState get keystore => throw _privateConstructorUsedError;
/// Serializes this OathState to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of OathState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$OathStateCopyWith<OathState> get copyWith =>
throw _privateConstructorUsedError;
}
@ -672,6 +719,8 @@ class _$OathStateCopyWithImpl<$Res, $Val extends OathState>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of OathState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -710,6 +759,8 @@ class _$OathStateCopyWithImpl<$Res, $Val extends OathState>
) as $Val);
}
/// Create a copy of OathState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$VersionCopyWith<$Res> get version {
@ -747,6 +798,8 @@ class __$$OathStateImplCopyWithImpl<$Res>
_$OathStateImpl _value, $Res Function(_$OathStateImpl) _then)
: super(_value, _then);
/// Create a copy of OathState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -833,12 +886,14 @@ class _$OathStateImpl extends _OathState {
other.keystore == keystore));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, deviceId, version, hasKey, remembered, locked, keystore);
@JsonKey(ignore: true)
/// Create a copy of OathState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$OathStateImplCopyWith<_$OathStateImpl> get copyWith =>
@ -875,8 +930,11 @@ abstract class _OathState extends OathState {
bool get locked;
@override
KeystoreState get keystore;
/// Create a copy of OathState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$OathStateImplCopyWith<_$OathStateImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -896,8 +954,12 @@ mixin _$CredentialData {
int get period => throw _privateConstructorUsedError;
int get counter => throw _privateConstructorUsedError;
/// Serializes this CredentialData to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of CredentialData
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$CredentialDataCopyWith<CredentialData> get copyWith =>
throw _privateConstructorUsedError;
}
@ -929,6 +991,8 @@ class _$CredentialDataCopyWithImpl<$Res, $Val extends CredentialData>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of CredentialData
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1005,6 +1069,8 @@ class __$$CredentialDataImplCopyWithImpl<$Res>
_$CredentialDataImpl _value, $Res Function(_$CredentialDataImpl) _then)
: super(_value, _then);
/// Create a copy of CredentialData
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1115,12 +1181,14 @@ class _$CredentialDataImpl extends _CredentialData {
(identical(other.counter, counter) || other.counter == counter));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, issuer, name, secret, oathType,
hashAlgorithm, digits, period, counter);
@JsonKey(ignore: true)
/// Create a copy of CredentialData
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$CredentialDataImplCopyWith<_$CredentialDataImpl> get copyWith =>
@ -1166,8 +1234,11 @@ abstract class _CredentialData extends CredentialData {
int get period;
@override
int get counter;
/// Create a copy of CredentialData
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$CredentialDataImplCopyWith<_$CredentialDataImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 Yubico.
* Copyright (C) 2023,2024 Yubico.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -28,9 +28,17 @@ import '../features.dart' as features;
import '../icon_provider/icon_pack_dialog.dart';
import '../keys.dart' as keys;
import '../models.dart';
import 'manage_password_dialog.dart';
import 'utils.dart';
bool oathShowActionNotifier(DeviceInfo? info) {
if (info == null) {
return false;
}
final (fipsCapable, fipsApproved) = info.getFipsStatus(Capability.oath);
return fipsCapable && !fipsApproved;
}
Widget oathBuildActions(
BuildContext context,
DevicePath devicePath,
@ -63,6 +71,10 @@ Widget oathBuildActions(
enabled = true;
}
final colors = Theme.of(context).buttonTheme.colorScheme ??
Theme.of(context).colorScheme;
final alertIcon = Icon(Symbols.warning_amber, color: colors.tertiary);
return Column(
children: [
ActionListSection(l10n.s_setup, children: [
@ -103,13 +115,10 @@ Widget oathBuildActions(
oathState.hasKey ? l10n.s_manage_password : l10n.s_set_password,
subtitle: l10n.l_password_protection,
icon: const Icon(Symbols.password),
trailing: fipsCapable && !fipsApproved ? alertIcon : null,
onTap: (context) {
Navigator.of(context).popUntil((route) => route.isFirst);
showBlurDialog(
context: context,
builder: (context) =>
ManagePasswordDialog(devicePath, oathState),
);
managePassword(context, ref, devicePath, oathState);
}),
]),
],

View File

@ -167,7 +167,8 @@ class _UnlockedViewState extends ConsumerState<_UnlockedView> {
final hasFeature = ref.watch(featureProvider);
final hasActions = hasFeature(features.actions);
final searchText = searchController.text;
final deviceInfo =
ref.watch(currentDeviceDataProvider.select((s) => s.valueOrNull?.info));
Future<void> onFileDropped(File file) async {
final qrScanner = ref.read(qrScannerProvider);
if (qrScanner != null) {
@ -186,21 +187,36 @@ class _UnlockedViewState extends ConsumerState<_UnlockedView> {
if (numCreds == 0) {
return MessagePage(
actionsBuilder: (context, expanded) => [
if (!expanded)
ActionChip(
label: Text(l10n.s_add_account),
onPressed: () async {
await addOathAccount(
context,
ref,
widget.devicePath,
widget.oathState,
);
},
avatar: const Icon(Symbols.person_add_alt),
)
],
keyActionsBadge: oathShowActionNotifier(deviceInfo),
actionsBuilder: (context, expanded) {
final (fipsCapable, fipsApproved) =
deviceInfo?.getFipsStatus(Capability.oath) ?? (false, false);
return [
if (!expanded && (!fipsCapable || (fipsCapable && fipsApproved)))
ActionChip(
label: Text(l10n.s_add_account),
onPressed: () async {
await addOathAccount(
context,
ref,
widget.devicePath,
widget.oathState,
);
},
avatar: const Icon(Symbols.person_add_alt),
),
if (!expanded && fipsCapable && !fipsApproved)
ActionChip(
label: Text(l10n.s_set_password),
onPressed: () async {
await managePassword(
context, ref, widget.devicePath, widget.oathState);
},
avatar: const Icon(Symbols.person_add_alt),
)
];
},
title: l10n.s_accounts,
capabilities: const [Capability.oath],
key: keys.noAccountsView,
@ -225,6 +241,7 @@ class _UnlockedViewState extends ConsumerState<_UnlockedView> {
capabilities: const [Capability.oath],
centered: true,
delayedContent: true,
keyActionsBadge: oathShowActionNotifier(deviceInfo),
builder: (context, _) => const CircularProgressIndicator(),
);
}
@ -290,6 +307,7 @@ class _UnlockedViewState extends ConsumerState<_UnlockedView> {
alternativeTitle:
searchText != '' ? l10n.l_results_for(searchText) : null,
capabilities: const [Capability.oath],
keyActionsBadge: oathShowActionNotifier(deviceInfo),
keyActionsBuilder: hasActions
? (context) => oathBuildActions(
context,
@ -500,7 +518,7 @@ class _UnlockedViewState extends ConsumerState<_UnlockedView> {
},
child: PopupMenuButton(
constraints: const BoxConstraints.tightFor(),
tooltip: 'Select layout',
tooltip: l10n.s_select_layout,
popUpAnimationStyle:
AnimationStyle(duration: Duration.zero),
icon: Icon(

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Yubico.
* Copyright (C) 2022-2024 Yubico.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -35,6 +35,7 @@ import '../models.dart';
import 'add_account_dialog.dart';
import 'add_account_page.dart';
import 'add_multi_account_page.dart';
import 'manage_password_dialog.dart';
/// Calculates the available space for issuer and account name.
///
@ -178,3 +179,11 @@ Future<void> addOathAccount(BuildContext context, WidgetRef ref,
);
}
}
Future<void> managePassword(BuildContext context, WidgetRef ref,
DevicePath devicePath, OathState oathState) async {
await showBlurDialog(
context: context,
builder: (context) => ManagePasswordDialog(devicePath, oathState),
);
}

View File

@ -23,8 +23,12 @@ mixin _$OtpState {
bool get slot1Configured => throw _privateConstructorUsedError;
bool get slot2Configured => throw _privateConstructorUsedError;
/// Serializes this OtpState to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of OtpState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$OtpStateCopyWith<OtpState> get copyWith =>
throw _privateConstructorUsedError;
}
@ -47,6 +51,8 @@ class _$OtpStateCopyWithImpl<$Res, $Val extends OtpState>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of OtpState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -85,6 +91,8 @@ class __$$OtpStateImplCopyWithImpl<$Res>
_$OtpStateImpl _value, $Res Function(_$OtpStateImpl) _then)
: super(_value, _then);
/// Create a copy of OtpState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -134,12 +142,14 @@ class _$OtpStateImpl extends _OtpState {
other.slot2Configured == slot2Configured));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, slot1Configured, slot2Configured);
@JsonKey(ignore: true)
/// Create a copy of OtpState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$OtpStateImplCopyWith<_$OtpStateImpl> get copyWith =>
@ -166,8 +176,11 @@ abstract class _OtpState extends OtpState {
bool get slot1Configured;
@override
bool get slot2Configured;
/// Create a copy of OtpState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$OtpStateImplCopyWith<_$OtpStateImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -177,7 +190,9 @@ mixin _$OtpSlot {
SlotId get slot => throw _privateConstructorUsedError;
bool get isConfigured => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of OtpSlot
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$OtpSlotCopyWith<OtpSlot> get copyWith => throw _privateConstructorUsedError;
}
@ -199,6 +214,8 @@ class _$OtpSlotCopyWithImpl<$Res, $Val extends OtpSlot>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of OtpSlot
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -236,6 +253,8 @@ class __$$OtpSlotImplCopyWithImpl<$Res>
_$OtpSlotImpl _value, $Res Function(_$OtpSlotImpl) _then)
: super(_value, _then);
/// Create a copy of OtpSlot
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -283,7 +302,9 @@ class _$OtpSlotImpl implements _OtpSlot {
@override
int get hashCode => Object.hash(runtimeType, slot, isConfigured);
@JsonKey(ignore: true)
/// Create a copy of OtpSlot
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$OtpSlotImplCopyWith<_$OtpSlotImpl> get copyWith =>
@ -299,8 +320,11 @@ abstract class _OtpSlot implements OtpSlot {
SlotId get slot;
@override
bool get isConfigured;
/// Create a copy of OtpSlot
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$OtpSlotImplCopyWith<_$OtpSlotImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -316,8 +340,12 @@ mixin _$SlotConfigurationOptions {
bool? get requireTouch => throw _privateConstructorUsedError;
bool? get appendCr => throw _privateConstructorUsedError;
/// Serializes this SlotConfigurationOptions to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of SlotConfigurationOptions
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$SlotConfigurationOptionsCopyWith<SlotConfigurationOptions> get copyWith =>
throw _privateConstructorUsedError;
}
@ -342,6 +370,8 @@ class _$SlotConfigurationOptionsCopyWithImpl<$Res,
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of SlotConfigurationOptions
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -388,6 +418,8 @@ class __$$SlotConfigurationOptionsImplCopyWithImpl<$Res>
$Res Function(_$SlotConfigurationOptionsImpl) _then)
: super(_value, _then);
/// Create a copy of SlotConfigurationOptions
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -446,11 +478,13 @@ class _$SlotConfigurationOptionsImpl implements _SlotConfigurationOptions {
other.appendCr == appendCr));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, digits8, requireTouch, appendCr);
@JsonKey(ignore: true)
/// Create a copy of SlotConfigurationOptions
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$SlotConfigurationOptionsImplCopyWith<_$SlotConfigurationOptionsImpl>
@ -480,8 +514,11 @@ abstract class _SlotConfigurationOptions implements SlotConfigurationOptions {
bool? get requireTouch;
@override
bool? get appendCr;
/// Create a copy of SlotConfigurationOptions
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$SlotConfigurationOptionsImplCopyWith<_$SlotConfigurationOptionsImpl>
get copyWith => throw _privateConstructorUsedError;
}
@ -570,8 +607,13 @@ mixin _$SlotConfiguration {
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
/// Serializes this SlotConfiguration to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$SlotConfigurationCopyWith<SlotConfiguration> get copyWith =>
throw _privateConstructorUsedError;
}
@ -597,6 +639,8 @@ class _$SlotConfigurationCopyWithImpl<$Res, $Val extends SlotConfiguration>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -610,6 +654,8 @@ class _$SlotConfigurationCopyWithImpl<$Res, $Val extends SlotConfiguration>
) as $Val);
}
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SlotConfigurationOptionsCopyWith<$Res>? get options {
@ -646,6 +692,8 @@ class __$$SlotConfigurationHotpImplCopyWithImpl<$Res>
$Res Function(_$SlotConfigurationHotpImpl) _then)
: super(_value, _then);
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -699,11 +747,13 @@ class _$SlotConfigurationHotpImpl extends _SlotConfigurationHotp {
(identical(other.options, options) || other.options == options));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, key, options);
@JsonKey(ignore: true)
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$SlotConfigurationHotpImplCopyWith<_$SlotConfigurationHotpImpl>
@ -818,8 +868,11 @@ abstract class _SlotConfigurationHotp extends SlotConfiguration {
String get key;
@override
SlotConfigurationOptions? get options;
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$SlotConfigurationHotpImplCopyWith<_$SlotConfigurationHotpImpl>
get copyWith => throw _privateConstructorUsedError;
}
@ -849,6 +902,8 @@ class __$$SlotConfigurationHmacSha1ImplCopyWithImpl<$Res>
$Res Function(_$SlotConfigurationHmacSha1Impl) _then)
: super(_value, _then);
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -902,11 +957,13 @@ class _$SlotConfigurationHmacSha1Impl extends _SlotConfigurationHmacSha1 {
(identical(other.options, options) || other.options == options));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, key, options);
@JsonKey(ignore: true)
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$SlotConfigurationHmacSha1ImplCopyWith<_$SlotConfigurationHmacSha1Impl>
@ -1022,8 +1079,11 @@ abstract class _SlotConfigurationHmacSha1 extends SlotConfiguration {
String get key;
@override
SlotConfigurationOptions? get options;
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$SlotConfigurationHmacSha1ImplCopyWith<_$SlotConfigurationHmacSha1Impl>
get copyWith => throw _privateConstructorUsedError;
}
@ -1056,6 +1116,8 @@ class __$$SlotConfigurationStaticPasswordImplCopyWithImpl<$Res>
$Res Function(_$SlotConfigurationStaticPasswordImpl) _then)
: super(_value, _then);
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1124,12 +1186,14 @@ class _$SlotConfigurationStaticPasswordImpl
(identical(other.options, options) || other.options == options));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, password, keyboardLayout, options);
@JsonKey(ignore: true)
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$SlotConfigurationStaticPasswordImplCopyWith<
@ -1248,8 +1312,11 @@ abstract class _SlotConfigurationStaticPassword extends SlotConfiguration {
String get keyboardLayout;
@override
SlotConfigurationOptions? get options;
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$SlotConfigurationStaticPasswordImplCopyWith<
_$SlotConfigurationStaticPasswordImpl>
get copyWith => throw _privateConstructorUsedError;
@ -1284,6 +1351,8 @@ class __$$SlotConfigurationYubiOtpImplCopyWithImpl<$Res>
$Res Function(_$SlotConfigurationYubiOtpImpl) _then)
: super(_value, _then);
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1359,12 +1428,14 @@ class _$SlotConfigurationYubiOtpImpl extends _SlotConfigurationYubiOtp {
(identical(other.options, options) || other.options == options));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, publicId, privateId, key, options);
@JsonKey(ignore: true)
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$SlotConfigurationYubiOtpImplCopyWith<_$SlotConfigurationYubiOtpImpl>
@ -1484,8 +1555,11 @@ abstract class _SlotConfigurationYubiOtp extends SlotConfiguration {
String get key;
@override
SlotConfigurationOptions? get options;
/// Create a copy of SlotConfiguration
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$SlotConfigurationYubiOtpImplCopyWith<_$SlotConfigurationYubiOtpImpl>
get copyWith => throw _privateConstructorUsedError;
}

View File

@ -270,6 +270,7 @@ class PivState with _$PivState {
required bool derivedKey,
required bool storedKey,
required int pinAttempts,
required bool supportsBio,
String? chuid,
String? ccc,
PivStateMetadata? metadata,

View File

@ -24,8 +24,12 @@ mixin _$PinMetadata {
int get totalAttempts => throw _privateConstructorUsedError;
int get attemptsRemaining => throw _privateConstructorUsedError;
/// Serializes this PinMetadata to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of PinMetadata
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$PinMetadataCopyWith<PinMetadata> get copyWith =>
throw _privateConstructorUsedError;
}
@ -49,6 +53,8 @@ class _$PinMetadataCopyWithImpl<$Res, $Val extends PinMetadata>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PinMetadata
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -92,6 +98,8 @@ class __$$PinMetadataImplCopyWithImpl<$Res>
_$PinMetadataImpl _value, $Res Function(_$PinMetadataImpl) _then)
: super(_value, _then);
/// Create a copy of PinMetadata
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -150,12 +158,14 @@ class _$PinMetadataImpl implements _PinMetadata {
other.attemptsRemaining == attemptsRemaining));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, defaultValue, totalAttempts, attemptsRemaining);
@JsonKey(ignore: true)
/// Create a copy of PinMetadata
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PinMetadataImplCopyWith<_$PinMetadataImpl> get copyWith =>
@ -182,8 +192,11 @@ abstract class _PinMetadata implements PinMetadata {
int get totalAttempts;
@override
int get attemptsRemaining;
/// Create a copy of PinMetadata
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PinMetadataImplCopyWith<_$PinMetadataImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -247,6 +260,9 @@ class _$PinVerificationStatusCopyWithImpl<$Res,
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PinVerificationStatus
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@ -263,6 +279,9 @@ class __$$PinSuccessImplCopyWithImpl<$Res>
__$$PinSuccessImplCopyWithImpl(
_$PinSuccessImpl _value, $Res Function(_$PinSuccessImpl) _then)
: super(_value, _then);
/// Create a copy of PinVerificationStatus
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@ -370,6 +389,8 @@ class __$$PinFailureImplCopyWithImpl<$Res>
_$PinFailureImpl _value, $Res Function(_$PinFailureImpl) _then)
: super(_value, _then);
/// Create a copy of PinVerificationStatus
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -383,6 +404,8 @@ class __$$PinFailureImplCopyWithImpl<$Res>
));
}
/// Create a copy of PinVerificationStatus
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$PivPinFailureReasonCopyWith<$Res> get reason {
@ -416,7 +439,9 @@ class _$PinFailureImpl implements PinFailure {
@override
int get hashCode => Object.hash(runtimeType, reason);
@JsonKey(ignore: true)
/// Create a copy of PinVerificationStatus
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PinFailureImplCopyWith<_$PinFailureImpl> get copyWith =>
@ -489,7 +514,10 @@ abstract class PinFailure implements PinVerificationStatus {
factory PinFailure(final PivPinFailureReason reason) = _$PinFailureImpl;
PivPinFailureReason get reason;
@JsonKey(ignore: true)
/// Create a copy of PinVerificationStatus
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PinFailureImplCopyWith<_$PinFailureImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -552,6 +580,9 @@ class _$PivPinFailureReasonCopyWithImpl<$Res, $Val extends PivPinFailureReason>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PivPinFailureReason
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@ -571,6 +602,8 @@ class __$$PivInvalidPinImplCopyWithImpl<$Res>
_$PivInvalidPinImpl _value, $Res Function(_$PivInvalidPinImpl) _then)
: super(_value, _then);
/// Create a copy of PivPinFailureReason
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -610,7 +643,9 @@ class _$PivInvalidPinImpl implements PivInvalidPin {
@override
int get hashCode => Object.hash(runtimeType, attemptsRemaining);
@JsonKey(ignore: true)
/// Create a copy of PivPinFailureReason
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PivInvalidPinImplCopyWith<_$PivInvalidPinImpl> get copyWith =>
@ -683,7 +718,10 @@ abstract class PivInvalidPin implements PivPinFailureReason {
factory PivInvalidPin(final int attemptsRemaining) = _$PivInvalidPinImpl;
int get attemptsRemaining;
@JsonKey(ignore: true)
/// Create a copy of PivPinFailureReason
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PivInvalidPinImplCopyWith<_$PivInvalidPinImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -702,6 +740,9 @@ class __$$PivWeakPinImplCopyWithImpl<$Res>
__$$PivWeakPinImplCopyWithImpl(
_$PivWeakPinImpl _value, $Res Function(_$PivWeakPinImpl) _then)
: super(_value, _then);
/// Create a copy of PivPinFailureReason
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@ -801,8 +842,12 @@ mixin _$ManagementKeyMetadata {
bool get defaultValue => throw _privateConstructorUsedError;
TouchPolicy get touchPolicy => throw _privateConstructorUsedError;
/// Serializes this ManagementKeyMetadata to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of ManagementKeyMetadata
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ManagementKeyMetadataCopyWith<ManagementKeyMetadata> get copyWith =>
throw _privateConstructorUsedError;
}
@ -828,6 +873,8 @@ class _$ManagementKeyMetadataCopyWithImpl<$Res,
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ManagementKeyMetadata
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -874,6 +921,8 @@ class __$$ManagementKeyMetadataImplCopyWithImpl<$Res>
$Res Function(_$ManagementKeyMetadataImpl) _then)
: super(_value, _then);
/// Create a copy of ManagementKeyMetadata
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -931,12 +980,14 @@ class _$ManagementKeyMetadataImpl implements _ManagementKeyMetadata {
other.touchPolicy == touchPolicy));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, keyType, defaultValue, touchPolicy);
@JsonKey(ignore: true)
/// Create a copy of ManagementKeyMetadata
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ManagementKeyMetadataImplCopyWith<_$ManagementKeyMetadataImpl>
@ -966,8 +1017,11 @@ abstract class _ManagementKeyMetadata implements ManagementKeyMetadata {
bool get defaultValue;
@override
TouchPolicy get touchPolicy;
/// Create a copy of ManagementKeyMetadata
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ManagementKeyMetadataImplCopyWith<_$ManagementKeyMetadataImpl>
get copyWith => throw _privateConstructorUsedError;
}
@ -984,8 +1038,12 @@ mixin _$SlotMetadata {
bool get generated => throw _privateConstructorUsedError;
String get publicKey => throw _privateConstructorUsedError;
/// Serializes this SlotMetadata to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of SlotMetadata
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$SlotMetadataCopyWith<SlotMetadata> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1014,6 +1072,8 @@ class _$SlotMetadataCopyWithImpl<$Res, $Val extends SlotMetadata>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of SlotMetadata
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1072,6 +1132,8 @@ class __$$SlotMetadataImplCopyWithImpl<$Res>
_$SlotMetadataImpl _value, $Res Function(_$SlotMetadataImpl) _then)
: super(_value, _then);
/// Create a copy of SlotMetadata
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1147,12 +1209,14 @@ class _$SlotMetadataImpl implements _SlotMetadata {
other.publicKey == publicKey));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, keyType, pinPolicy, touchPolicy, generated, publicKey);
@JsonKey(ignore: true)
/// Create a copy of SlotMetadata
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$SlotMetadataImplCopyWith<_$SlotMetadataImpl> get copyWith =>
@ -1187,8 +1251,11 @@ abstract class _SlotMetadata implements SlotMetadata {
bool get generated;
@override
String get publicKey;
/// Create a copy of SlotMetadata
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$SlotMetadataImplCopyWith<_$SlotMetadataImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1204,8 +1271,12 @@ mixin _$PivStateMetadata {
PinMetadata get pinMetadata => throw _privateConstructorUsedError;
PinMetadata get pukMetadata => throw _privateConstructorUsedError;
/// Serializes this PivStateMetadata to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of PivStateMetadata
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$PivStateMetadataCopyWith<PivStateMetadata> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1236,6 +1307,8 @@ class _$PivStateMetadataCopyWithImpl<$Res, $Val extends PivStateMetadata>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PivStateMetadata
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1259,6 +1332,8 @@ class _$PivStateMetadataCopyWithImpl<$Res, $Val extends PivStateMetadata>
) as $Val);
}
/// Create a copy of PivStateMetadata
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ManagementKeyMetadataCopyWith<$Res> get managementKeyMetadata {
@ -1268,6 +1343,8 @@ class _$PivStateMetadataCopyWithImpl<$Res, $Val extends PivStateMetadata>
});
}
/// Create a copy of PivStateMetadata
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$PinMetadataCopyWith<$Res> get pinMetadata {
@ -1276,6 +1353,8 @@ class _$PivStateMetadataCopyWithImpl<$Res, $Val extends PivStateMetadata>
});
}
/// Create a copy of PivStateMetadata
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$PinMetadataCopyWith<$Res> get pukMetadata {
@ -1314,6 +1393,8 @@ class __$$PivStateMetadataImplCopyWithImpl<$Res>
$Res Function(_$PivStateMetadataImpl) _then)
: super(_value, _then);
/// Create a copy of PivStateMetadata
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1374,12 +1455,14 @@ class _$PivStateMetadataImpl implements _PivStateMetadata {
other.pukMetadata == pukMetadata));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, managementKeyMetadata, pinMetadata, pukMetadata);
@JsonKey(ignore: true)
/// Create a copy of PivStateMetadata
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PivStateMetadataImplCopyWith<_$PivStateMetadataImpl> get copyWith =>
@ -1409,8 +1492,11 @@ abstract class _PivStateMetadata implements PivStateMetadata {
PinMetadata get pinMetadata;
@override
PinMetadata get pukMetadata;
/// Create a copy of PivStateMetadata
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PivStateMetadataImplCopyWith<_$PivStateMetadataImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1426,12 +1512,17 @@ mixin _$PivState {
bool get derivedKey => throw _privateConstructorUsedError;
bool get storedKey => throw _privateConstructorUsedError;
int get pinAttempts => throw _privateConstructorUsedError;
bool get supportsBio => throw _privateConstructorUsedError;
String? get chuid => throw _privateConstructorUsedError;
String? get ccc => throw _privateConstructorUsedError;
PivStateMetadata? get metadata => throw _privateConstructorUsedError;
/// Serializes this PivState to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of PivState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$PivStateCopyWith<PivState> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1447,6 +1538,7 @@ abstract class $PivStateCopyWith<$Res> {
bool derivedKey,
bool storedKey,
int pinAttempts,
bool supportsBio,
String? chuid,
String? ccc,
PivStateMetadata? metadata});
@ -1465,6 +1557,8 @@ class _$PivStateCopyWithImpl<$Res, $Val extends PivState>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PivState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1473,6 +1567,7 @@ class _$PivStateCopyWithImpl<$Res, $Val extends PivState>
Object? derivedKey = null,
Object? storedKey = null,
Object? pinAttempts = null,
Object? supportsBio = null,
Object? chuid = freezed,
Object? ccc = freezed,
Object? metadata = freezed,
@ -1498,6 +1593,10 @@ class _$PivStateCopyWithImpl<$Res, $Val extends PivState>
? _value.pinAttempts
: pinAttempts // ignore: cast_nullable_to_non_nullable
as int,
supportsBio: null == supportsBio
? _value.supportsBio
: supportsBio // ignore: cast_nullable_to_non_nullable
as bool,
chuid: freezed == chuid
? _value.chuid
: chuid // ignore: cast_nullable_to_non_nullable
@ -1513,6 +1612,8 @@ class _$PivStateCopyWithImpl<$Res, $Val extends PivState>
) as $Val);
}
/// Create a copy of PivState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$VersionCopyWith<$Res> get version {
@ -1521,6 +1622,8 @@ class _$PivStateCopyWithImpl<$Res, $Val extends PivState>
});
}
/// Create a copy of PivState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$PivStateMetadataCopyWith<$Res>? get metadata {
@ -1548,6 +1651,7 @@ abstract class _$$PivStateImplCopyWith<$Res>
bool derivedKey,
bool storedKey,
int pinAttempts,
bool supportsBio,
String? chuid,
String? ccc,
PivStateMetadata? metadata});
@ -1566,6 +1670,8 @@ class __$$PivStateImplCopyWithImpl<$Res>
_$PivStateImpl _value, $Res Function(_$PivStateImpl) _then)
: super(_value, _then);
/// Create a copy of PivState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1574,6 +1680,7 @@ class __$$PivStateImplCopyWithImpl<$Res>
Object? derivedKey = null,
Object? storedKey = null,
Object? pinAttempts = null,
Object? supportsBio = null,
Object? chuid = freezed,
Object? ccc = freezed,
Object? metadata = freezed,
@ -1599,6 +1706,10 @@ class __$$PivStateImplCopyWithImpl<$Res>
? _value.pinAttempts
: pinAttempts // ignore: cast_nullable_to_non_nullable
as int,
supportsBio: null == supportsBio
? _value.supportsBio
: supportsBio // ignore: cast_nullable_to_non_nullable
as bool,
chuid: freezed == chuid
? _value.chuid
: chuid // ignore: cast_nullable_to_non_nullable
@ -1624,6 +1735,7 @@ class _$PivStateImpl extends _PivState {
required this.derivedKey,
required this.storedKey,
required this.pinAttempts,
required this.supportsBio,
this.chuid,
this.ccc,
this.metadata})
@ -1643,6 +1755,8 @@ class _$PivStateImpl extends _PivState {
@override
final int pinAttempts;
@override
final bool supportsBio;
@override
final String? chuid;
@override
final String? ccc;
@ -1651,7 +1765,7 @@ class _$PivStateImpl extends _PivState {
@override
String toString() {
return 'PivState(version: $version, authenticated: $authenticated, derivedKey: $derivedKey, storedKey: $storedKey, pinAttempts: $pinAttempts, chuid: $chuid, ccc: $ccc, metadata: $metadata)';
return 'PivState(version: $version, authenticated: $authenticated, derivedKey: $derivedKey, storedKey: $storedKey, pinAttempts: $pinAttempts, supportsBio: $supportsBio, chuid: $chuid, ccc: $ccc, metadata: $metadata)';
}
@override
@ -1668,18 +1782,22 @@ class _$PivStateImpl extends _PivState {
other.storedKey == storedKey) &&
(identical(other.pinAttempts, pinAttempts) ||
other.pinAttempts == pinAttempts) &&
(identical(other.supportsBio, supportsBio) ||
other.supportsBio == supportsBio) &&
(identical(other.chuid, chuid) || other.chuid == chuid) &&
(identical(other.ccc, ccc) || other.ccc == ccc) &&
(identical(other.metadata, metadata) ||
other.metadata == metadata));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, version, authenticated,
derivedKey, storedKey, pinAttempts, chuid, ccc, metadata);
derivedKey, storedKey, pinAttempts, supportsBio, chuid, ccc, metadata);
@JsonKey(ignore: true)
/// Create a copy of PivState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PivStateImplCopyWith<_$PivStateImpl> get copyWith =>
@ -1700,6 +1818,7 @@ abstract class _PivState extends PivState {
required final bool derivedKey,
required final bool storedKey,
required final int pinAttempts,
required final bool supportsBio,
final String? chuid,
final String? ccc,
final PivStateMetadata? metadata}) = _$PivStateImpl;
@ -1719,13 +1838,18 @@ abstract class _PivState extends PivState {
@override
int get pinAttempts;
@override
bool get supportsBio;
@override
String? get chuid;
@override
String? get ccc;
@override
PivStateMetadata? get metadata;
/// Create a copy of PivState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PivStateImplCopyWith<_$PivStateImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1744,8 +1868,12 @@ mixin _$CertInfo {
String get notValidAfter => throw _privateConstructorUsedError;
String get fingerprint => throw _privateConstructorUsedError;
/// Serializes this CertInfo to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of CertInfo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$CertInfoCopyWith<CertInfo> get copyWith =>
throw _privateConstructorUsedError;
}
@ -1775,6 +1903,8 @@ class _$CertInfoCopyWithImpl<$Res, $Val extends CertInfo>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of CertInfo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1845,6 +1975,8 @@ class __$$CertInfoImplCopyWithImpl<$Res>
_$CertInfoImpl _value, $Res Function(_$CertInfoImpl) _then)
: super(_value, _then);
/// Create a copy of CertInfo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -1941,12 +2073,14 @@ class _$CertInfoImpl implements _CertInfo {
other.fingerprint == fingerprint));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, keyType, subject, issuer, serial,
notValidBefore, notValidAfter, fingerprint);
@JsonKey(ignore: true)
/// Create a copy of CertInfo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$CertInfoImplCopyWith<_$CertInfoImpl> get copyWith =>
@ -1987,8 +2121,11 @@ abstract class _CertInfo implements CertInfo {
String get notValidAfter;
@override
String get fingerprint;
/// Create a copy of CertInfo
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$CertInfoImplCopyWith<_$CertInfoImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -2003,8 +2140,12 @@ mixin _$PivSlot {
SlotMetadata? get metadata => throw _privateConstructorUsedError;
CertInfo? get certInfo => throw _privateConstructorUsedError;
/// Serializes this PivSlot to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of PivSlot
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$PivSlotCopyWith<PivSlot> get copyWith => throw _privateConstructorUsedError;
}
@ -2029,6 +2170,8 @@ class _$PivSlotCopyWithImpl<$Res, $Val extends PivSlot>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PivSlot
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -2052,6 +2195,8 @@ class _$PivSlotCopyWithImpl<$Res, $Val extends PivSlot>
) as $Val);
}
/// Create a copy of PivSlot
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SlotMetadataCopyWith<$Res>? get metadata {
@ -2064,6 +2209,8 @@ class _$PivSlotCopyWithImpl<$Res, $Val extends PivSlot>
});
}
/// Create a copy of PivSlot
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$CertInfoCopyWith<$Res>? get certInfo {
@ -2100,6 +2247,8 @@ class __$$PivSlotImplCopyWithImpl<$Res>
_$PivSlotImpl _value, $Res Function(_$PivSlotImpl) _then)
: super(_value, _then);
/// Create a copy of PivSlot
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -2156,11 +2305,13 @@ class _$PivSlotImpl implements _PivSlot {
other.certInfo == certInfo));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, slot, metadata, certInfo);
@JsonKey(ignore: true)
/// Create a copy of PivSlot
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PivSlotImplCopyWith<_$PivSlotImpl> get copyWith =>
@ -2188,8 +2339,11 @@ abstract class _PivSlot implements PivSlot {
SlotMetadata? get metadata;
@override
CertInfo? get certInfo;
/// Create a copy of PivSlot
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PivSlotImplCopyWith<_$PivSlotImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -2251,6 +2405,8 @@ mixin _$PivExamineResult {
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
/// Serializes this PivExamineResult to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
}
@ -2270,6 +2426,9 @@ class _$PivExamineResultCopyWithImpl<$Res, $Val extends PivExamineResult>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PivExamineResult
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@ -2291,6 +2450,8 @@ class __$$ExamineResultImplCopyWithImpl<$Res>
_$ExamineResultImpl _value, $Res Function(_$ExamineResultImpl) _then)
: super(_value, _then);
/// Create a copy of PivExamineResult
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -2314,6 +2475,8 @@ class __$$ExamineResultImplCopyWithImpl<$Res>
));
}
/// Create a copy of PivExamineResult
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$CertInfoCopyWith<$Res>? get certInfo {
@ -2367,11 +2530,13 @@ class _$ExamineResultImpl implements _ExamineResult {
other.certInfo == certInfo));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, password, keyType, certInfo);
@JsonKey(ignore: true)
/// Create a copy of PivExamineResult
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ExamineResultImplCopyWith<_$ExamineResultImpl> get copyWith =>
@ -2463,7 +2628,10 @@ abstract class _ExamineResult implements PivExamineResult {
bool get password;
KeyType? get keyType;
CertInfo? get certInfo;
@JsonKey(ignore: true)
/// Create a copy of PivExamineResult
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ExamineResultImplCopyWith<_$ExamineResultImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -2482,6 +2650,9 @@ class __$$InvalidPasswordImplCopyWithImpl<$Res>
__$$InvalidPasswordImplCopyWithImpl(
_$InvalidPasswordImpl _value, $Res Function(_$InvalidPasswordImpl) _then)
: super(_value, _then);
/// Create a copy of PivExamineResult
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@ -2507,7 +2678,7 @@ class _$InvalidPasswordImpl implements _InvalidPassword {
(other.runtimeType == runtimeType && other is _$InvalidPasswordImpl);
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => runtimeType.hashCode;
@ -2661,6 +2832,9 @@ class _$PivGenerateParametersCopyWithImpl<$Res,
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PivGenerateParameters
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@ -2677,6 +2851,9 @@ class __$$GeneratePublicKeyImplCopyWithImpl<$Res>
__$$GeneratePublicKeyImplCopyWithImpl(_$GeneratePublicKeyImpl _value,
$Res Function(_$GeneratePublicKeyImpl) _then)
: super(_value, _then);
/// Create a copy of PivGenerateParameters
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@ -2792,6 +2969,8 @@ class __$$GenerateCertificateImplCopyWithImpl<$Res>
$Res Function(_$GenerateCertificateImpl) _then)
: super(_value, _then);
/// Create a copy of PivGenerateParameters
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -2848,7 +3027,9 @@ class _$GenerateCertificateImpl implements _GenerateCertificate {
@override
int get hashCode => Object.hash(runtimeType, subject, validFrom, validTo);
@JsonKey(ignore: true)
/// Create a copy of PivGenerateParameters
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$GenerateCertificateImplCopyWith<_$GenerateCertificateImpl> get copyWith =>
@ -2937,7 +3118,10 @@ abstract class _GenerateCertificate implements PivGenerateParameters {
String get subject;
DateTime get validFrom;
DateTime get validTo;
@JsonKey(ignore: true)
/// Create a copy of PivGenerateParameters
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$GenerateCertificateImplCopyWith<_$GenerateCertificateImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -2959,6 +3143,8 @@ class __$$GenerateCsrImplCopyWithImpl<$Res>
_$GenerateCsrImpl _value, $Res Function(_$GenerateCsrImpl) _then)
: super(_value, _then);
/// Create a copy of PivGenerateParameters
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -2997,7 +3183,9 @@ class _$GenerateCsrImpl implements _GenerateCsr {
@override
int get hashCode => Object.hash(runtimeType, subject);
@JsonKey(ignore: true)
/// Create a copy of PivGenerateParameters
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$GenerateCsrImplCopyWith<_$GenerateCsrImpl> get copyWith =>
@ -3080,7 +3268,10 @@ abstract class _GenerateCsr implements PivGenerateParameters {
factory _GenerateCsr({required final String subject}) = _$GenerateCsrImpl;
String get subject;
@JsonKey(ignore: true)
/// Create a copy of PivGenerateParameters
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$GenerateCsrImplCopyWith<_$GenerateCsrImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -3095,8 +3286,12 @@ mixin _$PivGenerateResult {
String get publicKey => throw _privateConstructorUsedError;
String? get result => throw _privateConstructorUsedError;
/// Serializes this PivGenerateResult to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of PivGenerateResult
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$PivGenerateResultCopyWith<PivGenerateResult> get copyWith =>
throw _privateConstructorUsedError;
}
@ -3120,6 +3315,8 @@ class _$PivGenerateResultCopyWithImpl<$Res, $Val extends PivGenerateResult>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PivGenerateResult
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -3163,6 +3360,8 @@ class __$$PivGenerateResultImplCopyWithImpl<$Res>
$Res Function(_$PivGenerateResultImpl) _then)
: super(_value, _then);
/// Create a copy of PivGenerateResult
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -3220,11 +3419,13 @@ class _$PivGenerateResultImpl implements _PivGenerateResult {
(identical(other.result, result) || other.result == result));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, generateType, publicKey, result);
@JsonKey(ignore: true)
/// Create a copy of PivGenerateResult
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PivGenerateResultImplCopyWith<_$PivGenerateResultImpl> get copyWith =>
@ -3254,8 +3455,11 @@ abstract class _PivGenerateResult implements PivGenerateResult {
String get publicKey;
@override
String? get result;
/// Create a copy of PivGenerateResult
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PivGenerateResultImplCopyWith<_$PivGenerateResultImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@ -3270,8 +3474,12 @@ mixin _$PivImportResult {
String? get publicKey => throw _privateConstructorUsedError;
String? get certificate => throw _privateConstructorUsedError;
/// Serializes this PivImportResult to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of PivImportResult
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$PivImportResultCopyWith<PivImportResult> get copyWith =>
throw _privateConstructorUsedError;
}
@ -3297,6 +3505,8 @@ class _$PivImportResultCopyWithImpl<$Res, $Val extends PivImportResult>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PivImportResult
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -3320,6 +3530,8 @@ class _$PivImportResultCopyWithImpl<$Res, $Val extends PivImportResult>
) as $Val);
}
/// Create a copy of PivImportResult
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SlotMetadataCopyWith<$Res>? get metadata {
@ -3355,6 +3567,8 @@ class __$$PivImportResultImplCopyWithImpl<$Res>
_$PivImportResultImpl _value, $Res Function(_$PivImportResultImpl) _then)
: super(_value, _then);
/// Create a copy of PivImportResult
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@ -3415,12 +3629,14 @@ class _$PivImportResultImpl implements _PivImportResult {
other.certificate == certificate));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, metadata, publicKey, certificate);
@JsonKey(ignore: true)
/// Create a copy of PivImportResult
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PivImportResultImplCopyWith<_$PivImportResultImpl> get copyWith =>
@ -3450,8 +3666,11 @@ abstract class _PivImportResult implements PivImportResult {
String? get publicKey;
@override
String? get certificate;
/// Create a copy of PivImportResult
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PivImportResultImplCopyWith<_$PivImportResultImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@ -114,6 +114,7 @@ _$PivStateImpl _$$PivStateImplFromJson(Map<String, dynamic> json) =>
derivedKey: json['derived_key'] as bool,
storedKey: json['stored_key'] as bool,
pinAttempts: (json['pin_attempts'] as num).toInt(),
supportsBio: json['supports_bio'] as bool,
chuid: json['chuid'] as String?,
ccc: json['ccc'] as String?,
metadata: json['metadata'] == null
@ -128,6 +129,7 @@ Map<String, dynamic> _$$PivStateImplToJson(_$PivStateImpl instance) =>
'derived_key': instance.derivedKey,
'stored_key': instance.storedKey,
'pin_attempts': instance.pinAttempts,
'supports_bio': instance.supportsBio,
'chuid': instance.chuid,
'ccc': instance.ccc,
'metadata': instance.metadata,

View File

@ -36,8 +36,9 @@ class GenerateKeyDialog extends ConsumerStatefulWidget {
final DevicePath devicePath;
final PivState pivState;
final PivSlot pivSlot;
const GenerateKeyDialog(this.devicePath, this.pivState, this.pivSlot,
{super.key});
final bool showMatch;
GenerateKeyDialog(this.devicePath, this.pivState, this.pivSlot, {super.key})
: showMatch = pivSlot.slot != SlotId.cardAuth && pivState.supportsBio;
@override
ConsumerState<ConsumerStatefulWidget> createState() =>
@ -53,6 +54,7 @@ class _GenerateKeyDialogState extends ConsumerState<GenerateKeyDialog> {
late DateTime _validTo;
late DateTime _validToDefault;
late DateTime _validToMax;
late bool _allowMatch;
bool _generating = false;
@override
@ -64,6 +66,8 @@ class _GenerateKeyDialogState extends ConsumerState<GenerateKeyDialog> {
_validToDefault = DateTime.utc(now.year + 1, now.month, now.day);
_validTo = _validToDefault;
_validToMax = DateTime.utc(now.year + 10, now.month, now.day);
_allowMatch = widget.showMatch;
}
@override
@ -117,6 +121,7 @@ class _GenerateKeyDialogState extends ConsumerState<GenerateKeyDialog> {
final result = await pivNotifier.generate(
widget.pivSlot.slot,
_keyType,
pinPolicy: getPinPolicy(widget.pivSlot.slot, _allowMatch),
parameters: switch (_generateType) {
GenerateType.publicKey =>
PivGenerateParameters.publicKey(),
@ -183,7 +188,9 @@ class _GenerateKeyDialogState extends ConsumerState<GenerateKeyDialog> {
l10n.s_options,
style: textTheme.bodyLarge,
),
Text(l10n.p_cert_options_desc),
Text(widget.showMatch
? l10n.p_cert_options_bio_desc
: l10n.p_cert_options_desc),
Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 4.0,
@ -238,6 +245,16 @@ class _GenerateKeyDialogState extends ConsumerState<GenerateKeyDialog> {
}
},
),
if (widget.showMatch)
FilterChip(
label: Text(l10n.s_allow_fingerprint),
selected: _allowMatch,
onSelected: (value) {
setState(() {
_allowMatch = value;
});
},
),
]),
Padding(
padding: const EdgeInsets.symmetric(vertical: 4),

View File

@ -39,9 +39,10 @@ class ImportFileDialog extends ConsumerStatefulWidget {
final PivState pivState;
final PivSlot pivSlot;
final File file;
const ImportFileDialog(
this.devicePath, this.pivState, this.pivSlot, this.file,
{super.key});
final bool showMatch;
ImportFileDialog(this.devicePath, this.pivState, this.pivSlot, this.file,
{super.key})
: showMatch = pivSlot.slot != SlotId.cardAuth && pivState.supportsBio;
@override
ConsumerState<ConsumerStatefulWidget> createState() =>
@ -50,6 +51,7 @@ class ImportFileDialog extends ConsumerStatefulWidget {
class _ImportFileDialogState extends ConsumerState<ImportFileDialog> {
late String _data;
late bool _allowMatch;
PivExamineResult? _state;
String _password = '';
bool _passwordIsWrong = false;
@ -59,6 +61,8 @@ class _ImportFileDialogState extends ConsumerState<ImportFileDialog> {
@override
void initState() {
super.initState();
_allowMatch = widget.showMatch;
_init();
}
@ -214,9 +218,13 @@ class _ImportFileDialogState extends ConsumerState<ImportFileDialog> {
));
await ref
.read(pivSlotsProvider(widget.devicePath).notifier)
.import(widget.pivSlot.slot, _data,
password:
_password.isNotEmpty ? _password : null);
.import(
widget.pivSlot.slot,
_data,
password: _password.isNotEmpty ? _password : null,
pinPolicy: getPinPolicy(
widget.pivSlot.slot, _allowMatch),
);
await withContext(
(context) async {
Navigator.of(context).pop(true);
@ -284,6 +292,16 @@ class _ImportFileDialogState extends ConsumerState<ImportFileDialog> {
),
],
),
if (!unsupportedKey && widget.showMatch)
FilterChip(
label: Text(l10n.s_allow_fingerprint),
selected: _allowMatch,
onSelected: (value) {
setState(() {
_allowMatch = value;
});
},
),
],
if (certInfo != null) ...[
Text(

View File

@ -29,3 +29,13 @@ List<KeyType> getSupportedKeyTypes(Version version, bool isFips) => [
KeyType.eccp256,
KeyType.eccp384,
];
PinPolicy getPinPolicy(SlotId slot, bool match) {
if (match) {
if (slot == SlotId.signature) {
return PinPolicy.matchAlways;
}
return PinPolicy.matchOnce;
}
return PinPolicy.dfault;
}

View File

@ -210,34 +210,34 @@ packages:
dependency: "direct main"
description:
name: crypto
sha256: "1dceb0cf05cb63a7852c11560060e53ec2f182079a16ced6f4395c5b0875baf8"
sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27
url: "https://pub.dev"
source: hosted
version: "3.0.4"
version: "3.0.5"
custom_lint:
dependency: "direct dev"
description:
name: custom_lint
sha256: "7c0aec12df22f9082146c354692056677f1e70bc43471644d1fdb36c6fdda799"
sha256: "4939d89e580c36215e48a7de8fd92f22c79dcc3eb11fda84f3402b3b45aec663"
url: "https://pub.dev"
source: hosted
version: "0.6.4"
version: "0.6.5"
custom_lint_builder:
dependency: "direct dev"
description:
name: custom_lint_builder
sha256: d7dc41e709dde223806660268678be7993559e523eb3164e2a1425fd6f7615a9
sha256: d9e5bb63ed52c1d006f5a1828992ba6de124c27a531e8fba0a31afffa81621b3
url: "https://pub.dev"
source: hosted
version: "0.6.4"
version: "0.6.5"
custom_lint_core:
dependency: transitive
description:
name: custom_lint_core
sha256: a85e8f78f4c52f6c63cdaf8c872eb573db0231dcdf3c3a5906d493c1f8bc20e6
sha256: "4ddbbdaa774265de44c97054dcec058a83d9081d071785ece601e348c18c267d"
url: "https://pub.dev"
source: hosted
version: "0.6.3"
version: "0.6.5"
dart_style:
dependency: transitive
description:
@ -282,10 +282,10 @@ packages:
dependency: "direct main"
description:
name: file_picker
sha256: "1375f8685ca6f0412effecc2db834757e9d0e3e055468053e563794b0755cdcd"
sha256: "167bb619cdddaa10ef2907609feb8a79c16dfa479d3afaf960f8e223f754bf12"
url: "https://pub.dev"
source: hosted
version: "8.1.1"
version: "8.1.2"
fixnum:
dependency: transitive
description:
@ -723,10 +723,10 @@ packages:
dependency: transitive
description:
name: rxdart
sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb"
sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962"
url: "https://pub.dev"
source: hosted
version: "0.27.7"
version: "0.28.0"
screen_retriever:
dependency: "direct main"
description:
@ -739,10 +739,10 @@ packages:
dependency: "direct main"
description:
name: shared_preferences
sha256: c272f9cabca5a81adc9b0894381e9c1def363e980f960fa903c604c471b22f68
sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
version: "2.3.2"
shared_preferences_android:
dependency: transitive
description:
@ -959,10 +959,10 @@ packages:
dependency: transitive
description:
name: url_launcher_android
sha256: f0c73347dfcfa5b3db8bc06e1502668265d39c08f310c29bff4e28eea9699f79
sha256: e35a698ac302dd68e41f73250bd9517fe3ab5fa4f18fe4647a0872db61bacbab
url: "https://pub.dev"
source: hosted
version: "6.3.9"
version: "6.3.10"
url_launcher_ios:
dependency: transitive
description:
@ -1055,10 +1055,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.4"
version: "14.2.5"
watcher:
dependency: transitive
description:
@ -1141,5 +1141,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.5.0-259.0.dev <4.0.0"
flutter: ">=3.22.0"
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.24.0"