Commit Graph

2780 Commits

Author SHA1 Message Date
Jonathan White
4ff781fa48 Version Bump and Deployment Fixes
* Use KeePassXC executable icon for the start menu shortcut on Windows to prevent the icon from being deleted on installation of a new version. Fixes #4226

* Support improvements to windeployqt in Qt 5.14.1+
2020-03-14 09:48:15 -04:00
Benedikt Rascher-Friesenhausen
b2c2f42f30 Allow defining additional characters for the password generator
See issue #3271 for a motivation of this feature.

This patch adds an additional text input to the advanced view of the password generator.  All characters of this input field (if not empty) will be added as another group to the password generator.  The characters from the excluded field have precedence over the characters from this new field, meaning any character added to both fields will *not* appear in any generated password.  As the
characters from this new field will be added as their own group to the password generator, checking the 'Include characters from every group' checkbox will
force at least character to be chosen from the new input field.

The `PasswordGenerator` class has also been changed so that the `isValid` method returns `true` if only characters from the new input field would be used.

There is a new, simple test that covers the new feature.  While the test only uses ASCII characters, any Unicode characters can be used with the new feature.
2020-03-09 23:35:55 -04:00
Toni Spets
dce9af219f SSH Agent: Integration tests against ssh-agent
Windows testing is currently explicitly disabled due to too many different scenarios to run an agent and MSYS2 having its own.
2020-03-09 23:09:28 -04:00
Aetf
2359742de1 FdoSecrets: only enable the settings page when there is actually a service instance
* Fix #4311
2020-03-09 23:09:12 -04:00
Balazs Gyurak
8ae718b747 Ignore focus when checking toolbar state
* Support copy shortcut when in QTextEdit to prevent inadvertently copying password when interacting with those elements.
2020-03-09 23:08:43 -04:00
Jonathan White
fb5173cebd Remove inline password generator when editing entries
* Always use a pop-up generator to avoid cluttering the user interface and making it clear that a password is being created
2020-03-09 18:03:20 -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
1d7ef5d4eb Move theme detection into Application
* Add function to Application to quickly determine if in light or dark theme
* Add kpxcApp symbol
* Explicitly define main function for GUI tests to improve performance and use custom Application.
2020-03-09 18:03:20 -04:00
Jonathan White
a8c02fdc3c Move database open to async task
* Wrap key transformation in AsyncTask when reading a database. Significantly reduces user interface lockup.
* Replace root group with new group instead of deleting the pointer (fulfills member validity promise).
2020-03-07 16:52:24 -05:00
Jonathan White
91c6e436b3 Dynamically determine database validity
* Check that the database composite key exists, has sub-keys associated with it, and the root group exists.
2020-03-07 16:52:24 -05:00
Jonathan White
7ac292e09b Fix crashes on database save
* Add saving mutex to database class to prevent re-entrant saving
* Prevent saving multiple times to the same file if the database is not marked as modified
* Prevent locking the database while saving. This also prevents closing the application and database tab while saving.
* FileWatcher: only perform async checksum calculations when triggered by timer (prevents random GUI freezes)
* Re-attempt database lock when requested during save operation
* Prevent database tabs from closing before all databases are locked on quit
2020-03-07 16:52:24 -05:00
Jonathan White
6bce5836f9 Fix crash when switching tabs while unlocking 2020-03-07 16:52:24 -05:00
varjolintu
e6186b07e1 Add Created column to Browser Integration at Database settings 2020-03-07 10:05:06 -05:00
Timo Ulich
a6c3c118a7 Add the name of the group to the results for browser extensions
Fixes #466

So it can be displayed in the autocomplete list when more than
one login matches. For users that use groups and have similar names
for multiple logins but organized in different groups
2020-03-07 08:30:17 -05:00
Andrew Meyer
ca471e9986 Display database path in root group tooltip
When mousing over the root group entry, show the file path for the current database.

Fixes #4038
2020-03-07 08:29:53 -05:00
Jonathan White
50e52df04b Fix issues with PopupHelpWidget on Linux and macOS
* Clean up parent alignment code
* Don't hide widget if it currently has focus
* Use Qt::Tool window type on macOS as well. This prevents the popup help from hiding to the background if the main window has focus.
* Fixes #2814
2020-03-05 22:55:49 -05:00
Jonathan White
e26063a872 Fix compile errors when building snap package
* System icons are no longer used eliminating the need to differentiate behavior for the snap package on Linux.
2020-03-05 22:09:29 -05:00
Janek Bevendorff
557736ea5e Add custom light and dark UI themes 2020-03-05 09:24:11 +01:00
Janek Bevendorff
6d2ca74878 Add OSUtils for platform-specific functionality.
Moves MacUtils into a separate sub folder and adds
WinUtils, NixUtils, and OSUtils for platform-native
code on Windows, Unix-like, and generic/all systems.
2020-03-05 09:24:11 +01:00
Michal Suchanek
b9daed2055 Correct issues with hiding and minimizing the MainWindow
The GUI features depend on windowing system used, not just OS.

There is an issue with the WM sometimes producing an event that keepassxc interprets as request to hide the main window just after it is shown. A workaround with immediately firing a timer was implemented. However, there is no guarantee on execution ordering of the timer callback and other application code. Remove the timer and override
show() and hide() on main window to only hide if the window has not been shown recently.

