PIV bio additions

Disable dialog buttons when busy.
Show MATCH status in details view.
This commit is contained in:
Dain Nilsson 2024-08-23 17:14:44 +02:00
parent b2c432416e
commit e0c0b2ae2d
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
11 changed files with 32 additions and 11 deletions

View File

@ -500,6 +500,7 @@
} }
}, },
"@_fingerprints": {}, "@_fingerprints": {},
"s_biometrics": null,
"l_fingerprint": "Fingerabdruck: {label}", "l_fingerprint": "Fingerabdruck: {label}",
"@l_fingerprint": { "@l_fingerprint": {
"placeholders": { "placeholders": {

View File

@ -500,6 +500,7 @@
} }
}, },
"@_fingerprints": {}, "@_fingerprints": {},
"s_biometrics": "Biometrics",
"l_fingerprint": "Fingerprint: {label}", "l_fingerprint": "Fingerprint: {label}",
"@l_fingerprint": { "@l_fingerprint": {
"placeholders": { "placeholders": {

View File

@ -500,6 +500,7 @@
} }
}, },
"@_fingerprints": {}, "@_fingerprints": {},
"s_biometrics": null,
"l_fingerprint": "Empreinte digitale\u00a0: {label}", "l_fingerprint": "Empreinte digitale\u00a0: {label}",
"@l_fingerprint": { "@l_fingerprint": {
"placeholders": { "placeholders": {

View File

@ -500,6 +500,7 @@
} }
}, },
"@_fingerprints": {}, "@_fingerprints": {},
"s_biometrics": null,
"l_fingerprint": "指紋:{label}", "l_fingerprint": "指紋:{label}",
"@l_fingerprint": { "@l_fingerprint": {
"placeholders": { "placeholders": {

View File

@ -500,6 +500,7 @@
} }
}, },
"@_fingerprints": {}, "@_fingerprints": {},
"s_biometrics": null,
"l_fingerprint": "Odcisk palca: {label}", "l_fingerprint": "Odcisk palca: {label}",
"@l_fingerprint": { "@l_fingerprint": {
"placeholders": { "placeholders": {

View File

@ -99,6 +99,7 @@ const appListItem95 = Key('$_prefix.95.applistitem');
// SlotMetadata body keys // SlotMetadata body keys
const slotMetadataKeyType = Key('$_prefix.slotMetadata.keyType'); const slotMetadataKeyType = Key('$_prefix.slotMetadata.keyType');
const slotMetadataBiometrics = Key('$_prefix.slotMetadata.biometrics');
// CertInfo body keys // CertInfo body keys
const certInfoKeyType = Key('$_prefix.certInfo.keyType'); const certInfoKeyType = Key('$_prefix.certInfo.keyType');

View File

@ -28,9 +28,10 @@ class CertInfoTable extends ConsumerWidget {
final CertInfo? certInfo; final CertInfo? certInfo;
final SlotMetadata? metadata; final SlotMetadata? metadata;
final bool alwaysIncludePrivate; final bool alwaysIncludePrivate;
final bool supportsBio;
const CertInfoTable(this.certInfo, this.metadata, const CertInfoTable(this.certInfo, this.metadata,
{super.key, this.alwaysIncludePrivate = false}); {super.key, this.alwaysIncludePrivate = false, this.supportsBio = false});
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
@ -46,6 +47,14 @@ class CertInfoTable extends ConsumerWidget {
metadata.keyType.getDisplayName(l10n), metadata.keyType.getDisplayName(l10n),
keys.slotMetadataKeyType keys.slotMetadataKeyType
), ),
if (metadata != null && supportsBio)
l10n.s_biometrics: (
[PinPolicy.matchAlways, PinPolicy.matchOnce]
.contains(metadata.pinPolicy)
? l10n.s_enabled
: l10n.s_disabled,
keys.slotMetadataBiometrics
),
if (metadata == null && alwaysIncludePrivate) if (metadata == null && alwaysIncludePrivate)
l10n.s_private_key: (l10n.s_none, keys.slotMetadataKeyType), l10n.s_private_key: (l10n.s_none, keys.slotMetadataKeyType),
if (certInfo != null) ...{ if (certInfo != null) ...{

View File

@ -249,11 +249,13 @@ class _GenerateKeyDialogState extends ConsumerState<GenerateKeyDialog> {
FilterChip( FilterChip(
label: Text(l10n.s_allow_fingerprint), label: Text(l10n.s_allow_fingerprint),
selected: _allowMatch, selected: _allowMatch,
onSelected: (value) { onSelected: _generating
setState(() { ? null
_allowMatch = value; : (value) {
}); setState(() {
}, _allowMatch = value;
});
},
), ),
]), ]),
Padding( Padding(

View File

@ -315,11 +315,13 @@ class _ImportFileDialogState extends ConsumerState<ImportFileDialog> {
FilterChip( FilterChip(
label: Text(l10n.s_allow_fingerprint), label: Text(l10n.s_allow_fingerprint),
selected: _allowMatch, selected: _allowMatch,
onSelected: (value) { onSelected: _importing
setState(() { ? null
_allowMatch = value; : (value) {
}); setState(() {
}, _allowMatch = value;
});
},
), ),
], ],
] ]

View File

@ -158,6 +158,7 @@ class _PivScreenState extends ConsumerState<PivScreen> {
selected.metadata, selected.metadata,
alwaysIncludePrivate: alwaysIncludePrivate:
pivState.supportsMetadata, pivState.supportsMetadata,
supportsBio: pivState.supportsBio,
), ),
if (selected.certInfo == null) if (selected.certInfo == null)
const SizedBox(height: 16) const SizedBox(height: 16)

View File

@ -98,6 +98,7 @@ class SlotDialog extends ConsumerWidget {
certInfo, certInfo,
metadata, metadata,
alwaysIncludePrivate: pivState.supportsMetadata, alwaysIncludePrivate: pivState.supportsMetadata,
supportsBio: pivState.supportsBio,
), ),
if (certInfo == null) const SizedBox(height: 16), if (certInfo == null) const SizedBox(height: 16),
], ],