Commit Graph

111 Commits

Author SHA1 Message Date
Janek Bevendorff 113c8eb702 Add CLI tests and improve coding style and i18n
The CLI module was lacking unit test coverage and showed some severe
coding style violations, which this patch addresses.

In addition, all uses of qCritical() with untranslatble raw char*
sequences were removed in favor of proper locale strings. These are
written to STDERR through QTextStreams and support output
redirection for testing purposes. With this change, error messages don't
depend on the global Qt logging settings and targets anymore and go
directly to the terminal or into a file if needed.

This patch also fixes a bug discovered during unit test development,
where the extract command would just dump the raw XML contents without
decrypting embedded Salsa20-protected values first, making the XML
export mostly useless, since passwords are scrambled.

Lastly, all CLI commands received a dedicated -h/--help option.
2018-10-19 21:49:54 +02:00
Jonathan White c1e9f45df9 Introduce synchronize merge method
* Create history-based merging that keeps older data in history instead of discarding or deleting it
* Extract merge logic into the Merger class
* Allows special merge behavior
* Improve handling of deletion and changes on groups
* Enable basic change tracking while merging
* Prevent unintended timestamp changes while merging
* Handle differences in timestamp precision
* Introduce comparison operators to allow for more sophisticated comparisons (ignore special properties, ...)
* Introduce Clock class to handle datetime across the app

