Commit Graph

26 Commits (master)

Author SHA1 Message Date
Johan Ouwerkerk d00111edc9 chore: fix typo in debug logging statement 2021-05-03 04:03:24 +00:00
Johan Ouwerkerk ad4308793b fix: show an appropriate error when a provided password fails its challenge
With this change the user now gets appropriate error feedback when trying to unlock their accounts using an incorrect password.

Additionally password entry is temporarily suspended in the UI while key derivation (etc.) is in progress.
This should help convey the idea that "something is happening", or rather avoid the impression that "nothing happens" or "this is broken" when in fact key derivation may simply be slow depending on the machine.
2021-01-20 06:17:48 +00:00
Johan Ouwerkerk 8d1a88b8df fix: make sure to display password setup page again when appropriate
The feature to accept accounts from the command line via otpauth:// URI inadvertently broke the initial password setup flow.
With this change password setup and unlocking should now work correctly again in all cases/flows.

Issues: #14
2020-11-09 19:20:08 +01:00
Johan Ouwerkerk 30e66ef978 refactor: support validating account names without checking account availability
With this change AccountNameValidator can now be used without having a functional Accounts model.
This allows the existing AddAccount page to be re-used for context without a valid Accounts model, e.g. when receiving accounts via URI from the commandline.

Issues: #7, #14
2020-10-27 18:08:31 +01:00
Johan Ouwerkerk d33d2c777d feat: allow QML UI to reset a model::AccountInput object
Being able to reset an account input model to the default state allows for QML UI to safely reuse an account input.
This lets it delegate populating to other code and then finally forward it to other QML code when control returns to the UI.

Issues: #7, #14
2020-10-27 18:08:31 +01:00
Johan Ouwerkerk 420198c49a feat: add basic support for otpauth:// URI parameter model
Add support converting an otpauth:// URI into a model object.
Validation is quite lax and focused on what Keysmith can recover from within the scope of UI/UX for adding accounts via QR codes.

See-Also: https://github.com/google/google-authenticator/wiki/Key-Uri-Format
Issues: #14
2020-10-27 18:08:31 +01:00
Johan Ouwerkerk dadd9d3973 chore: implement fixes suggested by static analysis
These are potentially blocking the basic QR parsing feature from landing.

See-Also: https://invent.kde.org/utilities/keysmith/-/merge_requests/57
2020-10-24 18:57:13 +02:00
Johan Ouwerkerk 17cac143fa refactor: use CONSTANT properties instead of a dummy signal 2020-10-22 03:10:27 +00:00
Johan Ouwerkerk 1736d6c935 fix: reduce memory consumption by re-using AccountView objects. 2020-08-19 17:25:16 +02:00
Johan Ouwerkerk 035bc8be5c refactor: add a way to set raw counter values on validated input model
This change prepares for applying token details from a otpauth URI (QR code)
2020-08-14 20:02:43 +02:00
Johan Ouwerkerk 4f35d2129e fix: const-correctness when setting secret strings on validated input model 2020-08-14 20:02:43 +02:00
Johan Ouwerkerk 668a969d4f refactor: rename unsigned integer parsing function
Make the name for unsigned integer parsing (counter validator) fit better with the new custom datetime validator.
2020-08-08 09:17:55 +02:00
Johan Ouwerkerk 63033b568d refactor: introduce model class to collate validated input from add account forms (flow)
This change prepares the UI for supporting alternative and more complex flows for adding accounts.
All parameters are now collated into a single "validated input" object which is more convenient to pass around between views
This makes it possible to support back- and forth navigation between "basic" and "advanced/details" forms for adding accounts.

Additionally it provides a fundamental building block for adding alternative ways to add accounts (e.g. via OTP token URI/QR code).

Issues: #7
2020-08-08 09:17:55 +02:00
Johan Ouwerkerk 09df98d3a4 refactor: prepare AccountStorage for more complex tokens
With this the AccountStorage module now fully supports some HOTP/TOTP parameters which are uncommon (but still part of HOTP/TOTP specifications).

 - Better types for offset, tokenLength. Make this consistent throughout
 - Finish support for offset, checksum parameters for HOTP tokens in AccountStorage
 - Finish support for hashing algorithm, epoch parameters for TOTP tokens in AccountStorage
 - Better API for creating oath::Algorithm instances
 - Code formatting (break up long lines)

Issues: #7
2020-08-08 09:17:55 +02:00
Johan Ouwerkerk 456cd658e5 fix: make sure to actually return a null-valued QVariant() if the role is wrong
Improve the code flow a little while at it.
2020-07-23 18:24:13 +02:00
Johan Ouwerkerk 0d40912360 feat: Add basic support for account 'issuer' in Keysmith.
With this change account storage and model work with accounts for which an issuer is recorded.
This is a prerequisite for fully supporting otpauth:// URIs (necessary for QR code support) in Keysmith.

Issues: #7, #13
See-Also: https://github.com/google/google-authenticator/wiki/Key-Uri-Format
2020-07-23 18:24:13 +02:00
Johan Ouwerkerk 3f100d4530 Minor code cleanups in src/model 2020-06-11 07:28:16 +00:00
Johan Ouwerkerk 532f606142 Make sure to sort entries by account (name) in the overview list. 2020-05-31 16:44:04 +02:00
Johan Ouwerkerk f83b77eee8 Add loaded/error properties to account list model
This change provides a property API on top of the low level state tracking
performed in AccountStorage.
2020-04-24 18:05:05 +02:00
Johan Ouwerkerk f16eba4505 Plumbing for asking for passwords from QML
This change introduces a model to signal the UI what password "scenario" is
applicable and provides the necessary plumbing to expose it QML.
2020-04-23 18:59:17 +02:00
Johan Ouwerkerk f4bacefb10 Remove unused QtDebug header 2020-04-19 19:59:24 +02:00
Johan Ouwerkerk f04b15340f Fix TODO items about logging for C++ code 2020-04-14 19:45:29 +02:00
Johan Ouwerkerk b451bd2556 Fix up licensing for REUSE compliance.
This adds licensing and copyright information where missing and normalises
existing licensing/copyright statements to SPDX metadata tags.
2020-04-10 13:34:31 +02:00
Johan Ouwerkerk 2a9c80fff5 Add a custom validator that checks if the name is still available. 2020-04-04 10:51:39 +02:00
Yuri Chornoivan 112b4bdf8b Fix minor typos 2020-02-13 20:27:57 +02:00
Johan Ouwerkerk a813810dfe Rewrite Account model(s) as a separate (sub)module within Keysmith, layered on top of the new Account (storage) module.
This fixes the model part in issue #2
2020-01-28 06:49:06 +00:00