Commit Graph
82 Commits
Author SHA1 Message Date
Janek Bevendorff 596d2cf425 Refactor Config.
Replaces all string configuration options with enum types
that can be checked by the compiler. This prevents spelling
errors, in-place configuration definitions, and inconsistent
default values. The default value config getter signature was
removed in favour of consistently and centrally default-initialised
configuration values.

Individual default values were adjusted for better security,
such as the default password length, which was increased from
16 characters to 32.

The already existing config option deprecation map was extended
by a general migration procedure using configuration versioning.

Settings were split into Roaming and Local settings, which
go to their respective AppData locations on Windows.

Fixes #2574
Fixes #2193
2020-05-02 22:30:27 +02:00
Janek Bevendorff b045160e4f Bundle icons using the Qt resource system.
Simplify resource loading logic and enable reproducible builds.
Fixes #2582
2020-03-14 10:13:12 -04:00
Jonathan White fe1189ea79 Enhance Password Editing Fields
* Remove repeat password on entry edit
* Move show/hide password and password generator buttons into the field as actions.
* Register keyboard shortcut Ctrl+H to toggle password visibility
* Register keyboard shortcut Ctrl+G to open the password generator
* Cleanup code and improve interactions between elements
* Simplify Password Generator button layout; convert advanced mode button to toggle button
* Update GUI tests

* Fixes #4120
2020-03-09 18:03:20 -04:00
Jonathan White 6bce5836f9 Fix crash when switching tabs while unlocking 2020-03-07 16:52:24 -05:00
Janek Bevendorff 557736ea5e Add custom light and dark UI themes 2020-03-05 09:24:11 +01:00
Balazs Gyurak c0b1c9e106 Run code formatter 2019-11-23 10:07:39 -05:00
Balazs Gyurak 6c65b486e4 Disable database unlock form while decrypting 2019-11-23 09:56:39 -05:00
Jonathan White 837df4f4cb Fix issues with database unlock
* Fix #3735 - Don't focus on OpenDatabaseWidget fields that are not visible; ensures password field is focused after database lock.

* Fix #3487 - Password input is selected after failed unlock.

* Fix #1938 - Password input is focused after toggling visibility using the keyboard
2019-11-09 00:53:40 +01:00
Janek Bevendorff 5d2766e016 Make the purpose of the key file field clearer.
The new unlock dialogue seems to confuse users
as to what the purpose of the key file is. This
patch changes the generic "Select file..." affordance
to the more explicit "Select key file..." and adds
a help button to the label just like the one we
already have for the hardware key. Furthermore,
it prevents the user from using the KDBX file as its
own key file (since that would never work anyway).

The change breaks existing translations on purpose
(instead of simply adjusting the en_US locale)
in order to force translators to update this string
for their languages.