Merge Strategies:
* Default (use inherited/fallback method)
* Duplicate (duplicate conflicting nodes, apply all deletions)
* KeepLocal (use local values, but apply all deletions)
* KeepRemote (use remote values, but apply all deletions)
* KeepNewer (merge history only)
* Synchronize (merge history, newest value stays on top, apply all deletions)
2018-09-30 09:36:39 -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
Jonathan White 1dc9f10c7f Complete refactor of TOTP integration
* Eliminate TOTP logic from GUI elements
* Consolidate TOTP functionality under the Totp namespace
* Eliminate guessing about state and encoders
* Increased test cases
* Add entry view column for TOTP [#2132]
* General code cleanup, reduction of unnecessary steps, separation of concerns
* Rename SetupTotpDialog to TotpSetupDialog for consistency
2018-09-15 12:10:26 -04:00
Jonathan White ca27fb06d5 Merge branch 'master'
Conflicts:
	INSTALL.md
	release-tool
	src/browser/BrowserOptionDialog.cpp
	src/browser/BrowserService.cpp
	src/browser/BrowserService.h
	src/browser/NativeMessagingBase.h
	src/browser/NativeMessagingHost.h
	src/core/Uuid.cpp
	src/gui/DatabaseTabWidget.cpp
	src/gui/DatabaseWidget.cpp
	src/gui/EditWidget.cpp
	src/gui/MainWindow.cpp
	src/gui/MainWindow.ui
	src/proxy/NativeMessagingHost.h
	src/sshagent/ASN1Key.cpp
2018-08-24 09:42:38 -04:00
Jonathan White 3b1e15ea1a Disable apply button when creating new entry/group
* Workaround to prevent data loss if apply is hit but not OK or Cancel
* Refactor required to fix this issue
2018-08-18 10:31:40 -04:00
louib f25c8d3d2a Adding a GUI test. 2018-04-30 17:07:07 -04:00
Louis-Bertrand Varin 8324d03f0a Formatting the code. 2018-03-31 16:01:30 -04:00
Daniel Wilches 240939ce3b Request confirmation to discard unsaved changes
Solves #1181
2018-03-29 18:35:08 -07:00
Joan Bruguera f305517724 Skip the tray restore/hide test of #1595 if there's no tray (fix CI build). 2018-03-12 21:30:25 +01:00
Joan Bruguera 8646586c1a Add GUI test for issue #1595 (minus the minimize at startup case). 2018-03-12 21:30:25 +01:00
Janek Bevendorff 7fbdcd3fed Add tests for newline sanitization 2018-02-26 17:27:17 +01:00
Janek Bevendorff 698b44f71c Update zxcvbn library 2018-02-21 06:18:33 -05:00
Jonathan White 397d804cdd Add tests & minor edits 2018-02-21 09:04:46 +01:00
Nick Spain 7dfcad6f8f Write regression test for #1447 2018-02-18 16:17:12 +01:00
Jonathan White 8c8a61ddfe Disable auto save for GUI tests 2018-01-28 14:06:17 -05:00
Janek Bevendorff 7a6850d5fe Move useful QTest template specializations to global header file
Fix KDBX test linker errors on Windows
2018-01-24 13:32:37 +01:00
Fonic 8c78aca69e Code cleanup
Comprehensive code cleanup:
- formatting
- comments
- obsolete code
2018-01-21 15:17:05 +01:00
Fonic 66291ecc38 Update GUI test to account for changed column indices
Update clicks within entry view referencing column indices to account
for changed column indices due to new way of showing/hiding column Entry
Model::ParentGroup. This column now has fixed index 0 wether it's shown
or hidden, thus all indices need to be shifted by +1 when not in search
mode
2018-01-21 15:17:05 +01:00
Janek Bevendorff 90380adc90 Fix test compilation errors
* Use legacy AES-KDF mode for KeePass1Reader
2018-01-13 14:25:02 -05:00
Janek Bevendorff 72a1c65d00 Fix memory leaks in tests 2018-01-13 14:24:58 -05:00
Janek Bevendorff ccfd7a065c Fix coding style and GUI test 2018-01-13 14:24:57 -05:00
Jonathan White 7dba788d09 Correct failure in GUI tests due to widget name 2018-01-13 14:24:54 -05:00
Janek Bevendorff 15648991fc Refactor Kdf class, remove fields concept 2018-01-13 14:23:28 -05:00
angelsl 4532108678 Add support for KDFs and cyphers to the db settings widget 2018-01-13 14:23:25 -05:00
frostasm 3720c5ef79 Add test for drag and drop database files into main window 2018-01-03 16:12:05 +02:00
Janek Bevendorff 8651736e61 Merge branch 'release/2.2.3' into develop 2017-11-26 18:23:48 +01:00
thez3ro d6e8e1be6e use QTemporaryFile when creating a database for guitest 2017-11-02 20:07:41 +01:00
thez3ro c3c67f18b8 add test for DB creation 2017-11-02 20:07:41 +01:00
Jonathan White 4e7f2c6a4f Fix apply button not saving new entries 2017-10-28 09:23:45 -04:00
Jonathan White 611a74d74d Added tests to confirm mismatched passwords block saving 2017-09-29 18:11:53 -04:00
Weslly 719323e9c3 Add option to limit search to current group 2017-06-21 01:01:50 -03:00
thez3ro a53b111182 Update and fix copyright headers 2017-06-14 15:54:43 +02:00
Jonathan White 6ffca842e6 Add "Apply" button to entry and group edit windows (#624) 2017-06-13 20:55:53 -04:00
Weslly d3ed14ebb7 Display TOTP code split in halfs 2017-05-03 21:26:08 -03:00
Weslly bf57a28654 Add TOTP support 2017-05-03 20:55:14 -03:00
Jonathan White 5696178de4 Merge pull request #373 from keepassxreboot/feature/new-password-generator
New Diceware passphrase generator
2017-04-09 12:36:56 -04:00
Francois Ferrand 86e88c18b0 More compact search widget
* Move the search icon (with popup menu) and clear icon inside the
line edit
* Move the search widget to the right-side of toolbar
2017-04-06 07:19:56 -04:00
thez3ro be9bd16b4c Add diceware tests 2017-03-22 00:00:23 +01:00
Janek Bevendorff c4d6fa855c Force event processing after adding entries to prevent test failure 2017-03-17 07:49:19 -04:00
thez3ro e3602e3c75 fix regex for placeholders, fix #402, add regression test 2017-03-16 20:32:29 +01:00
Jonathan White 31494ec327 Enhance attribute entry and add protected attributes (#220)
* Allow protected attributes to be hidden
* Entry area is resizable
* Added test cases for protected attributes
2017-03-07 22:38:18 -05:00
Ryan Matthews 97150034bc Fix clone entry gui test 2017-03-04 19:49:33 -05:00
Jonathan White 16ed89c471 Implement ability to clone an entry when in search mode.
* Cloned entries have "- Clone" appended to their name
2017-01-25 20:02:32 -05:00
Akinori MUSHA 6ccae6cc37 Pressing escape quits search 2017-01-25 19:37:53 -05:00
Jonathan White b6f754c29a Changed built-in clear search button with custom one to fix pixelation 2017-01-14 22:29:16 -05:00
Jonathan White 36df21d823 Enhanced search ui keypress actions
* Pressing down arrow will always focus on entry view
* Pressing enter opens currently selected entry
* Pressing CTRL+F focuses and selects search text
* Rewrote test cases to cover the new functionality
2017-01-14 19:47:35 -05:00
Janek Bevendorff ea9f313416 Fix GUI test 2017-01-14 20:33:27 +01:00
Jonathan White 5f1b9a17ca Fix testgui for Windows (PR #137)
Introduces TemporaryFile class to act as a proxy to fix autoreload test cases failing on windows due to the behavior of QTemporaryFile.
2017-01-03 22:27:41 -05:00
thez3ro 298665e32a Improve UI of the search edit #131 2016-12-23 18:13:08 +01:00