This commit is contained in:
Dain Nilsson 2022-09-15 11:45:12 +02:00
commit 252e4a5a93
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
6 changed files with 20 additions and 10 deletions

View File

@ -63,7 +63,7 @@ class OathManager(
startTimeMs = currentTimeMs
// cancel any pending actions, except for addToAny
if(!addToAny) {
if (!addToAny) {
pendingAction?.let {
Log.d(TAG, "Cancelling pending action/closing nfc dialog.")
it.invoke(Result.failure(CancellationException()))
@ -213,7 +213,7 @@ class OathManager(
// Awaiting an action for a different or no device?
pendingAction?.let { action ->
pendingAction = null
if(addToAny) {
if (addToAny) {
// Special "add to any YubiKey" action, process
addToAny = false
action.invoke(Result.success(oath))
@ -281,8 +281,12 @@ class OathManager(
CredentialData.parseUri(URI.create(uri))
addToAny = true
return useOathSessionNfc("Add account") { session ->
val credential = session.putCredential(credentialData, requireTouch)
// We need to check for duplicates here since we haven't yet read the credentials
if (session.credentials.any { it.id.contentEquals(credentialData.id) }) {
throw Exception("A credential with this ID already exists!")
}
val credential = session.putCredential(credentialData, requireTouch)
val code =
if (credentialData.oathType == OathType.TOTP && !requireTouch) {
// recalculate the code

View File

@ -31,11 +31,11 @@ VSVersionInfo(
'040904b0',
[StringStruct('CompanyName', 'Yubico'),
StringStruct('FileDescription', 'Yubico Authenticator Helper'),
StringStruct('FileVersion', '6.0.0-dev.0'),
StringStruct('FileVersion', '6.0.0-beta.2'),
StringStruct('LegalCopyright', 'Copyright (c) 2022 Yubico AB'),
StringStruct('OriginalFilename', 'authenticator-helper.exe'),
StringStruct('ProductName', 'Yubico Authenticator'),
StringStruct('ProductVersion', '6.0.0-dev.0')])
StringStruct('ProductVersion', '6.0.0-beta.2')])
]),
VarFileInfo([VarStruct('Translation', [1033, 1200])])
]

View File

@ -69,6 +69,7 @@ class _OathAddAccountPageState extends ConsumerState<OathAddAccountPage> {
bool _isObscure = true;
List<int> _periodValues = [20, 30, 45, 60];
List<int> _digitsValues = [6, 8];
List<OathCredential>? _credentials;
@override
void dispose() {
@ -205,8 +206,13 @@ class _OathAddAccountPageState extends ConsumerState<OathAddAccountPage> {
oathState = ref
.watch(oathStateProvider(deviceNode.path))
.maybeWhen(data: (data) => data, orElse: () => null);
_credentials = ref
.watch(credentialListProvider(deviceNode.path))
?.map((e) => e.credential)
.toList();
} else {
oathState = widget.state;
_credentials = widget.credentials;
}
final otpauthUri = _otpauthUri;
@ -254,7 +260,7 @@ class _OathAddAccountPageState extends ConsumerState<OathAddAccountPage> {
final secretLengthValid = secret.length * 5 % 8 < 5;
// is this credentials name/issuer pair different from all other?
final isUnique = widget.credentials
final isUnique = _credentials
?.where((element) =>
element.name == _accountController.text.trim() &&
(element.issuer ?? '') == _issuerController.text.trim())

View File

@ -1,5 +1,5 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// This file is generated by running ./set-version.py <version> <build>
const String version = '6.0.0-dev.0';
const int build = 59900;
const String version = '6.0.0-beta.2';
const int build = 59901;

View File

@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# This field is updated by running ./set-version.py <version>
# DO NOT MANUALLY EDIT THIS!
version: 6.0.0+59900
version: 6.0.0+59901
environment:
sdk: ">=2.17.0 <3.0.0"

View File

@ -1,4 +1,4 @@
$version=6.0.0-dev.0
$version=6.0.0-beta.2
echo "Renaming the Actions folder and moving it"
mv yubioath-desktop-* release