Resolves #3678
2019-11-07 21:26:56 -05:00
Bernhard Kirchen 8c8c181f73 Hide YubiKey labels on unlock screen when compiled without XC_YUBIKEY (#3664) 2019-10-25 19:35:16 +02:00
Balazs Gyurak f66e9191a9 Fix password visibility button state on database open 2019-06-29 18:39:24 -04:00
Carlos Knippschild bb2d7bca5a Fix build broken by Qt
Updating mingw-w64-x86_64-qt5 to version 5.12.4-2 caused EditEntryWidget to fail
building. Fixed that with proper includes. Also ran `make format` which revealed
one file in need of formatting.
2019-06-25 08:13:27 -04:00
Carlos Knippschild 41b2a013a7 Fix broken build with YubiKey disabled
Remove reference to DatabaseOpenWidget::checkChallengeResponse that was
removed in commit #3287.
2019-06-24 08:58:08 -04:00
Janek Bevendorff 5492b5c4f6 Redesign database unlock widget. (#3287)
With this change we get rid of the confusing key component checkboxes.
Now a component is either there or not (if left empty). There is
no redundant distinction between "unset" and "emtpy" anymore.
For compatibility with older databases that have "empty" passwords,
KeePassXC will ask if the user wants to retry with an empty password
if unlocking failed and the password field was left blank.

Besides these functional changes, the widget's layout has been
rearranged to be more compact, less stretched out (e.g. input fields
do not fill the full window width anymore), and more user-friendly
by providing a help tooltip for the hardware key field and accessible
descriptions for screen readers.
2019-06-22 18:00:31 +02:00
Jonathan White 0201fcd400 Improved error messages when opening database
* Reduced wording and confusion
* Streamlined delivery format
* Fix #813
2019-04-07 19:12:45 -04:00
Janek Bevendorff f49a8a7f70 Fix key component widget initialization and password field echo mode on database open 2019-04-02 00:05:39 +02:00
Jonathan White edef225eab Fix opening files from command line
* Fix #2877 - password is unchecked by default
* Smarter activation of key components based on contents of text entry fields
* Prevent multiple copies of the same database from opening when the canonicalFileName != fileName
2019-03-26 22:23:16 -04:00
Jonathan White bbf678975f Fix TouchID operation after database refactor
* Fix #2720
2019-02-25 18:09:54 -05:00
Jonathan White 7e1b16250c Performed project-wide code formatting
* Updated format CMake command to properly
ignore new directories and files
* Added output when command is run
* Resolves #2623
2019-01-28 22:38:59 -05:00
Gianluca Recchia e81841550b Correct checks for containers' emptiness 2018-11-28 18:29:15 -05:00
Gianluca Recchia fc930bae69 Restore correct formatting
Many lines were not conformant with the project's formatting rules.
This patch should fix all formatting and whitespace issues in the code
base.
A clang-format directive was put around the connect() calls containing
SIGNALs and SLOTs whose signatures would be denormalized because of the
formatting rules.
2018-11-28 18:29:15 -05:00
Janek Bevendorff 785a64cc3b Fix bugs introduced by database refactor #2491 (#2503)
* Fix SSHAgent identity removal on database lock
* Refactor storage and manipulation of SSHAgent keys to streamline process with multiple db's
* Clear password field when widget is hidden, resolves #2502
2018-11-23 07:49:55 -05:00
Janek Bevendorff d612cad09a Refactor Database and Database widgets (#2491)
The Database, DatabaseWidget, and DatabaseTabWidget classes share many responsibilities in inconsistent ways resulting in impenetrable and unmaintainable code and a diverse set of bugs and architecture restrictions. This patch reworks the architecture, responsibilities of, and dependencies between these classes.

The core changes are:

* Move loading and saving logic from widgets into the Database class
* Get rid of the DatabaseManagerStruct and move all the information contained in it into the Database
* Let database objects keep track of modifications and dirty/clean state instead of handing this to external widgets
* Move GUI interactions for loading and saving from the DatabaseTabWidget into the DatabaseWidget (resolves #2494 as a side-effect)
* Heavily clean up DatabaseTabWidget and degrade it to a slightly glorified QTabWidget
* Use QSharedPointers for all Database objects
* Remove the modifiedImmediate signal and replace it with a markAsModified() method
* Implement proper tabName() method instead of reading back titles from GUI widgets (resolves #1389 and its duplicates #2146 #855)
* Fix unwanted AES-KDF downgrade if database uses Argon2 and has CustomData
* Improve code

This patch is also the first major step towards solving issues #476 and #2322.
2018-11-22 11:47:31 +01:00
Gianluca Recchia 0f604aa8c7 Normalize signature of SIGNAL() and SLOT()
See https://stackoverflow.com/q/18091058/6335279
2018-10-31 15:16:04 +01:00
Gianluca Recchia 896a66e6d8 Improve readability and type-safety
Use nullptr instead of 0 or NULL to initialize a null pointer. In some
cases, readability was enhanced by replacing 0 with more meaningful
values according to the type of the pointer being initialized.
2018-10-31 15:16:04 +01:00
Gianluca Recchia 18fd20f898 Remove redundant null-checks for pointer deletion
Deleting a null pointer is defined behavior and results in a no-op at
the assembly level, so it's perfectly safe.
2018-10-31 14:23:06 +01:00
Darwin Shameran 5bf4f51389 Don't obscure password field after invalid password attempt if setting is off (#2353) 2018-10-30 09:16:49 -04:00
Janek Bevendorff e443cde452 Add a new database settings wizard
This patch implements a new database wizard to guide users through the process
of setting up a new database and choosing sane encryption settings.

It also reimplements the master key settings to be more
user-friendly. Users can now add, change, or remove individual composite
key components instead of having to set all components at once. This
avoids confusion about a password being reset if the user only wants to
add a key file.

With these changes comes a major refactor of how database composite keys and key
components are handled. Copying of keys is prohibited and each key
exists only once in memory and is referenced via shared pointers. GUI
components for changing individual keys are encapsulated into separate
classes to be more reusable. The password edit and generator widgets
have also been refactored to be more reusable.
2018-09-25 21:12:47 +02:00
Max Kolhagen d9fcdd2920 Add TouchID support on macOS 2018-09-18 22:42:05 -04:00
seatedscribe c5cd4b6783 Hotfix for #570. Select password locking if an empty password is entered 2018-07-08 19:49:01 -04:00
Louis-Bertrand Varin 8324d03f0a Formatting the code. 2018-03-31 16:01:30 -04:00
Janek Bevendorff e92d5e80ee Merge branch 'release/2.3.2' into develop 2018-03-18 01:14:42 +01:00
Edward Jones 3def6a3bc4 Fix weird base strings and reduce concatenation 2018-03-13 20:40:39 +00:00
Toni Spets d156457405 Always hide password on unlock
Fixes #1692
2018-03-10 23:54:12 -05:00
Janek Bevendorff 871332ecf0 Add warning when using legacy key file formats. 2018-01-14 18:26:28 -05:00
thez3ro cd1e0571a5 forget keyfile path, fix #1151 2017-11-22 22:20:38 +01:00
Janek Bevendorff f6933a8868 Ensure that YubiKey is only polled once, even if showEvent() is called twice 2017-10-24 17:58:27 +02:00
Janek Bevendorff aba2acb062 Use QSharedPointer 2017-10-21 14:19:00 +02:00
Louis-Bertrand Varin a1aad5d165 Using QScopedPointer 2017-10-21 14:19:00 +02:00
Louis-Bertrand Varin 0fe06b3fbb Fix double warning display for database open 2017-10-21 14:19:00 +02:00
Jonathan White 3bc8a79b9b Both slots on Yubikey are now polled for challenge/response 2017-10-09 09:39:47 -04:00
Jonathan White df3051038e Clear database open dialog before and after merging a database (#958) 2017-09-23 11:43:29 -04:00
thez3ro a53b111182 Update and fix copyright headers 2017-06-14 15:54:43 +02:00
Janek Bevendorff 2ff57c2eb7 Coding style fixes 2017-03-10 20:42:59 +01:00
Janek Bevendorff b10cb1c83c Show YubiKey message from MainWindow to ensure it's always shown when a challenge is generated 2017-02-24 17:27:27 +01:00
Janek Bevendorff d6c48a5cf1 Show message when user needs to touch their YubiKey (still buggy when using multiple databases) 2017-02-24 03:25:08 +01:00
Janek Bevendorff 093fe5c7ef Use QSharedPointer instead of cloning YkChallengeResponseKey and make it a QObject to allow emitting signals 2017-02-23 23:52:36 +01:00
Janek Bevendorff e93e4a9931 Allow opening of unprotected databases (but don't allow creating them) 2017-02-21 02:40:23 +01:00
Janek Bevendorff 91761a2bea Only poll YubiKey for currently visible tab 2017-02-21 02:19:11 +01:00
Janek Bevendorff 8e91a89a37 Force at least one encryption key (no more unencrypted databases) 2017-02-21 01:53:57 +01:00