Commit Graph

3387 Commits

Author SHA1 Message Date
louib
15b9e82f93
[CLI] Add Option to show all attributes (Show command) (#8256)
* Adding --all option to Show
2022-08-20 22:38:58 -04:00
louib
aa839e2619 Adding top-level fields to CLI commands
The top-level fields are currently not accessible from the CLI, which
makes it impossible to select entries or groups based on the UUID.
There are other top-level fields I believe, like the expiry date,
but I only added the two most critical fields for the moment.
2022-08-20 18:31:30 -04:00
Jonathan White
a6d3f973fa Better handling of "Lock on Minimize" setting
* Fix #1090 - delay locking databases after minimize to allow for clipboard use, Auto-Type use, and browser integration use.

* Fix #6757 - prevent setting both minimize on unlock and lock on minimize settings at the same time.
2022-08-01 18:19:45 -04:00
Jonathan White
dab6d9408e Add setting for number of recent files
* Expose setting to limit the number of recent files. Default is still 5, can be set from 1 to 25.
* Also fix tab order on settings page
2022-07-11 06:55:03 -04:00
Daniel Ziegenberg
6b05b84895 Add Ctrl+Tab shortcut to cycle databases in unlock dialog
The main window has both `Ctrl+PageUp` / `Ctrl+PageDown` and
`Ctrl+Tab / Ctrl+Shift+Tab` shortcuts to cycle the database tabs. When
in PR #5427 the abbility to select any open database in the unlock
dialog was introduced, only the `Ctrl+PageUp` / `Ctrl+PageDown`
shortcuts were added. This commit adds the `Ctrl+Tab / Ctrl+Shift+Tab`
shortcuts to the unlock diaglog to fix this inconsistent UI behaviour.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-07-01 22:29:33 -04:00
Bernhard Kirchen
861fe2e5a9 cmake: make libxi and libxtst a requirement with autotype enabled 2022-06-19 10:34:52 -04:00
Bernhard Kirchen
63a5e474a6 cmake: emit warning if X11_Xi or X11_XTest not found
at least on Debian, a bullseye installation, the X11 development files
may be installed without the libxi-dev or the libxtest-dev packages.
this leads to the autotype shared library libkeepassxc-autotype-xcb.so
not being built without any complaint from cmake.

this commit makes cmake emit warning messages that shall hint anyone
building themselves that autotype will not work without these libs.
2022-06-19 10:34:52 -04:00
Jonathan White
b86c3e64ec Fix crash when trying to close database during unlock
* Fix #7239 - prevent closing the database widget if the open dialog is still unlocking the database. This problem became slightly worse with quick unlock.

With this fix, if the user tries to close the database during unlock we will just ignore that request.
2022-06-14 05:58:38 -04:00
varjolintu
6cb6f1f007 Browser: Add a new group setting for omitting WWW subdomain when matching URLs 2022-06-12 16:45:54 -04:00
varjolintu
c1dbe27f25 Emit database changed event on single db lock 2022-06-11 09:29:26 -04:00
Felix Stupp
de3d40b644 Add methods isHardwareKeySupported and refreshHardwareKeys to DBus 2022-06-11 09:28:26 -04:00
Jonathan White
20a2a96222 Auto-Type: PICKCHARS can specify attribute and ignore BEEP
* Fix #7726 - Ignore BEEP Auto-Type token when it includes spaces and numbers as well
* Close #8103 - Allow specifying specific attribute to use with PICKCHARS. If none specified, it defaults to Password.
2022-06-09 10:05:03 -04:00
Jonathan White
b1f4e12d34 Improve entry preview panel
* Fix #7811 - Notes height no longer truncated
* Fix #7949 - Improve copying attribute value to clipboard in entry preview
* Fix #7898 - Prevent copying url when copy password selected after clicking url in preview pane
* Fix #7982 - Double clicking hidden attributes in preview pane copies the value instead of ●●●●●●
2022-06-06 07:20:15 -04:00
Michael Ziminsky (Z)
bc0a5a9440 Fix autotype menu entries on Windows 2022-06-05 22:02:23 -04:00
Patrick Sean Klein
e16c007d43 Correct regex escape logic
* Fixes #7776

Implement QRegularExpression::escape within Tools::convertToRegex to allow usage on older Qt versions.

Also wrap EXACT_MODIFIER patterns in a non-capture group to prevent misinterpreted regex.
2022-06-05 21:58:52 -04:00
varjolintu
924eb6dbc4 Pass database locked/unlocked status even with Search All Databases option enabled 2022-06-05 21:30:10 -04:00
Jonathan White
b5e0572155 Fix Auto-Type gui guard for tests
Prevent showing gui error dialogs when no gui is present. This can occur during auto-type tests.
2022-06-05 07:04:34 -04:00
Jonathan White
0f3a2531e7 Fix use of modifiers under macOS
* Fix #6463
2022-06-05 07:04:23 -04:00
Jonathan White
dab7047113 Fix file dialog not appearing on snap build
Fix #7607 - Don't disable core dumps when building for snap distribution. Doing so will not allow the xdg-desktop-portal from opening the file dialog. This is because the portal attempts to call entries from /proc/[pid]/xxxx which are restricted to root when core dumps are disabled.
2022-06-05 07:04:11 -04:00
Aetf
0f7b674cbb FdoSecrets: add smarter handling of database unlock requests
This commit implements the following logic:
* If there're already unlocked collections, just use those,
* otherwise, show the unlock dialog until there's an unlocked and exposed collection.

* Fixes #7574
2022-06-04 16:27:18 -04:00
Aetf
e2bf537c4a FdoSecrets: ask to unlock the database when creating items
Also only emit databaseUnlockFinished after the database is unlocked

Fix #7989
2022-06-04 15:49:34 -04:00
SnipFoo
806b8b0901 Add config variable for specifying a default file name for the database 2022-06-04 13:13:49 -04:00
J.M. Dana
a740fe128c Add password strength indicator to PasswordEditWidget
Fixes #7437 (entry edit view only)
Fixes #5220
2022-05-31 07:34:50 -04:00
Patrick Sean Klein
65a1d1b0f7 Limit zxcvbn entropy estimation length
Limit the use of zxcvbn based password entropy estimation to 256 bytes. After this threshold, the average per-byte entropy from the zxcvbn calculation is added for each additional byte. In practice, this produces a slightly higher entropy calculation for purely randomized passwords than zxcvbn would normally calculate. However, the time to calculate is capped leading to a much better user experience and removing unnecessary calculations.

Fixes #7712
2022-05-30 10:46:39 -04:00
Hugo
1009650b5c
Move socket into separate directory (#8030)
This is mostly to ease setup and configuration with sandboxed browsers.

The socket currently existing in `$XDG_RUNTIME_DIR`. When sandboxing a browser, it would be unsafe to mount this directory inside the sandbox.
Mounting the socket into the sandbox's filesystem is also not possible in cases where KeePassXC is [re]started after the browser has started.

This commit moves the socket into its own isolated subdirectory, which can be safely mounted into sandboxes. Sandbox engines can create the directory themselves (in case the browser starts before KeePassXC). Both Flatpak and Firejail support this configuration.

A symlink is also created, linking the previous location to the new location. This is meant for backwards compatibility and should eventually be dropped.

The directory can't be named `org.keepassxc.KeePassXC.BrowserServer`,
since that would collide with the symlink. Instead, the directory has been created to match the format used for Flatpak builds, which make it a bit less of a snowflake build, while following accepted conventions.

Given that the preferred path now matches what Flatpak uses, the block handling Flatpak and non-Flatpak is now the same.

If `$XDG_RUNTIME_DIR` is undefined, the temporary directory is used, though reading the socket from this location is discouraged.

Closes: https://github.com/keepassxreboot/keepassxc/issues/8018
References: https://github.com/keepassxreboot/keepassxc/discussions/6741
2022-05-28 18:19:48 -04:00
Carlo Teubner
b14bec3bb0 Remove unused header files 2022-05-28 17:26:41 -04:00
Aetf
a4c5997050 FdoSecrets: skip entries in recycle bin when searching (fix #7933) 2022-05-28 15:36:17 -04:00
Nicolas Roeser
aa97bd5213 Align generator logic and UI for math symbols
In the password generator widget, the checkable push button for the math
symbols is missing the GREATER-THAN SIGN (U+003E), even though it is
among the possible characters during password generation when the button
is checked. Add the missing character to the text displayed to users.

While at it, also fix a wrong comment containing the possible
characters.
2022-05-28 15:24:57 -04:00
Rosen Penev
a4d4adb1f6 clang-tidy: use nullptr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-05-03 15:32:54 -04:00
Rosen Penev
7e1d980d08 clang-tidy: use auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-05-01 16:02:02 -04:00
Rosen Penev
f3f1520f81 clang-tidy: C++ headers
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-05-01 16:01:46 -04:00
Rosen Penev
7e44b67906 clang-tidy: use override
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-05-01 16:01:31 -04:00
Rosen Penev
44333fef0a clang-tidy: use range loop
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-05-01 16:01:11 -04:00
Carlo Teubner
9bf61bfc5c Fix Botan deprecation warning
Use the non-deprecated PK_Signer constructor overload, by explicitly
passing in our random-number generator.
2022-04-18 09:45:29 -04:00
Piraty
7edeceec03
Link ykcore against pthread (#7807) 2022-04-15 10:27:04 +02:00
hka
692c95b11e
Normalize path (slashes to be precise) when opening a database or saving the last used database paths (#7864)
Fixes #7821
2022-04-12 21:05:06 +02:00
Aetf
6b0eeb9722 FdoSecrets: do not share entry <-> item property by multiple unlock prompts
Fixes #7753
2022-04-05 18:08:46 -04:00
louib
7cd824ae1c
Upstream Flathub patches (#7728) 2022-04-04 19:04:18 -04:00
Jonathan White
31db3c325d Fix compiling with minizip-ng
* minizip-ng has slightly different defines and function names than the original minizip. These changes adapt the existing code to use the minizip-ng versions if necessary.
2022-04-03 13:28:39 -04:00
Jonathan White
656e6161a0 Add tags to history comparison 2022-04-03 13:28:39 -04:00
Jonathan White
44be95cc1b Fix crash when building history changes
* Replace rarely hit asserts with defined nullptr checks when replacing references without a group
* Fix #7603
* Replace TOTP history comparison with checking the actual TOTP output instead of a compiled string
2022-04-03 13:28:39 -04:00
Jonathan White
48a3fd8e3c Fix detection of hardware keys in keepassxc-cli
* Split calls to finding hardware keys into sync and async methods. This has the side effect of simplifying the code.
* Check for keys before performing challenge/response if no keys have been found previously.
* Correct timeout of user interaction message to interact with the hardware key.
* Correct error in TestCli::testYubiKeyOption
2022-04-03 13:26:12 -04:00
Jonathan White
7d7c635423 Disable debug messages in release builds
Also correct / remove various debug messages
2022-04-03 13:26:12 -04:00
Jonathan White
097be1a5cd Fix Auto-Typing single character placeholders
* Fix #7743 - Include # in placeholder list
* This change fixes typing single character placeholders (escaped placeholders) on Windows. Previously we were sending these as raw key presses which didn't properly press Shift or other modifiers. Now they are sent as unicode characters unless in virtual mode (the expected behavior).
2022-04-02 12:51:33 -04:00
Jonathan White
c5d25ac371 Fix Auto-Type modifiers on Windows
Also add documentation on modifiers.

* Fix #7626
2022-04-02 12:51:33 -04:00
Jonathan White
dd5217734c Improve Entry Preview layout
* Fix #7672 - notes preview spans the entire length of the preview pane again
* Fix #4242 - Allow selecting entry title text in preview
* Improve multi-line tag preview
* Fixup alignment and spacing of fields
2022-04-02 12:50:54 -04:00
Jonathan White
41061cfde8 Improve speed of AES KDF transform
* Remove parallel left/right block calculations in favor of calculating both blocks simultaneously. This brings the calculation within parity of 2.6.6.
* Fix #7682
2022-04-02 12:50:43 -04:00
Jonathan White
d8da81d87c Revert DatabaseOpenDialog to be always on top on Linux
Fixes regression due to issues with dialogs appearing above other windows on some Linux Desktop Envs.
2022-04-02 12:50:31 -04:00
Toni Spets
2b8d670f17 SSH Agent: Fix Windows agent selection, radio buttons 2022-04-02 08:47:00 -04:00
Bernhard Kirchen
aca197a96f
Add 12 hours expiration preset (#7738)
* Add hours precision to TimeDelta

* Add 12 hours expiration preset

Fixes #7369
2022-03-31 07:02:28 -04:00
Rosa Hase
044fc8d50c Use setChangeCurrentOnDrag property to handle drag and drop between tabs
.FIXES #7155
2022-03-29 23:19:32 -04:00
Janek Bevendorff
5c45cf2d76 Clear quick unlock secrets when database tab is closed 2022-03-29 23:17:38 -04:00
Janek Bevendorff
7eb7172635 Fix regression: Hide password before unlocking database
Fixes #7724
2022-03-29 23:17:38 -04:00
Jonathan White
02602da257 Several improvements to tags editing
* Fix #7602 - Allow spaces in tag names
* Fix #7528 - Allow pasting text into the tags field. Text is split by comma creating tags for each section of text. If there are no commas then the pasted text becomes a tag.
* Fix tags editing not causing the entry to be marked as modified.
2022-03-29 18:41:31 -04:00
Jonathan White
ad61d71c6e CLI: Add missing parameters to add/edit commands
This adds the `-c` parameter to the password generator when adding/editing entries via the CLI.
2022-03-28 22:08:01 -04:00
Toni Spets
fc5a07b46d Auto-Type: Map ASCII dead keys on Linux
Special handling of ASCII keys that are common in passwords that
may be dead on the current keyboard layout and prevents going to
keysym emulation fallback.
2022-03-28 06:24:58 -04:00
tenzap
01b15fbeba Fix compilation on macOS < 12.0.1
Used methods for touchID on macOS require macOS >= 12.0.1
2022-03-27 15:54:22 -04:00
tenzap
c33995e075 fix compilation of TagsEdit.cpp
qOverload appeared with qt5.7

Reported error:
keepassxc-2.7.0-src/src/gui/tag/TagsEdit.cpp:414:34: error: use of undeclared identifier 'qOverload'
        connect(completer.get(), qOverload<QString const&>(&QCompleter::activated), [this](QString const& text) {
                                 ^
2022-03-27 15:52:31 -04:00
Jonathan White
4178e72fe0 Reduce delay when searching entries in Auto-Type select dialog
* Fix #7596
2022-03-23 16:15:45 -04:00
Jonathan White
eac60b3228 Correct timing issue with entry level Auto-Type on some platforms
* Fixes #7584
2022-03-22 16:10:05 -04:00
Aetf
7d3c3b09fb FdoSecrest: allow remember decision for future entries
Also added a reset decision button in session management tab

Fixes #7464

* Fix distorted button in settings page: the default margin in QToolBar is too large for our use case in a table row.
2022-03-21 08:42:17 -04:00
Jonathan White
9e21df2515
Remove unused variable from Windows Auto-Type 2022-03-21 07:41:56 -04:00
alcroito
ab153a24ec Run macdeployqt only once at install time
Instead of running macdeployqt once for each extra helper binary and
plugin (plus the main run for the application itself), collect all the
binaries that should be processed and run macdeloyqt only once after
all the binaries have been installed.

This also moves the main app macdeployqt call from a POST_BUILD step
to an install(CODE) step, making increment rebuilds of the app faster.

To ensure that macdeployqt is called after all the binaries are
installed, a new post_install subdirectory is needed to
circumvent CMake's limitation regarding the default order of
installation.
CMake first runs the current directory install() calls and then it's
child subdirectory ones. Because we want macdeployqt to be the last
install() call, it needs to be done inside a subdirectory that is
added last.

Note due to a bug in macdeployqt, the deployed app inside the .dmg
file will fail to run on arm macs, due to broken code signature.
See https://bugreports.qt.io/browse/QTBUG-101696 for details.

For the final release, the release-tool should take care of proper
resigning.
2022-03-21 00:15:57 +01:00
Janek Bevendorff
60f7744ec6 Fix translations 2022-03-20 23:31:52 +01:00
Jonathan White
1ca358f3fd Improve KDBX error messages 2022-03-20 23:31:52 +01:00
Jonathan White
cf5429a39b Allow colon in tags and sort alphabetically
* Fix #7489 - allow colon and period in tag names
* Fix #7490 - sort tags alphabetically
2022-03-20 13:33:46 -04:00
Jonathan White
4cc5850c86 Fix broken documentation menu items 2022-03-20 13:33:32 -04:00
Jonathan White
7da9899c48 Correct snapcraft build and update appdata xml 2022-03-20 13:33:32 -04:00
Jonathan White
9569438295 Always enable Auto-Type help button 2022-03-20 17:49:03 +01:00
Jonathan White
8a7eb36950 Several fixes for Auto-Type
* On Windows, offer explicit methods to use the virtual keyboard style of typing. This partially reverts 1150b69836 by going back to the standard unicode method by default. However, uses can either add {MODE=VIRTUAL} to their sequence or choose "Use Virtual Keyboard" / CTRL+4 from the selection dialog.

* Took this opportunity to clean up the signature of  AutoType::performAutoType and AutoType::performAutoTypeWithSequence by removing the "hideWindow" attribute.

* Show keyboard shortcuts on the selection dialog context menu

* Fix selection dialog help icon color when in dark theme
2022-03-19 08:23:53 -04:00
Jonathan White
392cab2e36 Remove unused/duplicate icons 2022-03-19 08:23:53 -04:00
Chih-Hsuan Yen
c363e4a969 Generate the D-Bus adaptor class on the fly
That prevents mismatches between the adaptor class and the D-Bus
definition file.

Note that this is a backward-incompatible change. For example, the
command to lock all databases is changed from

> dbus-send --session --print-reply --dest=org.keepassxc.KeePassXC.MainWindow --type=method_call /keepassxc org.keepassxc.MainWindow.lockAllDatabases

to

> dbus-send --session --print-reply --dest=org.keepassxc.KeePassXC.MainWindow --type=method_call /keepassxc org.keepassxc.KeePassXC.MainWindow.lockAllDatabases

Fixes: https://github.com/keepassxreboot/keepassxc/issues/5355
2022-03-13 06:15:48 -04:00
Janek Bevendorff
e07d143c9b
Skip "StatusIndicator" window in Auto-Type window list (#7527)
Starting with macOS 12.2, when the audio recording indicator is shown, the
"Window Server" process injects a "StatusIndicator" window into the list of
active windows, which messes with Auto-Type's window title matching. This
window has an Alpha value of 1 (so technically, it is not invisible), and it
is always in front of all other windows. Hence, the only way to skip it is by
title and owner name.

Fixes #7418
2022-03-12 21:07:36 +01:00
Jonathan White
4bc32d37ac Retain quick unlock if Hardware Key is missing
* The hardware key missing error message is properly shown and the user can try to Quick Unlock again after plugging in or tapping the hardware key in time.
2022-03-10 16:54:15 -05:00
Jonathan White
0ad75ccb8f Fix missing include in alloc preventing some secure deallocations 2022-03-07 11:15:59 -05:00
Jonathan White
a2140d7081 Update contributors and Patrons on About Dialog 2022-03-06 12:50:30 -05:00
Jonathan White
e5a2958458 Revert back to Argon2 reference library
* Fix #7487 - Botan does not use threads when calculating Argon2 KDF leading to very poor performance for a parallelism value > 1.
* Include port file for vcpkg backed builds
2022-03-06 12:50:17 -05:00
alcroito
abfebea4f2 Fix rpath handling and deployment of macOS helper binaries
CPack by default invokes the 'make install' target to install
all project files into a staging area for further packaging.

The order of installation follows the order of install() commands.

One of the first install() commands is the one that installs the
KeePassXC.app bundle and all the contents inside of it,
which includes POST_BUILD copied binaries like keepassxc-cli
and keepassxc-proxy.

Subsequent install(TARGETS) commands would then override the
keepassxc-cli and keepassxc-proxy binaries inside the staging area
with the ones which didn't have macdeployqt run on them (the ones from
src/cli and src/proxy).
Launching the binaries would then fail because of missing rpath
adjustments.

The libkeepassxc-autotype-cocoa.so library was working fine because
there is no install(TARGETS) command for it in a WITH_APP_BUNDLE build,
so the POST_BUILD copy with the adjusted rpaths was preserved.

To fix the issue and make the handling consistent, macdeployqt is no
longer run at POST_BUILD time, but instead at 'make install' time,
after each binary is installed by install(TARGETS).

libkeepassxc-autotype-cocoa.so also has its install command run
unconditionally now.

The build dir binaries that are POST_BUILD copied into
src/KeePassXC.app continue to run because they use the build dir
rpaths that CMake embeds by default. They don't macdeployqt run for
them anymore, which slightly speeds up the build time.

Fixes: #7475
2022-03-05 11:03:50 -05:00
Jonathan White
e85425050b Properly press AltGr key in Windows Auto-Type
* Fix #7456
2022-02-25 06:05:21 -05:00
Jonathan White
f3b0fe46b4
Fix excluding characters in password generator
* Fixes #7451
2022-02-23 17:57:52 -05:00
Sami Vänttinen
7284a8062a
Fix password generator responses (#7404)
* Respond directly to the current client instead of broadcasting

* Append requestID to generate-password response
2022-02-23 17:48:50 -05:00
Sami Vänttinen
6791024995
Fix new password generator closed reply with Browser Integration (#7359) 2022-02-23 17:48:50 -05:00
Jonathan White
4f0710350f Add support for Windows Hello
* Special thanks to @HexF and @smlu for their contributions towards this feature.

* Add MVP support for Windows Hello as a Quick Unlock solution using the WinRT API. This works by signing a random challenge vector with the Windows Hello protected key store (typically from TPM). The signed challenge is hashed using SHA-256 and then used as the encryption key to encrypt the database credentials. Credentials are encrypted using AES-256/GCM. This ensures the database password can only be decrypted following a successful authentication with Windows Hello in the future.

* Unify Touch ID and Windows Hello behavior under the Quick Unlock branding. Remove all timeout features of Touch ID as they are unnecessary and complicate the feature for no security gain.

* Quick Unlock is automatically reset only when the database key is changed vice whenever database settings are modified.

* Don't set database unlock dialog as always on top. This allows Touch ID and Windows Hello prompts to appear above the dialog properly.

* Prevent quick unlock when using AutoOpen or opening from the command line.
2022-02-22 17:53:50 -05:00
Jonathan White
a76daeb4c5 Add key serialization to support Quick Unlock 2022-02-22 17:53:50 -05:00
Bernhard Kirchen
acce1bc5ce entry preview: blend background of tags when inactive 2022-02-21 11:53:37 -05:00
Toni Spets
bfbc0e5ec6 Auto-Type: Allow retyping with automatic relock
If relock after performing Auto-Type is enabled it will wait until
specified timeout before doing so.

Retype time is now configurable and is decreased from the old
hardcoded 30 seconds down to 15 seconds to keep the default a bit
more secure while still allowing the user to set it higher for
their liking.

To restore old behavior the user can set retype time to 0 which
will make the database relock instantly.

Auto-Type relock setting relocated to Auto-Type tab to group it
better with the other Auto-Type settings.
2022-02-20 16:12:16 -05:00
Jonathan White
0701d1d6cd Fix styling of database tag view in main window
* Also allow collapsing the entire left splitter instead of a dedicated option to hide the group view.
2022-02-20 15:37:22 -05:00
Magnus Groß
d10c5a4e2a Detect system dark mode preference changes without restart on Linux
The new org.freedesktop.appearance.color-scheme key allows us to do this
in a reliable way.

Recently freedesktop standardized the system dark mode preference in a
desktop environment independent way in the xdg-desktop-portal
specification.

The specification can be seen here: d7a304a006/data/org.freedesktop.impl.portal.Settings.xml (L33-L45)

KDE supports this since KDE Plasma 5.24 and Gnome supports this since
Gnome 42.

Relevant blog post: https://blogs.gnome.org/alexm/2021/10/04/dark-style-preference/

Fixes #7146
2022-02-17 20:17:45 -05:00
Jonathan White
58615d78bd Fix using modifier keys
* Fix error in regex that prevented use of modifier keys in general.
* Added '#' modifier to press the "Meta" button. This correlates to the Windows key on Windows and Command key on macOS.
* Fix #6695 - send proper modifier keys based on documentation
2022-02-08 19:07:43 -05:00
Jonathan White
1150b69836 Fix Windows Auto-Type sending characters to virtualized guests
* Fix #1833
2022-02-08 19:07:43 -05:00
Toni Spets
5927821896 Auto-Type: Only match non-empty associations
Previously empty associations matched any window but since you can
use a wildcard (*) if you specifically want that this change makes
it possible to define multiple sequences for the global search
if you need to.

Additionally show empty associations in the list as "(empty)" to
better differentiate between rows if no title is set.
2022-02-08 19:07:00 -05:00
Balazs Gyurak
6897787d8f Show expired entries on DB unlock
* Show banner message about expired entries
* Add config option and expiration offset
* Only show expiry warning on first DB unlock
* Default to on with 3-day offset from expiration
2022-01-31 07:19:45 -05:00
Jonathan White
3c824cb500 Add powershell version of release-tool 2022-01-31 07:00:08 -05:00
Matt Miller
b29e8fb0b5 Update tab order for CSV import dialog to match screen order (order top-bottom first then left-right) 2022-01-28 21:28:54 -05:00
Jonathan White
6a12f450e6
Fix access denied errors when using KeeShare export/sync (#7322) 2022-01-28 21:28:01 -05:00
Patrick Klein
bce8c84c26
Remove obsolete read only state from database. (#7324) 2022-01-28 21:26:53 -05:00
oysteins-a
c914c116e4 Fixed typo occurences 2022-01-28 21:25:31 -05:00
Jonathan White
7f92504a2d Fix wildcard window title matching in Auto-Type
* Fixes #6413
2022-01-28 19:38:30 -05:00
Xavier Valls
4a21cee98c Add tags feature
* show the tags in the entry preview
* allow searching by tag
* add a sidebar listing the tags in the database
* filter entries by tag on click
* Introduce a new TagsEdit widget that provides pill aesthetics, fast removal functionality and autocompletion
* add tests for the tags feature
* introduce the "is" tag for searching. Support for weak passwords and expired added.
2022-01-28 16:13:49 -05:00
varjolintu
7efaca6fbe Accept kdbx:// urls in Edit Entry view 2021-12-30 08:14:30 -05:00
Sami Vänttinen
cd642e7fee
Add support for Browser statistics (#7197)
Co-authored-by: Jonathan White <support@dmapps.us>
2021-12-30 07:31:06 -05:00
osx user
15d1b2f0ab Show what changed between entry history items
* Also show what is changed on the current state
* Closes #2621
2021-12-22 05:52:54 -05:00
Jonathan White
12990e59ad KeeShare: Remove checking signed container
* Remove QuaZip dependency in favor of minizip
* Remove signature checks, but maintain signatures for backwards compatibility
* Remove UI components related to certificates except for personal certificate for backwards compatibility
* Default to unsigned containers (*.kdbx)
2021-12-14 23:23:23 -05:00
Lorenzo Tucci
c88d8c870f Add lock selected database action on toolbar
Closes #6445

Switch tab when locking a database and move Lock Database actions to the Database section of the toolbar.
2021-12-12 23:40:59 -05:00
Daniel Peshev
456726556d Add url field to download favicon 2021-12-12 12:32:11 -05:00
varjolintu
12d16f67ae Download favicon in the background after credential add 2021-12-12 08:14:14 -05:00
Geert Ijewski
d16fc2d62a Add db statistic output to CLI db-info command.
Closes #6920
2021-12-08 23:41:05 -05:00
mckeema
6c4a82bd51 Make selected text copyable instead of copying password
* Fixes 7209
2021-12-08 19:39:51 -05:00
Patrick Klein
a0a063b57f
Add -i/--include option to "generate" CLI command. (#7112) 2021-12-07 23:40:09 -05:00
evgfilim1
b3896f2600 Add simple detection of timestamp resolution
Set access time equal to modification time
2021-12-03 12:07:18 -05:00
Toni Spets
606096278b Auto-Type: Remember previous selected global match
This makes using multi-stage login forms slightly easier as you
can avoid typing the search terms multiple times.
2021-11-26 10:31:20 -05:00
Toni Spets
2fb1c076d4 SSH Agent: Show correct error messages in main window
Fixes #7152
2021-11-24 22:37:28 -05:00
tenzap
dc7ad6c1b7
Fix syntax issue & add a missing header (#7160)
* Fix syntax to prevent compilation issue

Fix build failure with AppleClang 7 & 8.

Error was:
src/core/CustomData.cpp:30:41: error: default initialization of an object of const type 'const CustomData::CustomDataItem' without a user-provided default constructor
static const CustomData::CustomDataItem NULL_ITEM;
                                        ^
                                                 {}
src/core/Metadata.cpp:32:39: error: default initialization of an object of const type 'const Metadata::CustomIconData' without a user-provided default constructor
static const Metadata::CustomIconData NULL_ICON;
                                      ^

src/core/Metadata.cpp:32:48: note: add an explicit initializer to initialize 'NULL_ICON'
static const Metadata::CustomIconData NULL_ICON;
                                               ^
                                               {}

* Add missing QUuid header

Fixes this compilation issue with LLVM clang 9, possibly also due to an old QT5

tests/TestTools.cpp:96:39: error: incomplete type 'QUuid' named in nested name specifier
    auto validUuid = Tools::uuidToHex(QUuid::createUuid());
                                      ^~~~~~~
/opt/local/libexec/qt5/lib/QtCore.framework/Headers/qmetatype.h:1887:1: note: forward declaration of 'QUuid'
QT_FOR_EACH_STATIC_CORE_CLASS(QT_FORWARD_DECLARE_STATIC_TYPES_ITER)
^
/opt/local/libexec/qt5/lib/QtCore.framework/Headers/qmetatype.h:108:18: note: expanded from macro 'QT_FOR_EACH_STATIC_CORE_CLASS'
    F(QUuid, 30, QUuid) \
                 ^
tests/TestTools.cpp:101:40: error: incomplete type 'QUuid' named in nested name specifier
    auto nonHexUuid = Tools::uuidToHex(QUuid::createUuid()).replace(0, 1, 'p');
                                       ^~~~~~~
/opt/local/libexec/qt5/lib/QtCore.framework/Headers/qmetatype.h:1887:1: note: forward declaration of 'QUuid'
QT_FOR_EACH_STATIC_CORE_CLASS(QT_FORWARD_DECLARE_STATIC_TYPES_ITER)
^
/opt/local/libexec/qt5/lib/QtCore.framework/Headers/qmetatype.h:108:18: note: expanded from macro 'QT_FOR_EACH_STATIC_CORE_CLASS'
    F(QUuid, 30, QUuid) \
                 ^
2021-11-24 22:36:31 -05:00
tenzap
61e378077e
Fix compilation on macOS when clang < 9 or Qt < 5.12 (#7117)
* fix compilation on Qt not having QOperatingSystemVersion::MacOSBigSur

The code uses 'QOperatingSystemVersion::MacOSBigSur' which doesn't exist
in all Qt versions (it has been backported to Qt 5.12.10+ & 5.15.1+ only).
On older macos systems like El Capitan the last supported
version of Qt is 5.11

This will fix compilation issue on such older systems and on systems
running with Qt not supporting QOperatingSystemVersion::MacOSBigSur

Compilation error was:
error: no member named 'MacOSBigSur' in 'QOperatingSystemVersion'

* Fix compilation when osx <= 10.9

* AppKitImpl.mm: button property is new in 10.10. It is used for a feature of
  KeePassXC that is only available from 10.17 onwards. So we don't need it when
  compiling on <= 10.9
error: property 'button' not found on object of type 'NSStatusItem *'
        NSString* appearance = [dummy.button.effectiveAppearance.name lowercaseString];
                                      ^

* The code uses @available syntax which is supported by
  AppleClang >= 9 or LLVM >= 5.
  We check __clang_major__ to allow compilation on older versions
  of macOS that don't have a recent clang. For example on El Capitan.

* Fix compilation when osx <= 10.8

* AppKitImpl.mm: AXIsProcessTrustedWithOptions exists from 10.9 onwards
error: use of undeclared identifier 'kAXTrustedCheckOptionPrompt'
error: use of undeclared identifier 'AXIsProcessTrustedWithOptions'

* Fix compilation when osx <= 10.7

* MacUtils.cpp: CoreGraphics exists from 10.8 onwards only, capslock detection
  feature would have to be implemented on OSX <= 10.7

* AppKitImpl.mm: CGDisplayStreamRef exists from 10.8 onwards only. It is used for a
  feature of KeePassXC that is only available from 10.15 onwards. So we don't need it
  when compiling on <= 10.7
error: unknown type name 'CGDisplayStreamRef'

* AppKitImpl.mm: Syntax is not understood by 10.7, update it to be understandable
  by <= 10.7
error: expected method to read dictionary element not found on object of type 'NSDictionary *'
    NSRunningApplication* app = userInfo[NSWorkspaceApplicationKey];
                                ^

* The code uses @available syntax which is supported by
  AppleClang >= 9 or LLVM >= 5.
  We check __clang_major__ to allow compilation on older versions
  of macOS that don't have a recent clang.

* Fix compilation error on OS X 10.11

src/core/Alloc.cpp:44:10: error: no type named 'free' in namespace 'std'
    std::free(ptr);
    ~~~~~^

This is a regression, since it was fixed in [1]

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

[1] 7c6c027d33
[2] https://en.cppreference.com/w/cpp/memory/c/free

* fix compilation when macos SDK <= 10.14

These methods are only available from macOS 10.15
  - kSecAccessControlWatch
  - LAPolicy.deviceOwnerAuthenticationWithBiometricsOrWatch

The code uses @available syntax which is supported by
AppleClang >= 9 or LLVM >= 5.
We check __clang_major__ to allow compilation on older versions
of macOS that don't have a recent clang.
2021-11-24 22:35:38 -05:00
Patrick Sean Klein
296cbf0df7 Add sorting of HTML export
- Closes #6164
- Implement sorting support in HtmlExporter
- Add ExportDialog class and UI, which allows to configure export options.
2021-11-24 00:12:13 -05:00
Janek Bevendorff
a3dc977e58 Correctly set KDBX envelope version
Shows a warning when trying to open with a newer minor version than what is currently supported.

We always try to save with the lowest KDBX version possible for maximum compatibility.
2021-11-22 12:58:04 +01:00
Janek Bevendorff
67603ab42e Retain number of rounds when auto-upgrading KDBX version 2021-11-22 12:58:04 +01:00
Janek Bevendorff
c872e406ed Upgrade to KDBX 4 if new 4.1 features are used 2021-11-22 12:58:04 +01:00
Janek Bevendorff
835e31ac3c Implement KDBX 4.1 CustomData modification date
We keep the old merging behaviour for now, since deleting a
CustomData entry does not create DeletedObject.
2021-11-22 12:58:04 +01:00
Janek Bevendorff
390e14b2c6 Implement KDBX 4.1 extended custom icons 2021-11-22 12:58:04 +01:00
Janek Bevendorff
70e62d90db Add "Restore Entries" feature 2021-11-22 12:58:04 +01:00
Janek Bevendorff
e5822974ac Implement KDBX 4.1 group tags 2021-11-22 12:58:04 +01:00
Janek Bevendorff
cd9ef58e98 Implement KDBX 4.1 PreviousParentGroup flag 2021-11-22 12:58:04 +01:00
Janek Bevendorff
ffaeac130f Implement KDBX 4.1 PasswordQuality flag 2021-11-22 12:58:04 +01:00
ADD-SP
e5065a01c8 Fix crash while downloading favicons 2021-11-13 23:18:47 -05:00
Jonathan White
c37e2d3d69 Fix entry preview resetting when focusing out of entry view
* Fixes #7061
* This bug impacts linux only when clicking in the preview panel.
2021-11-13 23:17:30 -05:00
louib
004f2b6801 Removing QWidget dependency from src/core. 2021-11-12 07:41:30 -05:00
Jonathan White
6f5bbf7ad1
Fix database save calls in CLI due to backup path 2021-11-07 17:52:23 -05:00
Patrick Klein
84ff6a13f9
Allow specifing database backup paths. (#7035)
- Default backupFilePath is '{DB_FILENAME}.old.kdbx' to conform to existing standards
- Implement backupPathPattern tests.
- Show tooltip on how to format database backup location text field.
2021-11-07 17:41:17 -05:00
Andre Blanke
7d37f65ad0 CLI: Add commands to handle attachments
* Add commands to manipulate entry attachments from the CLI
* Closes #4462

* Add the following commands:
  attachment-export: Exports the content of an attachment to a specified file.

  attachment-import: Imports the attachment into an entry. An existing attachment with the same name may be overwritten if the -f option is specified.

  attachment-rm: Removes the named attachment from an entry.

* Add --show-attachments  to the show command
2021-11-07 17:27:16 -05:00
snipfoo
7811f10dba
Support for wordlists in user configuration directory (#6799)
This commit allows users to put alternative wordlists in a `wordlists` subdirectory below their KeePassXC directory (e.g., under Linux, `~/.config/keepassxc/wordlists`). These wordlists will then appear in the dropdown menu in the *Password Generator* widget.

In order to differentiate between lists shipped with KeePassXC and user-provided lists, the former appears with a (SYSTEM) prefix.
2021-11-04 23:02:33 -04:00
Sami Vänttinen
bb88ad6e8c
Add Microsoft Edge support for Linux (#7100) 2021-11-04 23:02:02 -04:00
Toni Spets
3b1acd0831
Auto-Type: Reimplement X11 keysym emulation (#7098)
* Fix Regression since 4d07507

* Auto-Type: Workaround X server default keymap bug

If there's a system wide configuration through xorg.conf for a default keyboard layout and it's not updated by the WM/DE at startup the Xkb extension seems to be somewhat confused with XTEST and the layout somehow defaults to US ANSI.

Reading the keyboard description and writing it back without changes works around this.
2021-11-04 23:01:47 -04:00
Patrick Sean Klein
20db504c3a Implement "Overwrite attachment" confirmation dialog. 2021-10-24 23:41:57 -04:00
Sami Vänttinen
55f2bd41aa
Modify the KeePassHTTP attribute conversion button text (#7073) 2021-10-24 22:34:30 -04:00
varjolintu
dd41f093e6 Launch KeePassXC password generator popup from the extension
* Closes #6473
2021-10-24 10:24:17 -04:00
Aetf
2a9d92faeb
FdoSecrets: reject setting refs via the API (#7043)
* FdoSecrets: add TOTP as a readonly attribute

* FdoSecrets: reject setting fields containing refs, fixes #6802

It is still possible to set refs using KPXC UI.
2021-10-24 10:22:50 -04:00
Patrick Sean Klein
c8f135aaed Resolve references of entry attributes when exporting to HTML. 2021-10-24 10:21:35 -04:00
Jonathan White
9aa30c4e72
Fix building on macOS due to PCSC
* Fixes #7072
2021-10-23 17:07:29 -04:00
Aetf
8b6d0e4b12 Fix EntryView and PreviewView to automatically update when the model changes 2021-10-16 22:51:37 -04:00
Aetf
a31c5ba006 FdoSecrets: Implement unlock before search
Fixes #6942 and fixes #4443

- Return number of deleted entries
- Fix minor memory leak
- FdoSecrets: make all prompt truly async per spec and update tests
    * the waited signal may already be emitted before calling spy.wait(),
      causing the test to fail. This commit checks the count before waiting.
    * check unlock result after waiting for signal
- FdoSecrets: implement unlockBeforeSearch option
- FdoSecrets: make search always work regardless of entry group searching settings, fixes #6942
- FdoSecrets: cleanup gracefully even if some test failed
- FdoSecrets: make it safe to call prompts concurrently
- FdoSecrets: make sure in unit test we click on the correct dialog

Note on the unit tests: objects are not deleted (due to deleteLater event not handled).
So there may be multiple AccessControlDialog. But only one of
it is visible and is the correctly one to click on.

Before this change, a random one may be clicked on, causing the
completed signal never be sent.
2021-10-16 22:50:04 -04:00
varjolintu
b6716bdfe5 Add Browser Integration to Group Edit page
Closes #1789 and closes #3998
2021-10-11 00:19:06 -04:00
varjolintu
c7cdce6e33 Support for triggering Global Auto-Type from browser extension 2021-10-10 23:41:58 -04:00
mhmdanas
be6835e42f Cleanup PCSC interface code
Fixes #7025
2021-10-09 14:41:26 -04:00
Chih-Hsuan Yen
3b3bc42e10
Fix broken browser integration since #6899 (#7030) 2021-10-09 11:22:44 -04:00
Jonathan White
f2aa32c7b0 Add direct write save option
* Closes #6335
* Modify application settings presentation to  allow for alternative saving strategies
* Transition Database::save calls to using flags to control saving behavior. Reduces boolean flags on function call.
* Made direct write save option a local setting to prevent unintentional carry over between platforms.
2021-10-09 11:12:25 -04:00
Jonathan White
484bc5dd01 Fix infinite save bug when saving fails
* Introduced in #6438, modified signal is not blocked at the Database level when emitting is blocked. This causes infinite saving to occur when Always Save After Every Change is enabled.
2021-10-09 11:12:25 -04:00
Jonathan White
d82abf0be5 Correct naming of newly generated keyx files
Fixes #6040
2021-10-03 07:32:03 -04:00
Gaurav Pruthi
6c18b10979
Place the 'Recycle Bin' at the bottom of the list when groups are sorted. (#7004)
Co-authored-by: Gaurav Pruthi <gaurav.pruthi@oracle.com>
2021-10-02 02:55:42 -04:00
osx user
2514c1d5c5 feature/AutoTypeTOTP 2021-10-02 00:04:03 -04:00
snipfoo
e660802fac
Add support for Diceware wordlists in numbered and/or PGP-signed formats (#6791)
This allows one to directly use Diceware-compatible wordlists without having to convert the file to the plain wordlist format.

The accepted formats are described in the Diceware documentation:
https://diceware.readthedocs.io/en/stable/wordlists.html
2021-10-02 00:01:04 -04:00
Aetf
60cfba8e46
FdoSecrets: Improve client executable path handling (#6915)
* Fixes #6459 

Improves the overall handling of FdoSecrets showing client executable paths to the user. It does the following:

* Check executable file existence as described in [RFC] fdosecrets: add optional confirmation to secret access (#4733)
* Show application PID and dbus address in the client list
* When the executable file is inaccessible, depending on where the client name is shown:
    * when shown inline, e.g. in notification text, where space is limited, clearly say that the path is invalid
    * when shown in auth dialog, show warning and print detailed info about the client
    * when shown in the client list, draw a warning icon

Co-authored-by: Jonathan White <support@dmapps.us>
2021-10-01 18:22:15 -04:00
Toni Spets
860fcfd78d SSH Agent: Add support for OpenSSH 8.2 FIDO/U2F keys
Closes #4334
2021-10-01 16:25:14 -04:00
Toni Spets
c07a57d141 SSH Agent: Template reading key parts
This is a prerequisite for security key backed keys.
2021-10-01 16:25:14 -04:00
Toni Spets
6ded326de7 SSH Agent: Store raw key data as complete blobs
This is a prerequisite for security key backed keys.
2021-10-01 16:25:14 -04:00
Jonathan White
1dbec40be9 Add countdown progress bar to TOTP preview
* Close #6556
2021-10-01 15:35:42 -04:00
Gaurav Pruthi
405d3ee1ca
Add feature to sort groups using shortcut keys (#6999)
* Register Ctrl + Down to sort A->Z and Ctrl + Up to sort Z->A
2021-10-01 10:54:15 -04:00
Christoph Honal
6d1fc31e96
Implement support for Yubikeys and potential other tokens via wireless NFC using smartcard readers (Rebase) (#6895)
* Support NFC readers for hardware tokens using PC/SC

This requires a new library dependency: PCSC.
The PCSC library provides methods to access smartcards. On Linux, the third-party pcsc-lite package is used. On Windows, the native Windows API (Winscard.dll) is used. On Mac OSX, the native OSX API (framework-PCSC) is used.

* Split hardware key access into multiple classes to handle different methods of communicating with the keys.

* Since the Yubikey can now be a wireless token as well, the verb "plug in" was replaced with a more
generic "interface with". This shall indicate that the user has to present their token to the reader, or plug it in via USB.

* Add PC/SC interface for YubiKey challenge-response

This new interface uses the PC/SC protocol and API
instead of the USB protocol via ykpers. Many YubiKeys expose their functionality as a CCID device, which can be interfaced with using PC/SC. This is especially useful for NFC-only or NFC-capable Yubikeys, when they are used together with a PC/SC compliant NFC reader device.

Although many (not all) Yubikeys expose their CCID functionality over their own USB connection as well, the HMAC-SHA1 functionality is often locked in this mode, as it requires eg. a touch on the gold button. When accessing the CCID functionality wirelessly via NFC (like this code can do using a reader), then the user interaction is to present the key to the reader.

This implementation has been tested on Linux using pcsc-lite, Windows using the native Winscard.dll library, and Mac OSX using the native PCSC-framework library.

* Remove PC/SC ATR whitelist, instead scan for AIDs

Before, a whitelist of ATR codes (answer to reset, hardware-specific)
was used to scan for compatible (Yubi)Keys.
Now, every connected smartcard is scanned for AIDs (applet identifier),
which are known to implement the HMAC-SHA1 protocol.

This enables the support of currently unknown or unreleased hardware.

Co-authored-by: Jonathan White <support@dmapps.us>
2021-10-01 10:39:07 -04:00
Janek Bevendorff
d375ad14d7 Rename translation files 2021-09-28 15:50:27 +02:00
Joan Bruguera
e6bf8463d9 Fix unlocking multiple databases with pw-stdin when input is a pipe
This works:

```
$ keepassxc test1.kdbx test2.kdbx --pw-stdin
Database password: <manual input 1234>
Database password: <manual input 4321>
```

But this doesn't (only `test1.kdbx` is unlocked):

```
$ printf '%s\n' 1234 4321 | keepassxc test1.kdbx test2.kdbx --pw-stdin
Database password:
Database password:
```

The problem is that `Utils::setDefaultTextStreams()` is called multiple times
when unlocking multiple databases with `--pw-stdin`, which appears to break the
pipe. Simply call it once to avoid the problem.

Fixes: #5012 (as far as I can tell by simulating the script in Linux)
Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
2021-09-28 07:05:50 -04:00
osx user
486779cce7 updateViewStateSync 2021-09-28 06:40:33 -04:00
Janek Bevendorff
a46231a39a
Fix tests on macOS and update coverage config (#6945)
Simplifies coverage generation and uses llvm-cov instead of gcov if
compiler is clang.
2021-09-26 12:35:42 +02:00
jus78help
eeba485f95 Removed unnecessary characters from HEX excluded chars
The HEX button automatically unselects `selectBoxLower` therefore there is no need to also add `ghijklmnopqrstuvwxyz` in the excluded characters text field.
2021-09-21 19:05:47 -04:00
varjolintu
4c10e516c3 Add delete-entry command to Browser Integration API 2021-09-21 04:17:14 -04:00
m5w6
9aec84dee7 Add "parent directory match" priority between exact and host match 2021-09-20 23:53:31 -04:00
Benjamin K
34ed63f495 Add Apple Watch support to quick unlock
* Allow using a paired Apple Watch to authenticate to the secrets store in addition to TouchID.
* Closes #5337
2021-09-20 22:59:17 -04:00
smlu
0c6587b5b7 Add support for Microsoft Visual Studio buildchain
* Use C++17 when using MSVC compiler
* Remove unneeded header files and macros
* Removed unnecessary Yubikey cmake file
* Enhance release tool
* Updated INSTALL.md
2021-09-19 17:16:45 -04:00
Jonathan White
e6798112be
Fix shadowed variables in zxcvbn 2021-09-06 22:44:55 -04:00
Jonathan White
470129091a
Fix error in X11Funcs code 2021-09-06 22:36:56 -04:00
Jonathan White
b37dbe7dd5 Improve Yubikey USB API
* Allow for multiple vendor ID's to be checked at once. This allows for the use of one tracking index, streamlining KPXC code.
* Remove support for libusb 0.x on Linux
* Better handling of USB errors during initial key query. Output warnings to console.
2021-09-05 09:11:04 -04:00
Jonathan White
6e27dd8db5 Initial ykcore import into code base 2021-09-05 09:11:04 -04:00
Jonathan White
0450bf3487 Fix hiding main window after browser unlock request
* The main window doesn't hide properly during unlock sequence if it is in the background (ie, not minimized and not hidden to tray). This change makes sure the window hides after interaction on all platforms.
2021-08-29 16:02:40 -04:00
Allen Wild
53dcafaa58 Allow selecting any open database in unlock dialog
* Closes #2322

* Show locked databases in tabbed interface in unlock dialog for browser and auto-type workflows.

* Make the DatabaseOpenDialog window Application-Modal so that it blocks input to the main UI when the dialog is open. This reduces corner cases by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.
2021-08-29 16:02:40 -04:00
Paul Colby
37d29b5e8c
Display Database created timestamp in database reports (#6876)
* Fixes #6356
2021-08-29 15:34:16 -04:00
Robin Ebert
e8f2c9d126 CLI: Replace locate command with search
* Introduce search CLI command to replace locate command. Search can provide the same functionality but in a more fine-grained fashion

* Replace use of Group::locate in code: Use EntrySearcher in clip cli command best-match option. This removes the matching against group hierarchy of an entry which is kind of nonsense as clip expects exactly one match. Matching against groups can be done using search command.

* Remove obsolete Group::locate method
2021-08-22 19:23:16 -04:00
louib
ec81d2bc3f Moving CsvParser to format/ 2021-08-22 18:30:43 -04:00
Hongmou Zhang
d2c74340a3 Add option to use both Pageant and OpenSSH agent on Windows 2021-08-22 18:30:32 -04:00
varjolintu
250cd1933c Handle tilde with custom paths 2021-08-22 18:30:18 -04:00
Jonathan White
986fa42ca8 Fix unreadable buttons in attachments widget
* Fix #6648
2021-08-22 17:09:21 -04:00
Janek Bevendorff
3a1560d2f6 Enable more convenient attachment renaming by clicking selection
Fixes #1695
2021-08-22 17:09:21 -04:00
Janek Bevendorff
93f0fef1e1 Improve and secure attachment handling (fixes #2400).
Externally opened attachments are now lifecycle-managed properly.

The temporary files are created with stricter permissions and entirely
random names (except for the file extension) to prevent meta data leakage.

When the database is closed, the files are overwritten with random
data and are also more reliably deleted than before.

Changes to the temporary files are monitored and the user is asked
if they want to save the changes back to the database (fixes #3130).

KeePassXC does not keep a lock on any of the temporary files, resolving
long-standing issues with applications such as Adobe Acrobat on Windows
(fixes #5950, fixes #5839).

Internally, attachments are copied less. The EntryAttachmentsWidget
now only references EntryAttachments instead of owning a separate copy
(which used to not be cleared properly under certain circumstances).
2021-08-22 17:09:21 -04:00
hollow-owl
af9eb6d6b1 Select entry above deleted entry
* Fix #6304 - Don't cause the list view to scroll to the top when deleting any entry in the list.
2021-08-22 17:08:29 -04:00
osx user
746276edea Enhance last used directory settings
* Use hash based storage for last used directories instead of a key/value for each type
* Explicitly declare certain operations as sensitive and follow the "Remember Last Database" setting for those.
* Introduce database backup directory location (close #6619)
2021-08-22 16:47:42 -04:00
louib
5e68cd2fa2 Abort CLI open on error 2021-08-16 01:13:51 -04:00
Julius Zint
38a60df40b Set the MIME-Type to text/plain when using wl-copy on wayland. If
unset, wl-copy will try to guess the MIME-Type based on the data.
For some reason this did not work on my machine and i was unable
to paste passwords in Firefox.
2021-08-15 22:51:17 -04:00
Stuzer05
304cb44d0d Add group clone action
Close #3796
2021-08-08 16:54:10 -04:00
Chih-Hsuan Yen
bc5d0df19e
Fix removing encrypted ASN.1 keys from ssh-agent (#6804)
Contents of id_rsa-encrypted-asn1 are from
TestOpenSSHKey::testDecryptRSAAES128CBC().

Closes #6788
2021-08-08 09:36:06 -04:00
shemeshg
089c8df01d
Add missing QFileInfo include 2021-07-16 16:19:33 +02:00
Jonathan White
9b2b861a2a Removed / Consolidated unnecessary header files 2021-07-13 22:08:33 -04:00
peter
6b14b5dc27 Optimize includes across code base 2021-07-13 22:08:33 -04:00
Jonathan White
7cb2991a13
Trim TOTP key input of whitespace prior to processing
* Fixes #6599
2021-06-11 22:49:45 -04:00
Jonathan White
6a8b070b0a
Resolve compiler warnings for unused return values
* Fixes #1932 - See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425#c29

Adding a negation before the function call allows the (void) syntax to work properly.
2021-06-11 22:49:39 -04:00
Janek Bevendorff
25a34a66e1 Fix compilation on macOS 2021-06-08 18:56:22 -04:00
Jonathan White
11afd73117
Correct macOS window activation from hidden state (#6575)
* Fix #6234 - properly set NSApplication activation policies when the window is hidden and shown
2021-06-01 06:19:47 -04:00
Jonathan White
33bf6eb892
Retain file creation time when saving database (#6576)
* Fix #6028
2021-05-31 22:22:50 -04:00
Xavier Valls
6acd0b25ae
Add a context menu entry to delete entries from health check reports (#6537)
* Closes #4986 - Allow deleting entries from the reports view
* Closes #4533 - Exclude & delete multiple entries in a report
* Also allow deleting selected entries using the delete key
* Introduce GuiTools namespace to collect shared GUI prompts and actions
* Add functionality to HIBP report to mirror health check report

Co-authored-by: Jonathan White <support@dmapps.us>
2021-05-31 10:40:20 -04:00
Jonathan White
44954fc0ac
Make "Always on top" a local setting 2021-05-29 12:49:23 -04:00
Xavier Valls
64cb1553d0 Add a button to reveal protected attributes in entry preview
Closes #1930
2021-05-29 12:22:50 -04:00
Aetf
81a66c439c
Properly block modified signal during Database destruction (#6438)
fixes #6393
2021-05-27 21:50:15 -04:00
Xavier Valls
66c3026cf5
Add a checkbox to health report allowing to exclude expired entries (#6534)
* Fixes #5032
2021-05-22 13:16:47 -04:00
Jonathan White
fd0bdaae80 Fix challenge-response key data after Botan
* Fix #6420
* Refactor Challenge-Response key files to be more streamlined. Added a test to confirm raw key data is accurate.
2021-05-19 22:36:30 -04:00
wundrweapon
60adcacaaa
Add command line option to lock open databases (#6511)
Closes #6126
2021-05-15 09:48:59 -04:00
Lukas Rytz
cc6f5c3226 MinimizeAfterUnlock also when unlocking through browser
The MinimizeAfterUnlock setting added in #3439 closes the main window
after unlock. However, when the unlock is triggered through
KeePassXC-Browser, a password dialog is shown on top of the main window
and the main window remains open after the unlock. This is fixed
in this commit.
2021-05-15 09:45:26 -04:00
Jonathan White
8c61a73bb0 Show search bar when toolbar is hidden or overflow
* Fix #505 - always show the search bar when the search keyboard shortcut is pressed. If the toolbar is in overflow, the toolbar will be expanded automatically and search focused. If the toolbar is hidden it will be shown and expanded if necessary. When searching is canceled or the down arrow is pressed (to select the first entry) the toolbar will be set back to it's previous configuration.
2021-05-15 09:11:38 -04:00
Xavier Valls
e1c8304c4b
Fix unreachable setting of file permissions (#6514)
Fixes #6080
2021-05-15 09:11:19 -04:00
Stefan Sundin
ee92b980bb
Set permissions of saved attachments to be private to the current user (#6363) 2021-05-12 23:20:41 -04:00
Jonathan White
17326dc3ec Auto-Type: Resolve username/password when copying to clipboard
* Fix #3882
* Add nullptr checks as well
2021-05-12 23:15:49 -04:00
Xavier Valls
64279bb881 Fix showing preview notes in an entry without notes
Fixes #6461
2021-05-08 17:35:37 -04:00
Jonathan White
8a7be101e4 CLI Improvements
* Fix #6001 - only use `--notes` in Add/Edit commands to prevent clash with password generator option `-n`.

* Fix #6119 - Send Unicode to clip command; Windows only understands UTF-16 encoding.

* Fix #6128 - `clip` command will default to clearing the clipboard after 10 seconds. To disable clearing set timeout to 0.
2021-04-25 07:38:21 -04:00
Jonathan White
be3e77d721 Cleanup CLI includes across all components
* Remove unused include files
* Move includes out of widely shared headers (reduced rebuild time)
* Consolidate code for Analyze command
2021-04-25 07:38:21 -04:00
Martin Mokrejs
dc496fd1d9 Better description text for Key File change dialog 2021-04-24 13:47:28 -04:00
Xavier Valls
01d86760e0
Allow resizing of reports table columns (#6435)
* Fix #5678

Co-authored-by: Jonathan White <support@dmapps.us>
2021-04-24 11:36:15 -04:00
Xavier Valls
7b7f52c8af
Introduce security option to enable copy on doubleclick (#6433)
* Fix #1575 - option is disabled by default
2021-04-24 11:35:01 -04:00
Jonathan White
5c709f0da3 Auto-Type: Increase max inter-type delay to 500 ms 2021-04-24 09:31:46 -04:00
Xavier Valls
c0ae130656
Add CTRL+Enter to apply password generator changes (#6414)
* Fixes #6111
2021-04-18 22:37:12 -04:00
Xavier Valls
7fe0e2629c Allow the Group column to be toggled for entry view
This allows to show/hide the group column both in normal and search
mode, finding a compromise for issue #6163
2021-04-18 22:32:24 -04:00
Toni Spets
805574cac1
Update YubiKey stub implementation for Botan (#6370)
Co-authored-by: Jonathan White <support@dmapps.us>
2021-04-09 07:56:57 -04:00
Toni Spets
31aa5e12e5 Auto-Type: PageUp/PageDown scrolling for entries
Fixes #4530
2021-04-08 20:00:40 -04:00
Toni Spets
9b8feed3ed SSH Agent: Use database location to resolve relative key file path
Closes #5225
2021-04-06 23:39:02 -04:00
Jonathan White
ed0ece304d Reorder startup sequence to display debug information early 2021-04-05 22:56:03 -04:00
Jonathan White
80809ace67 Replace all crypto libraries with Botan
Selected the [Botan crypto library](https://github.com/randombit/botan) due to its feature list, maintainer support, availability across all deployment platforms, and ease of use. Also evaluated Crypto++ as a viable candidate, but the additional features of Botan (PKCS#11, TPM, etc) won out.

The random number generator received a backend upgrade. Botan prefers hardware-based RNG's and will provide one if available. This is transparent to KeePassXC and a significant improvement over gcrypt.

Replaced Argon2 library with built-in Botan implementation that supports i, d, and id. This requires Botan 2.11.0 or higher. Also simplified the parameter test across KDF's.

Aligned SymmetricCipher parameters with available modes. All encrypt and decrypt operations are done in-place instead of returning new objects. This allows use of secure vectors in the future with no additional overhead.

Took this opportunity to decouple KeeShare from SSH Agent. Removed leftover code from OpenSSHKey and consolidated the SSH Agent code into the same directory. Removed bcrypt and blowfish inserts since they are provided by Botan.

Additionally simplified KeeShare settings interface by removing raw certificate byte data from the user interface. KeeShare will be further refactored in a future PR.

NOTE: This PR breaks backwards compatibility with KeeShare certificates due to different RSA key storage with Botan. As a result, new "own" certificates will need to be generated and trust re-established.

Removed YKChallengeResponseKeyCLI in favor of just using the original implementation with signal/slots.

Removed TestRandom stub since it was just faking random numbers and not actually using the backend. TestRandomGenerator now uses the actual RNG.

Greatly simplified Secret Service plugin's use of crypto functions with Botan.
2021-04-05 22:56:03 -04:00
Jonathan White
86ddd702fb Use application font size when setting default or monospace fonts
* Fix #6286
2021-04-03 11:29:54 -04:00
Jonathan White
871c4fffdd OPVault: Use Text instead of Name for attribute and section names
* Fix #6303 - the text attribute in 1Password contains the actual text seen in 1Password whereas the name attribute may contain a ref pointer and not a name.
2021-04-01 22:59:44 -04:00
Toni Spets
ca8abecc4b Auto-Type: Abort keystroke if modifiers held on X11
Releasing lock modifiers during Auto Type does not work reliably
on X11 and can cause some modifiers to get stuck and more precisely
layout switching can get stuck.

Instead of trying to find out what modifiers to release we can just
abort when the user is holding modifiers that may affect the typing
sequence.

Fixes #6350
2021-04-01 22:58:33 -04:00
Toni Spets
371bd2e51b
Auto-Type: Shortcuts for selection dialog (#6361)
* Shortcut to toggle search all entries
* Select first match only when we have a window match

When we default to full database search it's possible the user would select the first match without by accident.

In this case when our query is empty we don't select anything and you need to either type something or press down to select the first item.

* Added username, password, and TOTP keyboard shortcuts and a help tip

* Closes #6176

Co-authored-by: Jonathan White <support@dmapps.us>
2021-03-31 23:27:56 -04:00
Sami Vänttinen
c19efb5b19
Remove credential sorting from Browser Integration (#6353) 2021-03-31 23:14:29 -04:00
ByteHamster
439c155552
Show countdown for clipboard clearing (#6333)
* Closes #1843

Co-authored-by: Jonathan White <support@dmapps.us>
2021-03-31 23:12:59 -04:00
Toni Spets
8c9530e3ec Auto-Type: Allow actions to fail and be retried
AutoTypeActions are required to return a result object with
information if they can be retried or not. An error string is
also provided to show a user friendly message why said action did
not succeed if even after retries it keeps failing.

This is a prerequisite for waiting for modifier keys to be released
on X11.
2021-03-31 21:20:51 -04:00
Toni Spets
4d07507739 Auto-Type: Support multiple Xkb layouts
Completely rewritten XCB Auto-Type keymap system.

 - supports multiple simultaneous layouts
 - prefers current layout if it has all keysyms available
 - removed hardcoded KeySymMap
 - removed clunky custom KeySym emulation

Biggest breaking change is removing KeySym emulation for keys that
do not exist in any of the layouts currently in use. It would be
possible to make it work but if you are trying to type syms that
are not available in any of your layouts you are abusing it. It
also adds unnecessary complexity and opens up timing issues when
the keymap is modified on-the-fly. Now we are just reading it.

This also workarounds a Qt related issue where QX11Info::display()
returns a connection to X server that fails to receive updated
keymap data when client settings change. We use our own connection
now to get it working.
2021-03-26 06:16:37 -04:00
Guillaume Turchini
8b8fb9562f Allow CSV import of bare TOTP secrets
Fixes #6167
2021-03-08 21:53:51 -05:00
Chih-Hsuan Yen
e29cf8bfef Make KeePassXC start after the system tray is available on LXQt 2021-03-08 21:51:58 -05:00
mantlabs
d6b69204a6 Persist Always on Top setting 2021-03-07 11:27:28 -05:00
Jonathan White
bc08913c61 Auto-Type: Allow selection of modal dialogs on X11
* Fix #5958 - Modal dialogs do not have WM_STATE set even though they are a valid top-level window with a valid name. In this case, we need to poll for WM_TRANSIENT_FOR which returns the top level window the dialog is a child of.
2021-03-05 18:06:30 -05:00
Patrick Klein
57af7c131d Fix favicon download from URL with non-standard port.
Fixes #5001.

The favicon download URL was constructed from scheme and host only. This is fixed by simply replacing the path of the original URL with "/favicon.ico", thus keeping scheme, host, auth and port intact.

Further modification: URL's with a non-http schema are now rejected.
2021-03-01 21:42:19 -05:00
Jonathan White
6c7b04fee8
Revert zxcvbn changes from f3d88f 2021-03-01 20:57:08 -05:00
Bernhard Kirchen
4e8b00da34 Add custom icon purging and bulk deletion
This change adds a new database settings widget 
named "maintenance", using a wrench icon. This widget is designated to be the home for database related maintenance tasks. 

Initially, managing custom icons is now possible from that new tab. The feature includes bulk removing of
any number of selected custom icons and automatic purging of unused custom icons by the click of a button.

Fixes #2110
2021-02-27 08:13:05 -05:00
Jonathan White
b9ea6fd2e7 Show sort indicators on fixed width columns 2021-02-26 22:10:04 -05:00
Ojas Anand
022154462e Add entry view column for password strength
* Closes #4216

Reduced to three-tiered rating system and fixed column implementation. Hide password strength indicator in entry view if excluded from reports.

Introduce password health caching to prevent unnecessary calculations.
2021-02-26 22:10:04 -05:00
Bernhard
c9c19d043f KeeShare: Default to unsigned container unless specifically chosen
*Fix #6081 - Prevent assert and crash due to user entered data
2021-02-26 14:24:22 -05:00
Brandon Atkinson
c5a2aa0a2a Exclude additional lookalike characters (6G8B)
* Fix #6075
2021-02-25 21:36:30 -05:00
Jesse Ruth
2d66786656
Update MainWindow minimum size to enable smaller verticle space (#6149) 2021-02-24 23:11:33 -05:00
Toni Spets
46f5596e59
Initialize Application before parser arguments (#6177)
Co-authored-by: Jonathan White <support@dmapps.us>
2021-02-24 23:10:13 -05:00
Jonathan White
8d058cbd04
Additional Auto-Type improvements based on PR feedback
* Improve documentation and remove external links to keepass.info documentation
2021-02-22 07:41:23 -05:00
Jonathan White
02446af743
Auto-Type support for T-CONV, T-REPLACE-RX, and Comments
* Close #1825 - Add full support for T-CONV and T-REPLACE-RX placeholders. Exception is support for the "raw" type in T-CONV.

* Close #5333 - Allow comment syntax to be present in the Auto-Type sequence
2021-02-22 07:41:23 -05:00
Jonathan White
813ab47e29
Implement Auto-Type {PICKCHARS}
* Closes #725

Support Auto-Type {PICKCHARS} placeholder. Open a dialog that lets you pick characters of an entry's password by their position. Supports typing {TAB} in between characters to move between fields (if necessary). Also supports using arrow keys to quickly navigate around the choice grid.
2021-02-22 07:41:23 -05:00
Jonathan White
027ff9f2bf
Overhaul Auto-Type Action Handling
* Close #2603 - Add support for modifier syntax (+, ^, and %)
* Fix #2633 - Allow reference syntax {REF:...} in Auto-Type sequences
* Close #5334  - Tell the user which part of the Auto-Type sequence is invalid for easy correction
* Fix #2401 - Select the right window on macOS prior to starting Auto-Type

* Allow for nested placeholders
2021-02-21 16:33:54 -05:00
Jonathan White
d9ae449f04
Improve Auto-Type Select Dialog
Significant improvements to the Auto-Type select dialog. Reduce stale and unnecessary code paths.

* Close select dialog when databases are locked.
* Close open modal dialogs prior to showing the Auto-Type select dialog to prevent interference.
* Never perform Auto-Type on the KeePassXC window.
* Only filter match list based on Group, Title, and Username column data (ie, ignore sequence column)
* Always show the sequence column (revert feature)
* Show selection dialog if there are no matches to allow for a database search

* Close #3630 - Allow typing {USERNAME} and {PASSWORD} from selection dialog (right-click menu).
* Close #429 - Ability to search open databases for an entry from the Auto-Type selection dialog.
* Fix #5361 - Default size of selection dialog doesn't cut off matches
2021-02-21 16:33:54 -05:00
Jonathan White
7ce35f81de
Cleanup entry level Auto-Type menu
* Show the sequence that will be typed when performing the default action
* Combine default sequence action with Username / Password options
* Fix #4939 - confirm prior to performing entry level auto-type if "Always Ask Before Auto-Type" is enabled
2021-02-21 16:33:54 -05:00
Jonathan White
f3d88fbd36 Address translation feedback from Transifex 2021-02-19 18:37:33 -05:00
Jonathan White
4f7460afbd Refactor Key Component Widgets for translations
* Ensure full labels are applied to buttons instead of splitting the Add/Change/Remove from the component name.
2021-02-19 18:37:33 -05:00
farnbacher
75e4329c80
use save method if new (and existing) created entry has unsaved
changes
2021-02-12 21:32:50 -05:00
Janek Bevendorff
af55d1b1b3 Use macdeployqt for all executables
Since Homebrew moved all its stuff to /opt/homebrew, our hard-coded
install_name_tool patch magic stopped working. This patch uses
macdeployqt for all executables to prevent this kind of behaviour.

Fixes #6042
2021-02-05 15:12:12 -05:00
smlu
a5094dd3ea Prevent screen capture on Windows and macOS
* Closes #5859
2021-02-05 15:10:54 -05:00
Aetf
9a8a5a0006
FdoSecrets: Major Refactor and Code Consolidation (#5747)
* Fixes #3837

* Change objects to use DBusMgr rather than separate adaptors
  - Update all DBus invokable methods to new parameter order
  - Change all usage of DBusReturn to simpler DBusResult
  - Use DBusMgr to handle path and service registration
  - Remove adaptor/*
  - Set path in DBusObject
  - Unregister service when service is destroyed
  - Restore handling of invalid QVariant in prompt complete signal
  - Clean up meta type registration
  - Move dbus related file together
  - Convert to QSharedPointer as much as possible
  - Fix mapping of the Delete method
  - Handle dbus property get all

* Add per-client states
  - Move cipher negotiation to DBusClient
  - Show list of clients instead of sessions in the settings page
  - Add settings for confirmation of accessing items
  - Fix infinite recursion when client disconnected
  - Use optional explicit DBusClient parameter instead. This makes accessing 
    the client info in an async context explicit, and thus prevent accidental 
    assertions in prompts.

* Improve User Interface
  - Add per-item access confirmation (if enabled)
  - Remove the "disable for site" button for the access control dialog
  - Improve the text on the settings page to be more consistent
  - Fix disconnect buttons in settings page not working
  - Make the unlock prompt method nonblocking

* Fix and cleanup unit tests
  - Use QTRY_COMPARE when checking signal spies, as dbus signals are threaded
  - Fixes in meta type registration and type conversion
  - Remove QStringLiteral in COMPARE macros, making diff output readable
  - Add testing for remembering auth decision
2021-02-05 15:07:59 -05:00
Jonathan White
61b85183f9
Merge branch 'master' into develop 2021-01-31 17:04:38 -05:00
Janek Bevendorff
4e90cb5818 Fix on/off icons not being redrawn on theme change 2021-01-31 20:30:58 +01:00
Janek Bevendorff
b55f419386 Fix icon alpha blending in QTableView
Some widgets such as QTableView do not call QIconEngine::pixmap(), but do
the drawing immediately through QIconEngine::paint(). This breaks alpha
blending for recolouring, since the underlying image canvas is not
necessarily transparent and also not anchored at (0, 0). This results in
a black box of the size of the icon bounding box.

Icon recolouring is now always done on a temporary QImage with
transparent background and only the finished end result is composed onto
the original canvas.

Fixes #6006
2021-01-31 20:30:58 +01:00
smlu
c7323accf2 Fix adaptive icon painting 2021-01-31 12:50:32 +01:00
Janek Bevendorff
3b30855855 Fix code formatting 2021-01-12 18:27:00 -05:00
Janek Bevendorff
86278311d2
Merge branch 'master' into develop 2021-01-12 18:24:59 +01:00
varjolintu
bbc71b3144 Show browser integration tab dynamically 2021-01-12 07:33:05 -05:00
Chih-Hsuan Yen
7078086b50 Fix autostart .desktop file
It had "Version=1.0true", which seems wrong
2021-01-11 11:26:54 -05:00
Janek Bevendorff
0a0b3a6b4f Implement empty-area drag.
Uses Qt 5.15's new QWindow::startSystemMove() to implement empty-area
drag, which allows the user to click and drag any empty area on the
menubar, toolbar, or tabbar to move the window around.
2021-01-07 22:02:43 -05:00
Janek Bevendorff
23ca46c918 Add support for version 2 XML key files.
As discussed in #4317, the next KeePass2 release will ship with
support for a new generation of XML key files which enable
hash integrity checks.

This patch adds support for reading and generating this new format.
By default, KeePass2 now uses the .keyx extension for generated
key files, which was added to KeePassXC's key generation file chooser
filter. We continue to generate hashed binary key files by default,
but the user can explicitly save the file with the new .keyx
extension to generate an XML v2 key file (currently undocumented).

When opening a database, the key file type is still determined
by content negotation, so the file extension has no impact here.

As an additional change, the legacy key file warnings have been
improved slightly to be less confusing and more helpful.
2021-01-07 22:02:43 -05:00
Janek Bevendorff
9a7b20cbfd Add dynamic theme switching on Windows 10 2021-01-07 15:22:48 +01:00
Janek Bevendorff
80c1b9be6a Improve macOS platform integration.
- Allow switching between themes without restart (except classic)
- Rework icon loading and recolouring logic to react to theme changes
- Automatically react to light/dark theme change
- Remove explicit selection of monochrome tray icon variant (selected
  automatically now)
- Update theme background colours for Big Sur
- Update application icon to match Big Sur HIG

The tray icon doesn't respond perfectly to theme changes yet on Big Sur,
since we need different icons for dark and light theme and cannot simply
let the OS recolour the icon for us (we do that, too, but only as an
additional fallback). At the moment, there is no signal to listen to
that would allow this.

This patch adds a few generic methods to OSUtils for detecting and
communicating theme changes, which are only stubs for Windows and Linux at
the moment and need to be implemented in future commits.

Fixes #4933
Fixes #5349
2021-01-07 15:22:48 +01:00
Janek Bevendorff
49d2b87889 Always activate DatabaseOpenDialog on Windows
Fixes #5390
2020-12-30 16:02:29 +01:00
Wolfram Rösler
66f5a8736a Statistics: Fix average password length
The average password length shown in the Statistics report
is now computed based on the total number of passwords.
Previously, it was erroneously computed based on the
number of unique passwords.

Fixes #5134.
2020-12-25 15:32:50 -05:00
Janek Bevendorff
37dab85df7 Implement empty-area drag.
Uses Qt 5.15's new QWindow::startSystemMove() to implement empty-area
drag, which allows the user to click and drag any empty area on the
menubar, toolbar, or tabbar to move the window around.
2020-12-25 13:42:12 -05:00
Jonathan White
14b01784ec Patron Names and Debug Info
* Fix patron name and add new VIP
* Add dash in front of libgcrypt in debug info
2020-12-21 09:38:58 -05:00
Jonathan White
a74e2391e8 Copy history when drag/drop entries and groups
* Fix #5809
2020-12-20 22:57:42 -05:00
Jonathan White
4b5248ee98 Prevent clipboard history and cloud sync on Windows
* Fix #2358
2020-12-20 21:59:32 -05:00
Jonathan White
60c2d89cb0 Prevent crash when KeeShare merges an entry that is in edit mode
* Hack for #5722 until a refactor of KeeShare, Merger, and EditEntryWidget can be performed. This hack should only ever be triggered on the rare occurrence of two people editing the same entry at the same time.  The end result is potential data loss, but the current result is a hard crash. Unfortunately the way everything is interfaced currently doesn't afford any solution without a major refactor.

* Additionally add a short delay before actually reloading a share to prevent read/write locks from preventing proper import. This delay also prevents conflicting saves between the main database and the KeeShare database. This should eventually be moved into the FileObserver itself to smooth out all merge operations once the above refactor occurs.

Side note: KeeShare operates independently of DatabaseWidget causing unexpected behavior when files are updated/merged/etc. This needs to be corrected in a refactor.
2020-12-20 13:05:08 -05:00
Jonathan White
f9b2cf8484 Remove offset on username field in classic theme
* Fix #5601

Fix padding offset in editable QComboBox

Accepted
2020-12-20 13:03:19 -05:00
Bernhard
260c84ccf0
Fix reSelect entry & group on loadDb 2020-12-20 09:12:59 -05:00
Michel D'HOOGE
e8dfa9cfa1 Fix display issues of entry attributes in preview pane
* Fix #5755 - HTML escape attributes prior to preview
* Place attribute preview into a table and convert line breaks
2020-12-19 13:00:43 -05:00
Janek Bevendorff
cd0084f21c Add support for version 2 XML key files.
As discussed in #4317, the next KeePass2 release will ship with
support for a new generation of XML key files which enable
hash integrity checks.

This patch adds support for reading and generating this new format.
By default, KeePass2 now uses the .keyx extension for generated
key files, which was added to KeePassXC's key generation file chooser
filter. We continue to generate hashed binary key files by default,
but the user can explicitly save the file with the new .keyx
extension to generate an XML v2 key file (currently undocumented).

When opening a database, the key file type is still determined
by content negotation, so the file extension has no impact here.

As an additional change, the legacy key file warnings have been
improved slightly to be less confusing and more helpful.
2020-12-19 09:42:21 -05:00
Jonathan White
404fd941e8
Move global shortcut handling into OSUtils (#5566)
Move global shortcut handling into OSUtils
2020-12-13 23:23:25 -05:00
krsnik93
2ee4168956 Display default autotype sequence on entry preview pane
* Fix #5450
2020-12-13 11:33:03 -05:00
Jonathan White
f0204dbb10 Fix closing modal dialogs on database lock
* Fixes #5719, Fixes #5744
2020-12-12 12:31:43 -05:00
Bernhard Berg
a6f01349e8
Redo 'delete entries no confirm' functionality & unit-tests (#5812)
* Fixes #5232
2020-12-12 12:14:18 -05:00
Janek Bevendorff
c9d1512748
Revert "Add "move to recycle bin without confirmation" setting"
This reverts commit de44764efa.
2020-12-11 13:11:42 +01:00
Bernhard Berg
de44764efa Add "move to recycle bin without confirmation" setting 2020-12-11 00:15:24 -05:00
Bernhard
c9e7ffadad Fix reSelect entry & group on loadDb 2020-12-11 00:11:18 -05:00
Jonathan White
3b29f20d60 Hide actions when features are disabled
* Fix #5794 - Don't show "Download All Favicons" in group menu
* Don't show offline documentation links if built documentation is disabled
2020-12-10 00:02:09 -05:00
tWido
59bd238ae1 Hide keyfile path by default
Fixes #5576
2020-12-09 18:28:01 -05:00
Jonathan White
a273deae12 Add delay to login startup on Linux
* Fix #5691 - add a 2 second delay to startup on Gnome to allow for tray initialization and Auto-Type shortcut registration. On KDE, start after the panel is started.
2020-12-07 22:23:43 -05:00
Jonathan White
30989e35bf Use strict check for std::sort to prevent recursion
* Fixes #5596
2020-12-06 11:16:49 -05:00
Jonathan White
7ac651763c Improve CSV export and import capability
* Fixes #3541
* CSV export now includes TOTP settings, Entry Icon (database icon number only), Modified Time, and Created Time.
* CSV import properly understands time in ISO 8601 format and Unix Timestamp.
* CSV import will set the TOTP settings and entry icon based on the chosen column.
2020-12-06 11:16:49 -05:00
Janek Bevendorff
3f7e79cdf3 Add Argon2id KDF (backport of #5726) 2020-12-04 15:11:28 +01:00
Aetf
30c2e39e70 Fix QTimer cannot be stopped from another thread warning 2020-12-03 22:20:25 -05:00
Jonathan White
9cb36abe91 Properly save Password Generator settings
* Fix #5605
2020-12-03 20:04:28 -05:00
Bodo Graumann
1dd99559bb Remove length limit on password
Software should make the user free, not restrict him.
2020-12-03 19:58:06 -05:00
Janek Bevendorff
9a96124040 Add Argon2id KDF 2020-12-03 20:06:58 +01:00
Janek Bevendorff
c6bd22aa12 Attach console in debug mode on Windows 2020-11-21 09:41:55 +01:00
Aetf
9f4118974d FdoSecrets: fix signal connections 2020-11-13 17:20:45 -05:00
Aetf
7f85eb77aa FdoSecrets: code formatting 2020-11-13 17:16:22 -05:00
Aetf
a651d7049d FdoSecrets: handle corner cases in collection dbus names, fix #5279
- Use completeBaseName rather than baseName to ensure nonempty name
- Handle two databases have the same name
- Cleanup Service::onDatabaseTabOpened logic
2020-11-13 17:16:22 -05:00
Aetf
804a3b6706 FdoSecrets: simplify collection internal states
This gets rid of the m_registered state, so whenever there is a valid m_backend, it is guaranteed to be registered already.

While at it, this commit also improves DBusObject::registerWithPath a little bit by allowing properly registering multiple paths using the same adaptor, mostly for supporting Collection aliases.

Now when DBus registration fails, the code does not go into an inconsistent state or crash.
2020-11-13 17:16:22 -05:00
Aetf
f5caf3968f FdoSecrets: fix typos 2020-11-13 17:16:22 -05:00