The user can set an option to hide window instead of minimizing when tray icon is enabled. This is not honored in most places where the main windows is minimized. Fix it. This also allows using the tray icon as a workaround for minimization not working under some circumstances in X11.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2020-02-27 23:25:44 -05:00
Jonathan White
eb88b8cc0c Fix clearing search field when using application
* Reset clear timer when manipulating the entry view and opening/closing entries
* Only start the clear timer if there is an active search
2020-02-27 21:22:11 -05:00
Ojas Anand
b188385184
Return keyboard focus after saving database edits (#4287) 2020-02-27 21:21:27 -05:00
Jonathan White
409190c85a
Correct issues with building new SSH Agent fixes 2020-02-23 22:51:18 -05:00
Toni Spets
40ad211f3e Allow toggling SSH Agent integration without restart
- use Q_GLOBAL_STATIC for singleton
- move all configuration to SSHAgent class
- various cleanups to agent code

Fixes #1196
2020-02-23 09:19:34 -05:00
Toni Spets
cb6b0dde27 Fix hiding entry edit pages
Fixes regression caused by 9477437256
2020-02-23 09:19:34 -05:00
varjolintu
9f3516a4da Icon downloader button list check 2020-02-20 20:38:07 +02:00
varjolintu
8dbd5b11eb Code format 2020-02-09 11:28:47 -05:00
varjolintu
8dba308d54 Do not add duplicate entries 2020-02-09 11:28:47 -05:00
humanoid
f227a2d529 Fix browser-like DbTab experience on macOS and Windows
* macOS and Windows browsers do not use `Alt+#` to change tabs. Windows uses `Ctrl` and macOS uses `Command`. Linux uses `Alt`.
* Remove shortcut for `Key+0` and assign `Key+9` as last tab selection
* Streamline tab selection code in MainWindow
2020-02-09 11:09:45 -05:00
Carlo Teubner
f62e0534a2 Fixes for minor issues found by static analysis
Mostly style issues.

I used the following tools to find most of these:

- lgtm.com
- clang-tidy
- cpplint
- cppcheck
2020-02-02 08:46:58 -05:00
Jonathan White
c663b5d5fc Add braces around single line statements
* Ran clang-tidy with "readability-braces-around-statements" to find missing braces around statements.
2020-02-02 08:46:18 -05:00
Wolfram Rösler
c427000184 Remove result cache from the HealthChecker class
The way the class is currently being used, the cache never does
anything (because evaluate is never invoked twice for the same
entry), so according to YAGNI it has to go.

Fixes #551
2020-02-01 09:30:12 -05:00
Wolfram Rösler
a81c6469a8 Implement Password Health Report
Introduce a password health check to the application that evaluates every entry in a database. Entries that fail  various tests are listed for user review and action. Also moves the statistics panel to the new Database -> Reports  widget. Recycled entries are excluded from the results.

We now have two classes, PasswordHealth to deal with a single password and HealthChecker to deal with all passwords of a database.

Tests include passwords that are expired, re-used, and weak.

* Closes #551

* Move zxcvbn usage to a centralized class (PasswordHealth)  and replace its usages across the application to ensure standardized interpretation of entropy calculations.

* Add new icons for the database reports view

* Updated the demo database to show off the reports
2020-02-01 09:30:12 -05:00
James Ring
71a39c37ec
Add --username option to Clip command. (#3947)
* make Clip accept an attribute name

This allows users to copy arbitrary attributes (e.g. username, notes,
URL) to the clipboard in addition to the password and TOTP values.

* update Clip manpage

* Add findAttributes to CLI utils

* Use case-insensitive search in Show command.

* Use case-insensitive search in Clip command.

Co-authored-by: louib <L0U13@protonmail.com>
2020-01-30 15:46:48 -05:00
Balazs Gyurak
06e0f38523 CLI: Fix XML encoding when export database
Add write function to TextStream
Fix #3900
2020-01-29 20:51:53 -05:00
Aetf
792c1c94f7 FdoSecrets: check and show PID and executable for existing secret service process 2020-01-29 19:20:55 -05:00
Jonathan White
0383aa104c Improvements to confirm access dialog
* Disable access to entries immediately within the dialog
* Use checkboxes instead of row selection
* Add button to deny all access immediately
2020-01-29 19:20:31 -05:00
Wolfram Rösler
97b034dbcb Ignore system icon theme, always use our own icons
With the Material Design icons, any other icons brought in through
the system icon theme will look inconsistent.

Also remove the KEEPASSXC_IGNORE_ICON_THEME environment variable
(which was introduced during development of the new icons to
disable the system icon theme and is thus no longer needed).

Fixes #475
2020-01-29 19:18:54 -05:00
James Ring
94b45ea16f
Use db-create as Create::name (#4263)
Fixes a name mismatch introduced in
b78ca924fd.
2020-01-29 15:18:48 -05:00
louib
0b6d9cb472 CLI: set decryption time on create.
Added an option to set the target decryption time on database creation
for the CLI create command. This required some refactoring, in
particular the extraction of the min, max and defaut decryption times in
the `Kdf` module. Some work was done to allow changing those constant
only in the `Kdf` module, should we ever want to change them.
2020-01-27 23:00:34 -05:00
Jonathan White
a41c26e9cd Cleanup UI files
Removes unnecessary &amp; from strings in settings widgets. These cause confusion and complicate translation. They are unnecessary as all dialogs allow efficient tabbing between elements.

Also add colons after several settings with input boxes and remove a hard stop.

Improve wording of strings based on translator feedback.

Fix case sensitive matching of CLI Export.
2020-01-27 22:58:19 -05:00
Toni Spets
4dee16c9fa SSH Agent: SSH_AUTH_SOCK override and conn test
Fixes #3795
2020-01-27 22:57:57 -05:00
Toni Spets
6fc7be78ea Implement SSH key file path env substitution
Supports all platforms, including Windows with %FOO% syntax.

Fixes #3523
2020-01-27 22:57:31 -05:00
Jonathan White
91755fa83a
Fix compile error on certain platforms 2020-01-27 20:49:52 -05:00
JulianVolodia
06e5f19fab Enable browser-like DbTab experience (Alt + Nums)
* Pressing ALT+1-9 goes to 1-9 tab
* Pressing ALT+0 goes to the last tab
2020-01-27 17:55:35 -05:00
Toni Spets
e24a858f39 SSH Agent: Refactor entry and agent key management
- Remove duplicate code to load a key (EditEntryWidget & SSHAgent)
 - Refactor all key loading and saving to KeeAgentSettings
 - Depend only on Entry to allow future CLI expansion
2020-01-27 17:40:02 -05:00
louib
c97ee5395b Small cleanup in cli/Show.cpp 2020-01-26 23:50:53 -05:00
louib
b78ca924fd Adding db-info CLI command. (#4231)
This adds a basic db-show CLI command, to display
the information related to a database.
2020-01-26 23:44:31 -05:00
louib
c8ab3b5f4f Removing QColor (from Qt::Widgets) from core modules. (#4247) 2020-01-26 21:38:43 -05:00
Kjell Braden
6ff3e8801d retrieve login1 session object from manager (#3339) 2020-01-25 09:56:16 -05:00
Andrey Izman
796b5ceacb Fix closing tag typo 2020-01-22 17:31:46 -05:00
louib
b34a8f9d94 Use stderr for help text on error.
Also not sure why qCritical was used instead of and stderr output
stream. Added translation on the invalid command string.
2020-01-20 16:15:08 -05:00
Janek Bevendorff
b2fd7f6d54
Merge branch 'master' into develop 2020-01-19 21:44:25 +01:00
Jonathan White
dc37537797 Prevent proxy host from blocking application shutdown
* Fix #4079 - proxy host would get stuck trying to read characters from stdin. Switch to "readsome" which does not block if there are not enough characters to read. Added a longer delay to slow the checking loop down.
2020-01-19 18:13:43 +01:00
varjolintu
08a911466e Simplify the comparison 2020-01-19 18:13:12 +01:00
varjolintu
d2e76058cd Fix base domain matching 2020-01-19 18:13:12 +01:00
Jonathan White
6f9907a3cb Fix clearing clipboad on Gnome
* Prefer clearing clipboard by explicitly setting the clipboard to an empty string. Qt's QClipboard::clear() method is unreliable under X11 environment.

* Fixes #4126
2020-01-16 10:54:04 -05:00
Jonathan White
0d3eb047c7 Prevent crash when all entries are deleted from a group
* Fix #4093 - The first entry in the list is selected after deleting an entry
* Prevents crashes due to dangling pointers held by the Entry Preview Widget when entries were deleted.
* Improve GUI tests to ensure this new behavior occurs.
2020-01-16 10:53:41 -05:00
varjolintu
6cde2b83e8 Add support for Microsoft Edge browser 2020-01-16 10:53:02 -05:00
Jonathan White
9da07f2f66 Don't mark cmd:// urls as invalid
* Due to the complexity of cmd:// type url's, avoid trying to parse them for validity once the initial scheme is entered.

* Fixes #4138
2020-01-13 15:29:02 -05:00
varjolintu
460732097c Add empty path to URL when needed 2020-01-12 18:43:02 -05:00
Wolfram Rösler
84e3925e7b Remove "Create new database" from tool bar
It's used extremely rarely, having it in such a prominent position
in the tool bar isn't justified. Also, with the Material Design
icons, its tool bar icon can easily be confused with "create new
entry".

Fixes #475
2020-01-11 19:00:15 +01:00
Wolfram Rösler
05ef937e92 Use Qt::AA_UseHighDpiPixmaps on all platforms
... not only on Linux, in order to prevent icons from being fuzzy.

Fixes #475
2020-01-11 19:00:15 +01:00
Wolfram Rösler
2ca8dbebea Show dark KeePassXC icon in the system tray menu
for the "Toggle Window" menu item. It matches the other
(Material Design) icons much better than the colored
icon.

Fixes #475
2020-01-11 19:00:15 +01:00
Wolfram Rösler
36f92b7649 Replace application icons with Material Design icons.
Use the following to run KeePassXC with the icons from the
source code, ignoring the operating system's Qt icon theme:

```
KEEPASSXC_IGNORE_ICON_THEME=1 keepassxc
```

The patch further adds a script `makeicons.sh` that re-creates KeePassXC
icons from the Material Design icon set and can be used for easily
updating icons in the future. Instructions are in the script.

Fixes #475
2020-01-11 19:00:15 +01:00
Janek Bevendorff
470838f21c
Merge branch 'release/2.5.3' into develop 2020-01-11 18:28:44 +01:00
Janek Bevendorff
247ebf5a35 Ensure challenge-response key buffer is properly cleared.
The challenge-response key buffer is explicitly cleared
before the key transformation if no such key is configured
to ensure one is never injected into the hash even if the
database had a challenge-response key previously.

This patch also adds extensive tests for verifying that a
key change will not add any expired key material to the hash.

Fixes #4146
2020-01-11 11:16:03 +01:00
Jonathan White
cba8947ee8 Prevent unnecessary merge requests on intermittent network shares
* Fixes #4118
2020-01-10 20:10:35 -05:00
Jonathan White
39a7ce58b9 Prevent crash if Auto-Type performed on new entry
* Check that entry's group is not nullptr
* Fixes #3967
2020-01-10 14:04:57 +01:00
Jonathan White
3fdafc6d25 Prevent crash if Auto-Type performed on new entry
* Check that entry's group is not nullptr
* Fixes #3967
2020-01-09 14:21:22 +01:00
Jonathan White
8ded3bdba2 Merge branch 'master' into develop 2020-01-04 09:10:25 -05:00
Jonathan White
7250fd9313 Fix TOTP Dialog not closing on lock 2020-01-03 18:08:24 -05:00
Jonathan White
181ad76ec9 Use new TOTP structure when importing 1Password Vault
* Fixes #3999
2020-01-03 18:08:24 -05:00
Jonathan White
9ab531473a Fix AutoOpen with key file only databases
* Fixes #3931
2020-01-03 18:08:24 -05:00
Jonathan White
87af012a97 Hide snap browser warning label on non-Linux OS
* Fixes #3707
2020-01-03 18:08:24 -05:00
Jonathan White
db032831e0 Choose a better monospace font on macOS
* Fixes #1917
2020-01-03 18:08:24 -05:00
Jonathan White
2a51f2cba5 Fix compiler issues with Qt 5.14
* Remove deprecation warnings when not doing a DEV_BUILD. Qt 5.14 introduced several deprecation flags on basic function calls in QList and QSet that would require several #pragma ignores. Assuming this was in preparation to Qt 6.0.

* Remove unnecessary assert in PasswordEditWidget that was hit in macOS debug builds.
2020-01-03 18:08:24 -05:00
Aetf
adb29dd0e4 FdoSecrets: only emit completed signal when the action actually finishes 2020-01-02 08:05:11 -05:00
Aetf
af14929af1 FdoSecrets: fix searching of entries with special characters in attributes 2020-01-02 08:04:42 -05:00
Peifeng Yu
3ffeab4c41 FdoSecrets: fix all exposed entries are returned if search with empty terms 2019-12-27 23:20:45 -05:00
Jonathan White
2fab4d576a Merge branch 'release/2.5.2' into develop 2019-12-27 19:38:44 -05:00
Aetf
90cdfc4a6d FdoSecrets: fix service not registered if start with the plugin enabled 2019-12-27 18:47:24 -05:00
Aetf
12efb281f8 FdoSecrets: fix when exposing groups, the root group is considered in recycle bin 2019-12-27 18:47:24 -05:00
Aetf
98ff9f1e77 FdoSecrets: cleanup all connections when database is replaced due to locking, fix #4004 2019-12-27 18:47:24 -05:00
Aetf
1ae7e72aa8 FdoSecrets: remove half created entries if the creation fails 2019-12-27 18:47:24 -05:00
Aetf
a518f4306d FdoSecrets: UI improvements
- Use proper model for database and session in settings page
- Fix button text (unlock/lock) not changed according to the database locking status
- Fix button icons not present on icon themes other than Breeze
- Fix the disconnect button may got clipped when new session opens
2019-12-27 18:47:24 -05:00
Wizz
0654ffc117 CLI: Fix keyfile from/to parameter collision in merge command
Rename 'k' to 'f' because 'k' is already used to specify the key for the target database of the merge

* Remove short -f option from keepassxc-cli.1
* Remove -f option from keepassxc-cli merge
* Add test cases covering cli options for merge
* Add functional test for merge with keys
2019-12-21 17:39:50 -05:00
varjolintu
c0796d8fb1 Add option to use entry only for HTTP Basic Auth 2019-12-21 17:28:27 -05:00
James Ring
26afdb39d3 Fix crash upon exiting interactive mode if there is no current database. 2019-12-21 10:09:22 -05:00
Chih-Hsuan Yen
794cc1eeab Partial fix for building on Mac OS X < 10.12
This commit reverts #3357.

The previous PR is for the new symbol NSEventMaskKeyDown, which is
introduced in #3347. In #3794, #3347 is reverted, so the workaround
in #3357 is no longer needed. Furthermore, it causes build failures
on 10.11 (#3932) as the header file for type NSEventMask is removed
in #3794, too.

Note that this is not a complete fix. A complete patch can be found
at [1]. In MacPorts, the OS version for building a package is the same
as the OS that installs it, so #ifdef can be used to replace @available.
The latter language feature is not available until Xcode 9.

With the patch mentioned in the previous paragraph, KeePassXC 2.5.1
can be built on Mac OS X 10.9 or newer.

Ref: #2899

[1] de1bb703ad/security/KeePassXC/files/patch-old-mac.diff
2019-12-21 09:25:56 -05:00
Carlo Teubner
c70ebe6dce Fix memory leaks (mostly) in tests (#3922)
This makes most tests run successfully with asan.

The GUI tests still have a bunch of leaks, some from library code, and
some that look real but which I didn't immediately manage to figure out.

* TestOpVaultReader: use QSharedPointer
2019-12-21 09:25:17 -05:00
varjolintu
c0f29cc790 Show UI warning for invalid URLs 2019-12-21 09:22:16 -05:00
varjolintu
663393d994 Remove extra check for additional URLs 2019-12-20 22:17:30 -05:00
Jonathan White
ed0b76813d Merge branch 'release/2.5.2' into develop 2019-12-15 00:11:02 -05:00
Jonathan White
8e76c30dd1 Prevent reloading database while editing an entry or group
* Fix #3933 and  fix #3857. Interaction with entries and groups is disabled while the database is being reloaded or saved to prevent changes from occurring. Prevent the database from being reloading if an entry or group is currently being edited.

* Fix #3941 - Only notify components when the database file actually changes (determined by checksum). This prevents spurious merge requests when the file is merely touched by another service (e.g., DropBox).

* Fix code format of ElidedLabel.cpp
2019-12-14 21:26:12 -05:00
Jonathan White
f9cb2bd5df Correct multiple issues with database saving
* Mark the database as clean after fully completing the file save operation INSTEAD of when merely writing the database to a file.

* Stop the modified timer when marking the database as clean, this prevents latent erroneous modified signals from being emitted.

* Do not restart the modified timer after a new change is detected while it is still running.
2019-12-14 21:26:12 -05:00
Jonathan White
7b95867378 Code format fixes 2019-11-29 13:45:14 -05:00
Aetf
6dd9702b79 FdoSecrets: handle the exposed group being moved to recycle bin 2019-11-29 08:37:19 -05:00
Balazs Gyurak
9363123047 Add ability to hide a protected attribute after reveal 2019-11-23 10:07:39 -05:00
Balazs Gyurak
c0b1c9e106 Run code formatter 2019-11-23 10:07:39 -05:00
Carlo Teubner
cb28329f14 Fix typos in various .md files 2019-11-23 09:56:59 -05:00
Balazs Gyurak
6c65b486e4 Disable database unlock form while decrypting 2019-11-23 09:56:39 -05:00
Jonathan White
dc6c9186c9 Fix start minimized to tray for unix 2019-11-23 09:53:40 -05:00
Balazs Gyurak
ed60a3dcce HTML encode url in ElidedLabel
* Fix #3905 - prevent double quotes and other invalid HTML characters from impeding on display of url in ElidedLabel
2019-11-23 09:50:22 -05:00
Balazs Gyurak
5c54dfe581 Release database before exiting CLI interactive mode 2019-11-23 08:18:59 -05:00
Balazs Gyurak
697f265249 Correctly initialize standalone PW generator mode 2019-11-23 08:18:51 -05:00
Balazs Gyurak
024e00cc97 Only show warning about snap browsers on Linux 2019-11-23 08:15:58 -05:00
Balazs Gyurak
dc42d5dda6 Release database before exiting CLI interactive mode 2019-11-23 08:15:18 -05:00
Balazs Gyurak
56a5a129c6 Correctly initialize standalone PW generator mode 2019-11-23 08:13:59 -05:00
Aetf
a66f8ec04d FdoSecrets: fix crash when enabling the plugin on a non-exposed database 2019-11-23 07:58:39 -05:00
varjolintu
e2c95f75f1 Fix subdomain matching 2019-11-23 07:53:09 -05:00
Sergey Vilgelm
a590289900 Add a new line after in Analyze command
Adding a new line after the message "Evaluating database entries against HIBP file, this will take a while..." helps
to separate a report and the comment.
2019-11-17 22:42:39 -05:00
Sergey Vilgelm
39af47fbf9 Add a new line after in Analyze command
Adding a new line after the message "Evaluating database entries against HIBP file, this will take a while..." helps
to separate a report and the comment.
2019-11-15 10:50:01 -05:00
varjolintu
3d0964bce9 Fix URL matching 2019-11-10 08:43:10 -05:00
dxdc
4437e6a609 Encode trailing equal signs from base32 TOTP key
Fixes #3255
2019-11-10 08:42:50 -05:00
Jonathan White
a07bae2530 Correct formatting of preview widget fields (#3727)
* Fix #3701 - replace QLabel with QTextEdit to enable scrolling of notes

* Notes are plain text. They will remain as plain text and hyperlinks will not be enabled in the notes. Until the notes editor is moved to a rich text / html editor this will remain the case.

* Convert username and password fields in preview pane to QLineEdit's to allow for full copying and viewing if larger than the field width.
2019-11-09 18:16:05 +01:00
Janek Bevendorff
29ca08f9ff Fix DatabaseUnlockDialog window sizing.
Fixes the default shrink-wrap and wonky upscaling
behaviour of the DatabaseUnlockDialog window.
2019-11-09 10:00:34 -05:00
Jonathan White
d3978980d2 Perform file hash checks asynchronously (#3815) 2019-11-09 14:02:34 +01:00
Jonathan White
7ba9fcc0e5 macOS: Check for Auto-Type permissions on use instead of at launch
* Fix #3689 - link the use of Auto-Type with the permissions required to use it
2019-11-09 13:53:44 +01:00
Jonathan White
440331d319 Revert "Remove Carbon from Mac Auto-Type (#3347)"
This reverts commit ce1f19cacc.
2019-11-09 13:53:44 +01:00
Jonathan White
035823e414 Hide Auto-Type sequences column when unnecessary
* Fix #3688 - hide the sequences column if all of the entry matches return the same sequence. This cleans up redundent data in the Auto-Type selection dialog introduced in 2.5.0.
2019-11-09 13:53:44 +01:00
Janek Bevendorff
5996ba51c9 Use PasswordKey for storing transformed secrets.
The transformed secrets were stored in normal QByteArrays,
which are at risk of being swapped out. We now use secure
PasswordKey objects instead. There are still a few areas
where QByteArrays are used for storing secrets, but since
they are all temporary, they are less critical. It may be
worth hunting those down as well, though.
2019-11-09 11:33:32 +01:00
Janek Bevendorff
22af66e3b5 Ensure database contents are released right away.
When we lock a database, we reset the database pointer to
free its resources. Since various other widgets besides the
DatabaseWidget hold references to the shared pointer object,
however, it cannot be guaranteed that the actual database
object will be freed right away. This patch adds a releaseData()
method which is called upon database lock to ensure all
residual data is cleared without having to rely on the actual
database object being cleaned up.
2019-11-09 11:33:32 +01:00
Jonathan White
87ca7c7f7b Improve UX of database statistics page
* Fix #3766 - move database statistics processing into async task and only perform the calculation when the statistics tab is activated.
2019-11-08 22:24:30 -05:00
Jonathan White
f9d2696046 Relax strictness of TOTP Base32 validation
* Fix #3754 - Accept valid TOTP keys that require padding when converted to Base32.
* Allow use of spaces and lower case letters in the TOTP secret key.
2019-11-09 00:53:40 +01:00
Jonathan White
4edb623745 Prevent recursive loads using AutoOpen
* Fix #3334 - AutoOpen is now processed after the database widget is put into view mode to prevent infinite recursion of unlock attempts if two databases  auto open each other.
2019-11-09 00:53:40 +01:00
Jonathan White
cb9929712c Start Database Widget in view mode
* Fix #3713 - DatabaseWidget starts in locked mode instead of view mode fixing tab names on launch.
2019-11-09 00:53:40 +01: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
guihkx
6339d61419 Properly stylize the application name (#3775)
This is just a cosmetic change. On KDE Plasma, the title of the tray icon is set by either the name of the binary, or by calling `setApplicationName()`. So having it properly stylized looks better.
2019-11-08 23:54:56 +01:00
Aetf
f9097c84e9 FdoSecrets: use EntrySearcher's internal search API 2019-11-08 17:37:50 -05:00
Aetf
b96c1e92a3 Expose EntrySearcher's SearchTerm for internal code usage 2019-11-08 17:37:50 -05:00
Aetf
329701a34e Secret Service Integration Fixes (#3761)
* FdoSecrets: create prompt object only when necessary

* FdoSecrets: negotiationOutput should always return a valid QVariant otherwise QDBus will fail to create a reply, causing timeout in client.

* FdoSecrets: include in debug info
2019-11-07 21:28:49 -05: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
Elvis Angelaccio
1722397040 Show application icon in Plasma Wayland sessions (#3777)
This is required to show the keepassxc icon on Wayland windows in a
Plasma Wayland session.

kwin_wayland fetches application icons from .desktop files and it
expects the desktop filename to be set on the QGuiApplication instance.

Without this, kwin sets a generic Wayland icon as fallback.
2019-11-03 12:00:16 +01:00
Rafael Sadowski
38a663163d Check include malloc.h and malloc_usable_size(3)
One some operating systems  malloc(3) is not in malloc.h nor in
malloc_np.h, instead it is in stdlib.h.

In addition, not all systems support malloc_usable_size(3). You could
argue it's not safe.

This patch tries to be portable and it fix the build on OpenBSD.
2019-11-01 22:54:24 -04:00
louib
f4d6b4d13a CLI: do not display protected fields by default. 2019-11-01 22:53:54 -04:00
asapelkin
98badfb4a2 some cppcheck and clang-tidy fixies 2019-11-01 22:53:28 -04:00
Jonathan White
36e14157be Significantly reduce impact of FileWatcher hashing (#3724)
* Fix #3699

Reduce file watch hashing of open database files from every second to every 30 seconds. Additionally, only hash the first 1024 bytes of the database file. This is valid since most of the header and the entire encrypted portion are changed significantly on every save.
2019-10-30 11:40:56 +01:00
Jonathan White
178bea6bbc Fix building without features
* Fix #3684 - Include YubiKey headers in CLI tests 

* Skip building testguibrowser if browser integration is disabled

* Cleanup test CMakeLists
2019-10-29 23:03:39 -04:00
Jonathan White
744354c550 Reduce default Argon2 memory and thread settings (#3672)
* Fix #3550
* Default memory reduced to 64 MiB (from 128 MiB) and parallelism reduced to 2 threads. This allows for desktop and mobile device compatibility.
2019-10-26 20:55:26 +02:00
Jonathan White
57a7720274 Additional fixes for entry context menu (#3671)
Obtain context focus lock when showing new context menus

Fix #3670
2019-10-26 20:54:52 +02:00
Jonathan White
8c300b4fcb Update About Dialog contributors and translators (#3669) 2019-10-26 20:53:18 +02:00
Janek Bevendorff
6a25c8dc84
Force app exit if session manager signals a shutdown. (#3666)
Resolves #3410.

Additionally, "fix" main window toggling behaviour when
clicking the tray icon while the window is visible, but
not in focus (e.g. hidden by other windows). On platforms
other than Windows, the window is now brought to the front
if it does not already have focus or is toggled otherwise.

Remove obsolete Windows session end handling code.
2019-10-26 16:14:28 +02:00
Janek Bevendorff
ebc006c4b9
Add keepassxc man page and move cli man page to share folder (#3665) 2019-10-25 20:45:38 +02:00
Bernhard Kirchen
8c8c181f73 Hide YubiKey labels on unlock screen when compiled without XC_YUBIKEY (#3664) 2019-10-25 19:35:16 +02:00
Chih-Hsuan Yen
7c6c027d33 Fix building on Mac OS X 10.11 or older
* Add a missing include in src/core/Alloc.cpp

On Mac OS X 10.11 with Xcode 8.2.1, building fails with

/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_security_KeePassXC/KeePassXC-devel/work/keepassxc-f726d7501ff7e8a66ae974719042f23010716595/src/core/Alloc.cpp:44:10: error: no type named 'free' in namespace 'std'
    std::free(ptr);
    ~~~~~^

Per [1], std::free() needs #include <cstdlib>. That file is included
indirectly on newer systems.

* Avoid const Signature object in src/keeshare/ShareExport.cpp

After the above issue is resolved, building fails at

/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_security_KeePassXC/KeePassXC-devel/work/keepassxc-f726d7501ff7e8a66ae974719042f23010716595/src/keeshare/ShareExport.cpp:152:29: error: default initialization of an object of const type 'const Signature' without a user-provided default constructor
            const Signature signer;
                            ^

Apparently this is related to C++ defect 253 [2]. From the code,
creating a Signature is not needed as all methods in Signature are
static, so just call the method.

[1] https://en.cppreference.com/w/cpp/memory/c/free
[2] https://stackoverflow.com/a/47368753
2019-10-24 18:56:33 -04:00
Janek Bevendorff
99aafe657d Fix zxcvbn include for out-of-tree compilation, resolves #3658 2019-10-24 18:56:00 -04:00
schlimmchen
c2b16c663f no "Share" tab without WITH_XC_KEESHARE
if KeePassXC is compiled with WITH_XC_KEESHARE=OFF, the "Share" tab of
the EntryPreviewWidget for groups is removed from the GUI completely.

closes #3619.
2019-10-23 22:49:16 -04:00
schlimmchen
957ba90073 propagate the results from ShareExport::intoContainer
this is a fix for an obvious regression. there was some refactoring
going on around here since the 2.4.3 release, and the return value of
ShareExport::intoContainer has since been neglected. with this change
the info banner showing errors/warnings/info/success after exporting a
database tree with KeeShare is shown again.
2019-10-23 22:49:03 -04:00
Jonathan White
34bbf8b3a1 Updated translation file and fixed typos 2019-10-23 22:48:34 -04:00
Jonathan White
af263fd80d Prevent new entry loss on database file reload
* Fix #3651

* Correct data loss when the database reloads due to a file change while creating a new entry. The issue occurred due to the "new parent group" pointer being invalid after the database is reloaded following merge.

* Also fix re-selecting entries following database file reload. If the entry was moved out of the current group it would result in an assert hit. This fix prevents recursively looking for the entry.
2019-10-23 22:47:59 -04:00
James Ring
b8830dfd32 Don't show a warning when opening a database without WITH_XC_YUBIKEY. 2019-10-22 22:51:58 -04:00
varjolintu
62027d35ea Show database name when doing association 2019-10-22 21:55:39 -04:00
varjolintu
bee861ff8f Browser access control dialog shows submitUrl when found 2019-10-22 21:54:50 -04:00
James Ring
86a5553c3a Fix unused variable error when building without WITH_XC_YUBIKEY. 2019-10-22 21:48:27 -04:00
Jonathan White
4cc06f94c0 Correct Translation Warnings 2019-10-20 20:39:21 -04:00
Jonathan White
936bda8f71 Add special context menu for entries
* Fixes #2813

Added special context menu for entries to move the most-used actions to the top.

Re-ordered actions in the entry menu to be more user friendly.
2019-10-20 20:34:48 -04:00
Jonathan White
56a3e4d680 Enable entry actions when editing an entry
* Fixes #2118

Enables select entry actions when editing an entry. This allows users to copy the password of the entry, for example.

Note: unsaved changes to the entry will not be copied to the clipboard.
2019-10-20 20:34:48 -04:00
Jonathan White
1e694271a3 Improve Database and CLI tests 2019-10-20 18:56:41 -04:00
Jonathan White
744b4abce8 Move FileWatcher into Database class
* Fix #3506
* Fix #2389
* Fix #2536
* Fix #2230

Every database that has been opened now watch's it's own file. This allows the database class to manage file changes and detect fail conditions during saving. Additionally, all stakeholders of the database can listen for the database file changed notification and respond accordingly.

Performed significant cleanup of the autoreload code within DatabaseWidget. Fixed several issues with handling changes due to merging, not merging, and other scenarios while reloading.

Prevent database saves to the same file if there are changes on disk that have not been merged with the open database.
2019-10-20 18:56:41 -04:00
Jonathan White
6b746913e4 Cleanup database save functions
* Make a clear distinction between saving to the existing file path and saving to a new file path
* Use proper save function calls in CLI
2019-10-20 18:56:41 -04:00
Mark Hakansson
a876b3b72f Prompt to delete recycle bin when disabling it
Fixes #3365

Add prompt to delete the recycle bin when disabling it. If the user chooses not to delete it, the recycle bin will be suffixed with "(old)" and the icon changed to the default group icon.

Also moved recycle bin creation within the database class where it belongs.
2019-10-20 17:58:15 -04:00
Tobias Beeh
a1e12c1b30 Add check for database files when selecting a key file
Reject own database file as the key file. Prompt for other kdbx files as key files.

Also add a static warning message to the key file selection dialog
2019-10-20 17:58:04 -04:00
Jonathan White
99a2d66086 Correct issues with TOTP Setup
* Fix #3142 - Warn user when entering invalid TOTP secret key.
* Fix #773 - The TOTP dialog now listens for the copy shortcut without having to press the Copy button.

* Add ability to choose hash algorithm from the TOTP setup dialog
* Add upgrade to "otp" attribute when custom attributes are chosen to prevent data loss

Ran make format
2019-10-20 17:57:51 -04:00
Jonathan White
71085838db Make macOS Auto-Type more robust
* Fix #3351

On macOS, entry specific Auto-Type (Cmd+Shift+V) now raises the last active window before lowering the KeePassXC window. This improves accuracy of the window that is actually typed into.
2019-10-20 17:57:38 -04:00
varjolintu
f726d7501f Add support for multiple URLs in an entry
* Fixes #398

The new Browser Integration entry settings page has a list view with any additional URL's. These URL's are added to the entry attributes with KP2A_URL_<counter>, which means those are directly compatible with Keepass2Android.
2019-10-16 22:20:57 -04:00
Jonathan White
e50261a99c macOS 10.15: Request screen reader permission for AutoType
* Fix #3609 - Request screen reader permission by faking a 1px screenshot. Thanks to MacPass for this idea.
* Fix #3578 - Remove duplicate sandbox entitlement
* Fix #3270 - Use executable path reference for libquazip
2019-10-15 22:12:45 -04:00
Jacob Sachs
dbe15d32e5 CLI: Add Import XML command (#3572)
The CLI now contains an "import" command that creates a new database from the specified XML export. The new database is in kdbx 4 format, and does not currently accept a keyfile in database creation.

This change is required to create new databases from XML backups.

Fixes #2458
2019-10-15 22:10:45 -04:00
Gigadoc2
82cfedfa43 re-enable wayland 2019-10-13 22:00:50 -04:00
Wolfram Rösler
8afb1f17b4 Add "Statistics" page to Database Settings dialog (#2034)
Added new page "Statistics" to the Database Settings dialog that shows information like number of groups and entries, number of unique and re-used passwords, average password length, etc.
Show warnings for problematic values with explainations for the user in tooltips.

Fixes #2034

Database statistics icon:
Downloaded from: https://www.flaticon.com/authors/freepik
Original source: https://www.flaticon.com/free-icon/bars-chart_265733
2019-10-13 12:24:27 -04:00
Janek Bevendorff
ca0c4f5a3d
Fix stylesheet warnings introduced by 3b330ee2 (#3610)
Fixes regression introduced by 3b330ee.
The previous changes could add an invalid style
sheet to PasswordEdit's QLineEdit.
2019-10-09 13:44:46 +02:00
varjolintu
a93b22f89a Add support for skipping Auto-Submit with Browser Integration 2019-10-05 14:37:46 -04:00
varjolintu
e5295b4eb0 Fix setting and removing registy values for Browser Integration 2019-10-05 13:59:12 -04:00
Manuel Dewald
7d0f89ef46 Enable system tray icon click slot for Mac OS 2019-10-05 13:58:42 -04:00
libklein
058b4da954 Fix entry clone modification time update (#3602)
* Add test for (unwanted) history timeinfo update when cloning entries.
* Add timeInfo test for clone with rename.
* Fixed modification time update when cloning an entry with renaming.
2019-10-05 13:58:00 -04:00
Chris Johnston
1ceacdf636 Fix #3511 Add hyperlinks to EntryPreviewWidget notes field
This change adds support for hyperlinks in the notes field of the EntryPreviewWidget. This is done by enabling the `openExternalLinks` property of `QLabel`, and modifying the value of the content of this field so that links are wrapped
with `<a>` tags.

Links are assumed to use the format: `protocol://path`, since assumptions cannot/shoudn't be made about the specific format of a link. The text of the label uses the modified notes value.
2019-10-05 13:56:14 -04:00
Jonathan White
37c04f3e42 Revert search delay timer to 100ms
Fix #3587
2019-10-04 21:18:37 -04:00
varjolintu
bef1b94d71 Fix getting credentials from non-connected database 2019-09-28 11:26:15 -04:00
Jonathan White
23eb13ced6 Add missing tooltips to buttons 2019-09-28 11:25:20 -04:00
Jonathan White
cf057b1146 Copy password of selected entry even if empty 2019-09-28 11:25:02 -04:00
James Ring
b1eda37cca CLI: Add interactive session mode command open
This change adds a GNU Readline-based interactive mode to keepassxc-cli. If GNU Readline is not available, commands are just read from stdin with no editing or auto-complete support.

DatabaseCommand is modified to add the path to the current database to the arguments passed to executeWithDatabase. In this way, instances of DatabaseCommand do not have to prompt to re-open the database after each invocation, and existing command implementations do not have to be changed to support interactive mode.

This change also introduces a new way of handling commands between interactive and batch modes.

* Fixes #3224.
* Ran make format
2019-09-28 11:24:42 -04:00
louib
19f87ca057 CLI: Add group commands 2019-09-22 21:13:50 -04:00
louib
964478e78f CLI: Add Yubikey unlock support 2019-09-22 18:11:40 -04:00
louib
77fcde875e CLI: Export database as CSV
* Changed `Extract` to `Export` to support additional formats
* Allow database expot as CSV.  Added a `--format` option to the `Export` command for that, which defaults to xml, so the current behavior is unchanged.
*The `CsvExporter` had to be refactored a bit, but nothing major. It can
now print to a file or return a string.
2019-09-22 12:42:53 -04:00
James Ring
547c246e88 Additional database file checks in cli/Utils.unlockDatabase
Avoids prompting the user for a password if unlocking is likely to fail
due to some problem with the database file (i.e. not found, not a file,
not readable).

Add unit tests.
2019-09-22 11:19:57 -04:00
scootergrisen
344198bc2a Link to localised AMO page (#3551) 2019-09-18 17:57:07 +02:00
louib
c19703c39f Merge custom data only when necessary (#3475) 2019-09-16 14:01:13 -04:00
Jonathan White
c99b656279 Always show search menu when icon clicked
* Search menu icon only allowed the search menu to show when the right third of the icon was clicked, this was a Qt limitation.
* Fixes #3538
2019-09-16 13:59:38 -04:00
varjolintu
77be468670 Fix crash when removing custom data 2019-09-07 07:50:08 -04:00
metaphys
72c1783b5b Support key files with Auto Open feature
Fixes #3495

* Look for keyfile in username parameter of the Auto Open entries. If present, pass on to unlock call to the database.
2019-09-07 07:46:01 -04:00
ckieschnick
0a75b47509 Connect ShareObserver to group signals (#3441)
Connected ShareObserver to allow to import from a share before an export happens.
2019-09-04 22:57:37 -04:00
Akinori MUSHA
41131ae48d Allow abbreviation of search field names
This allows `t:word` instead of `title:word` and `p:word` instead of `password:word`, and so on.  The rule is that an abbreviated name expands to the first field name that starts with it, with exceptions
`u:` expanding to `username:` instead of `url:` and `pw:` expanding to `password:`.
2019-09-04 22:31:15 -04:00
Frederic Linus Schulz
0a3b19edf2 Add checkbox to allow minimize after database unlock.
Default option is set to off
2019-09-02 21:53:16 -04:00
Soham Gumaste
018e9f30be Fix password preview font, add some documentation (#3425)
* Fix #3376. Set font for password preview to Font::fixedFont()
* Add a menu entry opening the shortcuts documentation in the browser
* Fixed duplicate item in CLI documentation
2019-08-30 22:55:02 -04:00
louib
eb1882453f CLI password generation options cleanup (#3275)
Summary of changes:
* Extract function for creating password generator from options into
`Generate` command. This function is now reused in `Add` and `Edit`
commands.
* Updated manpage with missing password generation options.
* Updated manpage with missing longer forms of password generation options.
* Added unit tests for new password generation options in `Add` and
`Edit`.
* Handle case when `-g` and `-p` options are used at the same time.

This PR adds password generation functionalities while reducing
code duplication, but at the cost of 2 small breaking changes:
* The password generation option for `Add` and `Edit` for specifying
password length is now `-L` instead of `-l`, to not clash with the
`-l --lower` option.
* The `-u` shorthand for the `--upper` option has to be removed, to not
clash with the `-u --username` option.
* Add -U variant for uppercase.
2019-08-30 22:50:32 -04:00
varjolintu
79bb991a61 Disable remember checkbox with Basic HTTP Auth 2019-08-30 22:35:07 -04:00
varjolintu
493b51882b Update legacy database hashes automatically 2019-08-30 22:34:43 -04:00
Gianluca Recchia
fccbb98b8e Improve File Dialog
* QFileDialog returns UNIX paths, even on Windows. This patch converts what QFileDialog returns to the native path format.

* Improve const correctness

* Avoid imposing file extension on Linux

* This patch improves things like unneeded passes by values, missing const qualifiers, ugly copies because of variable reuse and consistency in variable names.
2019-08-30 22:30:30 -04:00
Gianluca Recchia
c12fd369d9 Save to canonical path when dealing with symlinks 2019-08-30 22:21:26 -04:00
Jonathan White
2aac83d03b
Improve handling of read-only files (#3408)
* Fix #3407
* Read-only files now disable auto-save and show as modified correctly. This allows the GUI to prompt to "save-as" instead of silently discarding changes when the read-only database is locked or closed.
2019-08-30 21:39:37 -04:00