Commit Graph

3422 Commits

Author SHA1 Message Date
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
Aetf
000e1823ac FdoSecrets: refactor DBus registration error handling 2020-11-13 17:16:22 -05:00
Jonathan White
15dc6f062e
Ignore format changes for new clang-format version 2020-11-11 17:58:40 -05:00
Jonathan White
91dea9cbc4 Use strict check for std::sort to prevent recursion
* Fixes #5596
2020-11-01 13:28:59 -05:00
Janek Bevendorff
cd519e1bf3
Merge branch 'master' into develop 2020-10-21 22:49:02 +02:00
Jonathan White
8b8cc2fa20 Place database credentials widget in scroll area
* Fix #5440
2020-10-19 21:32:01 -04:00
Jonathan White
59b8b13146 Force set entry preview after search ends
* Fixes #5093
2020-10-19 21:31:42 -04:00
Jonathan White
eb6f0eb346 Add search 'by-path' url for browser 2020-10-17 18:22:47 -04:00
Jonathan White
0c5dd1556a
Merge branch 'release/2.6.2' into develop 2020-10-15 00:13:14 -04:00
Jonathan White
b10a55a547 Prevent data loss when drag/drop between databases
* Fixes #5262
* Always reset the UUID on groups and entries moved or copied between databases. This prevents data loss when the group/entry is moved back to the original database.
2020-10-14 23:55:25 -04:00
Janek Bevendorff
389899e0c6 Fix theme issues on macOS
* Fix #5025 - Change edit entry widget title separator to the common bullet character • (U+2022)
* Fix #5307 and Fix #5347 - Remove transparent toolbar/window on macOS and properly color text in toolbar.
2020-10-14 23:55:01 -04:00
Jonathan White
b0e038e789 Improve default Qt widget icons
* Include new icons for toolbar overflow to ensure they are tinted correctly and fit in with the rest of the UI.
* Replace custom code for clearing line edits by including a proper icon for the default action.
2020-10-14 23:55:01 -04:00
Jonathan White
a09acc86d0
Merge pull request #5542 from keepassxreboot/hotfix/final-push
Final push for 2.6.2
2020-10-14 21:23:23 -04:00
Jonathan White
1ad9c1257b Fix crash when toggling capslock rapidly
* Fix #5543 - Only check caps lock state when key is pressed/released or widget is focused.
2020-10-14 21:23:07 -04:00
Jonathan White
dc57025218
Fix crash in KeeShare when importing deleted share
* Fix #4895 - when KeeShare imports a database it performs a merge operation. If that share was deleted from another identical database (ie, same base group UUID), then the group would be deleted in the middle of reinit causing a crash. This fix moves the group into a QPointer catching the delete operation.
2020-10-12 23:13:20 -04:00
Jonathan White
1ed5cc9898
Fix entry edit issues
* Fix #4083 - move auto-type checks early in the commit process to prevent half-saving an entry if there is a bail-out.

* Fix #4182 - prevent setting modified by just viewing auto-type window associations
2020-10-12 23:13:20 -04:00
Jonathan White
39f1504ca2
Mask password placeholder in command execution dialog
* Fixes #4463
2020-10-11 20:08:27 -04:00
Jonathan White
12782161bc
Move Hide Usernames/Passwords into view menu
* Fixes #4982
* Removed a lot of redundant and passthrough code
2020-10-11 20:08:27 -04:00
Jonathan White
c2f36d877f
Implement window always on top
* Closes #4151
2020-10-11 19:01:44 -04:00
Bernhard Berg
fd3cc7e8c3
Add keyfile option to keepassxc cli import cmd (#5402)
Fixes #5311

Added the keyFile logic from the create command to the import command and moved the loadFileKey() function
to the Utils class since it is now used in both create & import classes.
2020-10-09 20:31:29 -04:00
Christof Klaus
bf2cad28af Add feature to ignore entries for HTTP-Auth Logins 2020-10-08 22:53:04 -04:00
Carlos E. Salazar
fa546c440e
Feature/toggle groups panel option (#5247)
* Closes #5243
2020-10-08 22:52:30 -04:00
Wolfram Rösler
34b44e7496 Add fuzz test support
Describe how to invoke the AFL fuzz tester on the KeePassXC
CLI tool. As suggested in #2729.

Fuzz test build of keepassxc-cli takes database password from
environment variable instead of requiring it to be empty.
Provide two empty kdbx files as initial fuzzer input, one
kdbx 3 and one kdbx 4, both with minimal number of decryption
rounds to speed up the test.
2020-10-08 22:49:34 -04:00
louib
48d9fb3e79
Remove GUI bootstraping from core/ (#5513) 2020-10-08 22:48:45 -04:00
Jonathan White
fb87b1c794
Merge branch 'release/2.6.2' into develop 2020-10-07 11:27:14 -04:00
louib
af4ecb4aa1
Move icon handling from Resources to gui/Icons (#5506) 2020-10-05 20:41:00 -04:00
louib
ba8611cf4c Moving IconDownloader to gui/ 2020-10-04 23:45:25 -04:00
louib
9bffe05020 Moving all OS utils to gui/osutils
The classes used for screen lock detection use QWidget and are only ever used by the GUI,
so moving them there so we can eventually build core/ without Qt5::Widgets.
2020-10-04 23:44:45 -04:00
Jonathan White
a55bb39f20 Fix SSH Add/Remove Key Shortcut on macOS
* Fixes #5378
* Add Key to SSH Agent is Ctrl + H on all platforms
* Remove Key from SSH Agent is Ctrl + Shift + H on all platforms
2020-10-02 20:56:27 -04:00
Jonathan White
8424acda4d Add username to browser named pipe on Windows
* Fixes #5393
2020-09-28 23:03:27 -04:00
Jonathan White
bb7a74b632 Revert FileDialog filter mods for macOS 2020-09-27 15:25:27 -04:00
Jonathan White
443b9e4d37 Introduce AsyncTask::runThenCallback
* Fixes #5295
* Introduce a callback approach to AsyncTask instead of entering multiple QEventLoop in the stack. This has additional benefits including not returning to the original stack location and potentially operating on deleted objects (use after free).
2020-09-27 15:25:27 -04:00
Jonathan White
7426693f1d CLI: Add support for okon in offline HIBP checks
* Closes #5447
* Add option `--okon <okon-cli path>` to trigger the use of the okon cli tool to process a database's entries. When using this option the `-H, --hibp` option must point to a post-processed okon file instead of the standard HIBP text file.
* Updated documentation
2020-09-27 15:23:03 -04:00
varjolintu
fd8d81f517 Ignore recycle bin on KeePassHTTP migration 2020-09-27 15:22:50 -04:00
Jonathan White
e1c2537084
Merge branch 'release/2.6.2' into develop 2020-09-27 12:11:02 -04:00
Bernhard Berg
9fd9d65995
reset Qshared ptr (#5470)
CLI: Fix heapUseAfterFree in db-create command
2020-09-26 09:56:45 -04:00
Jonathan White
829697d53e Enforce fixed password font in preview widget
* Fix #5432
2020-09-26 09:26:24 -04:00
Jonathan White
9886b1075f Cleanup config initialization, add local config options
* Fix #5313, allow specifying local config path using environment variable and command line flag
* Add command line flag `--localconfig <path>` to specify a file path to use for the local configuration settings.
* Add environment variable support to set config files paths: `KPXC_CONFIG` and `KPXC_CONFIG_LOCAL` to override default locations.
* Reorder startup sequence to load specified config files earlier to allow for theme settings and other early options to be picked up.
* Removed old command line option `--pw`, no longer used.

* Attempt a fix of application not closing when last window is gone. Only set `QApplication::setQuitOnLastWindowClosed(true)` when tray icon is enabled instead of always.
2020-09-26 09:26:10 -04:00
Jonathan White
122051c91c Restore natural sort on application load
* Fixes #5435
2020-09-26 09:25:56 -04:00
Jonathan White
55e4889053 Fix layout and alignment of Entry and Group edit views
* Fixes #5321 - Text alignment in the general tab of the entry and group edit views is fixed
* Fixes #5300 - Errant scrollbar in the general tab is fixed
* Fixes #4852 - Tabbing into notes field works as expected. To tab out, currently only Shift+Tab works.
2020-09-26 09:25:43 -04:00
Bernhard Berg
ac5c1af829
Add display number of characters in passphrases (#5449)
Co-authored-by: Jonathan White <support@dmapps.us>
2020-09-21 21:32:49 -04:00
Jonathan White
d3747f40e2
Fix code format 2020-09-21 21:32:02 -04:00
david
55eb855267 Add a -n (--notes) option to keepassxc-cli add and edit commands 2020-09-21 16:04:32 -04:00
Jonathan White
3c5bd0ff6b Fix sorting of reports
* Fixes #4976
2020-09-15 09:46:39 -04:00
Stefan Sundin
8a4a804c8c
Use Alt+Tab on macOS to switch between databases (#5407) 2020-09-15 09:43:35 -04:00
Sami Vänttinen
e391dd182d
Fix Best-Matching ..again (#5316)
Co-authored-by: Jonathan White <support@dmapps.us>
2020-09-13 10:38:19 -04:00
Sami Vänttinen
9bab5d5a33
Don't mark URL references as invalid URL (#5380) 2020-09-05 09:00:36 -04:00
Jonathan White
c67ebf19d4 Fix AutoOpen IfDevice matching, again
* Fix case where only exclusions are entered (eg, !COMPUTER1, !COMPUTER2) which should allow opening the database on every other computer name.
2020-09-05 09:00:05 -04:00
Bernhard
9cf93111d6 Fix heap-use-after-free & error-msg output in keepassxc-cli
* Fixes #5367
2020-09-04 21:15:03 -04:00
piegames
6a35bbea2f Add browser service search for entries via UUID 2020-09-02 23:19:43 -04:00
Jonathan White
1c27dccabb Use selected settings in password generator on load
* Fixes #5336
2020-09-01 07:58:16 -04:00
Jonathan White
f17fce9461 Fix Paperclip and Totp columns not saving state
* Work around Qt bug that causes isSectionHidden to return false after restoring state due to the section actually only being set to 0 width.
* Fixes #5317
2020-09-01 07:57:56 -04:00
Jonathan White
f947c96462 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-09-01 07:57:31 -04:00
Jonathan White
639e44e182 Fix opening opvault on macos
* Fixes #4069 and closes #5002
2020-09-01 07:57:15 -04:00
Reza Jelveh
aedc45abd5 The Database Open Dialog should use the window flag QT::Dialog
Currently the Open Dialog does not behave like a dialog. In Unix it
means that the EWHM hints are not set correctly therefore the window
manager doesn't properly set the floating window style.

It should also allow removing Mac/Windows/Unix custom conditional code.
2020-08-31 23:36:10 -04:00
Laurent Erignoux
f49f62d3be Add a best option to CLI command clip (#4489)
The best option copy the password from the best match if only one matching entry exists.

Adding clip best option documentation

Adding unit tests on the new clip --best option
2020-08-31 23:06:27 -04:00
fpohtmeh
bbdfbe64da Add ability to rename attachments
* Closes #4758
2020-08-31 23:06:10 -04:00
Wolfram Rösler
6b96806914 HTML Export: Don't waste horizontal space
The previous version left a lot of white space to the
right of the table, meaning that more pages needed to
be printed for a paper backup. The table has been
reorganized. HTML Backup for the demo.kdbx database
is now down from 6 to 3 pages.
2020-08-31 20:17:30 -04:00
clonejo
656e6d289a Don't ask when removing an empty URL
There is no harm to deleting an empty URL from the browser integration
URL list when the user never set a value. It's a bit annoying, actually.
2020-08-31 20:16:33 -04:00
Bernhard
745f1befe9 Allow hiding expired entries from Auto-Type
* Add setting to hide expired entries from Auto-Type
* Expired entries will not be shown in selection dialogs or be auto-picked for use
* Fixes #1855
2020-08-30 08:06:22 -04:00
Jonathan White
c0c0ef9fe8 Improve button hover effect for checked buttons 2020-08-19 20:25:18 +02:00
Jonathan White
8a7bdd5b95 Change actions for F1-F2-F3 keys
* Fixes #5037
* F1 focuses group view, if already focused it opens the focused group for editing
* F2 focuses entry view, if already focused it opens the focused entry for editing
* F3 focuses search
2020-08-19 20:24:40 +02:00
Sami Vänttinen
0cc2c83525
Add command for retrieving the current TOTP (#5278) 2020-08-17 06:17:58 -04:00
Jonathan White
a5208959c4 Fix excessive memory usage by icons
* Fixes #5240
* Limit size of icons being loaded to prevent excessive memory usage in some cases
* Fix loading database icons, previous method would just overwrite the same pixmap and not actually provide caching.
2020-08-16 22:40:57 -04:00
Jonathan White
c538f0b907 Fixup saving non-data changes on database lock
* Fix #5107 
* Change setting for non-data changes to Auto save on database lock (or not) instead of marking modified.
* When enabled, database will be auto-saved if there are only non-data changes, but will not prompt the user if saving has failed.
* When disabled, database will not auto-save if there are only non-data changes (same behavior as 2.5 and below) and will not mark the database dirty.
2020-08-08 15:40:00 -04:00
Jonathan White
fd7daf4c89 Fix removing open databases setting
* Fixes #5065
2020-08-08 15:39:28 -04:00
Jonathan White
7f2efd3193 Fix Search and KeeShare banner style 2020-08-08 14:10:49 -04:00
Murdoc Bates
a79afd6580 Update "Open Auto-Type help webpage" URL 2020-08-08 14:10:27 -04:00
Jonathan White
51f3014028 Only display domain name in browser access confirm dialog
* Prevents dialog from growing in width if there is a really long url requesting access.
2020-08-07 06:24:33 -04:00
cl0ne
60317ffadd Set decoration size for category list items
Fixes #5164
2020-08-06 22:10:46 -04:00
Jonathan White
1f4c7cc22b Improve Password Generator Widget UI/UX
* Fix #5098 - Ensure advanced mode settings are saved distinctly from simple mode settings
* Make selected character groups pop out in the UI
* Improve layout of character options
2020-08-06 18:09:45 -04:00
Janek Bevendorff
a32147182a
Switch to classic if theme set to auto and high contast mode is on.
The light and dark theme don't respond to Windows's high contrast
accessibility mode, so when the theme is set to "auto", we
default to "classic" instead of "light".

Fixes #5044
2020-08-01 09:01:12 -04:00
Jonathan White
2f422ab719
Fix and document AutoOpen
* Fix #5017 - ifDevice -> IfDevice and correct behavior of negated hostnames
2020-08-01 09:01:12 -04:00
Jonathan White
b206cdba92
Fix entry level Auto-Type window hiding
* Fixes #4962
2020-08-01 09:01:12 -04:00
Jonathan White
9042ef7557
Correct scaling on Linux and other minor fixes
* Fixes #5081 - Initialize MessageWidget::m_animate prior to use

* Fixes #5021 - Don't change tray icon type with unfocused mouse wheel

* Fixes #5029 - Only use HighDpiScaleFactorRoundingPolicy::PassThrough on Windows platforms. Prevents significant scaling bugs on Linux. MacOS does not support fractional scaling.
2020-08-01 09:01:12 -04:00
Ojas Anand
0aa029d548
Clear clipboard on database lock
- Always store the last copied text
- clearCopiedText will always clear clipboard
  regardless of timer state
2020-08-01 09:01:12 -04:00
Jonathan White
c511cb518c Fix error background color for URLs 2020-07-27 21:43:40 -04:00
Jonathan White
a88fe61a7b Minor theme fixes
* Support mouse hover color change for QPushButtons.
* Fix #5040 - don't enforce standard palette when in classic theme mode
2020-07-27 21:43:40 -04:00
fpohtmeh
004f5d407f Open and save attachment in readonly mode
* Fix #2039
2020-07-22 21:57:45 -04:00
Anees Ahmed
1d0523ec21 Add option to Auto-Type just the username/password
Fixes #4444

Some websites these days do not present both the "username" and the "password"
input box on the same webpage (e.g. Google, Amazon). So no custom sequence is
possible to enter both the said attributes in one go.

So, two new context menu actions have been added:
1.  Perform Auto-Type of just the username
2.  Perform Auto-Type of just the password

These context menu actions are analogous to "Copy username" and "Copy
password", except it avoids sending all characters via clipboard.

* Create a sub-menu in the Context Menu of Entry.
* The sub-menu offers the following sequences:
    - {USERNAME}
    - {USERNAME}{ENTER}
    - {PASSWORD}
    - {PASSWORD}{ENTER}
2020-07-21 18:22:47 -04:00
varjolintu
f73855a7f2 Adjust matching with best-matching credentials enabled 2020-07-21 07:29:02 -04:00
Anton Vanda
c2bdb48bc6 Fix 'db-info' command name to show it right in 'help'
* Fixes #5139
2020-07-20 21:20:21 -04:00
Ingo Heimbach
10dc859231 Add support for the Xfce screensaver 2020-07-20 21:18:51 -04:00
tuxmaster5000
fb7cc673ac Add Qt translation dir for RPM packaging 2020-07-18 18:21:33 -04:00
Jonathan White
e1a264825a PasswordEdit use CTRL modifier on all platforms
* Fixes #5114
2020-07-18 18:21:20 -04:00
Jonathan White
d6857e654f Fix minor TOTP issues
* Fix #5105 - prevent divide-by-zero segfault due to invalid TOTP settings
* Clear TOTP settings if attributes are removed
2020-07-18 09:59:02 -04:00
Toni Spets
747be8d629 SSH Agent: Always forget all keys on lock
Fixes #5016.
2020-07-18 09:24:40 -04:00
Toni Spets
7c39907251 Substitute tilde with USERPROFILE on Windows
The substitution is now more shell-like and tilde is only replaced
from the beginning of the path if it is trailed by a slash.
2020-07-18 09:24:22 -04:00
alcroito
005d9d368f
Skip referenced passwords in Health check report
Fixes #5036
2020-07-18 09:18:19 -04:00
Jonathan White
e02a63b061 Prevent crash if focus widget gets deleted during saving
* Fixes #4966
2020-07-18 09:15:45 -04:00
Jonathan White
4a917d171d Improve restart requests
* Fixes #4959
* Ask to restart when changing languages in application settings.
2020-07-15 07:10:54 -04:00
Janek Bevendorff
2fe74c2947 Reset icon theme name before calling QIcon::fromTheme().
qt5ct randomly resets the active Qt icon theme to "",
resulting in empty or wrong icons.

See https://sourceforge.net/p/qt5ct/tickets/80/

Fixes #4963
2020-07-10 14:29:39 +02:00
Adam Crowder
4f1d8943d6 fix slot detection on yubikeys
Signed-off-by: Adam Crowder <adam@adamcrowder.net>
2020-07-09 21:37:10 -04:00
Jonathan White
13c86cbdc5
Fix auto-restart when a space is in the file path 2020-07-06 21:09:59 -04:00
Jonathan White
9bf0d7680e
Update About dialog
* Patreon additions and code contributors
2020-07-06 18:47:43 -04:00
varjolintu
9b63e6a289 macOS: Fix hiding window after using database unlock dialog
* Properly hide window after Browser Integration and Auto-Type unlock, if needed
* Fix #4904
2020-07-05 20:04:35 -04:00
Shun Sakai
9dde9314e8 Change to generate man page from AsciiDoc 2020-07-05 14:54:31 -04:00
Jonathan White
124739fde2 Switch to Asciidoctor based documentation 2020-07-05 14:54:31 -04:00
Jonathan White
3b459813ed Replace "Master Key" with "Database Credentials"
Definitions:
* Database Key - Cryptographic hash used to perform encrypt/decrypt of the database.

* Database Credentials - User facing term to refer to the collection of Password, Key File, and/or Hardware Key used to derive the Database Key.

Changes:
* Remove the term "master" and "key" from the user's lexicon and clarify  the code base based on the definitions above.
* Clean up wording in the UI to be clearer to the end user.
2020-07-02 17:39:45 -04:00
Jonathan White
60bb593228 Fix layout of CSV Import Widget 2020-06-29 09:54:35 -04:00
Jonathan White
ef7a4288ae
Prevent crash on restart 2020-06-29 08:23:51 -04:00
database64128
790b3382a3 Call QGuiApplication::setHighDpiScaleFactorRoundingPolicy to fix #2815 2020-06-28 23:07:22 -04:00
Jonathan White
05a0df799e Fix auto-start settings on Windows 2020-06-28 16:25:26 -04:00
Jonathan White
9c0fa376a1 Fix Touch ID timeout not being set correctly
* Fixes #4885
2020-06-28 16:25:14 -04:00
Jonathan White
247882eb54 Remove redundant call to update tray icon during startup
* Fix #4768
* MainWindow::updateTrayIcon() is called in MainWindow::applySettingsChanges() earlier in construction. Calling this function twice in a row causes issues with startup times on Linux.
2020-06-28 16:25:00 -04:00
Sven Grewe
3596fabc78
Fix --pw-stdin by initializing text streams (#4912)
Co-authored-by: Sven qoreQyaS Grewe <sven.grewe@akquinet.de>
2020-06-28 16:24:37 -04:00
Jonathan White
fd65a47d51 Introduce Compact Mode
* Added to the new view menu, show entry/group icons at 16px and reduce toolbar icons to 22px. 
* Fix search widget being too large vertically (removed padding)
2020-06-28 16:21:50 -04:00
Jonathan White
4bf6d8d94d Introduce View Menu
* Move user interface settings from the settings widget into the view menu.
* Add auto-restart prompt to make theme changes easy
2020-06-28 16:21:50 -04:00
varjolintu
1dd758c66a
Fix send buffer size for app and proxy 2020-06-27 08:42:40 -04:00
Toni Spets
58e8d819c9 SSH Agent: Fix regression in context menu hotkeys 2020-06-26 07:15:47 -04:00
Jonathan White
736df7696f FDO Secrets: Fix double free on exit
* Prevent double free due to QObject cleanup happening before/after the ExtraPage  storing the QSharedPointer to FdoSecretsPlugin is deleted.
* Fixes #4877
2020-06-19 21:24:43 -04:00
Jonathan White
c46f3d37b1 Browser: Check for expired entry prior to custom data
* Fixes #4881
2020-06-19 21:24:22 -04:00
Jonathan White
1becb6137a On case-sensitive OS, force use of lowercase config directory
* Fixes #4835
2020-06-18 12:21:08 -04:00
Jonathan White
5f9bed6a52 Fix activating entries in database reports when sorted
* Fixes #4855
2020-06-18 12:20:31 -04:00
Jonathan White
ac3014378f Remove connection to non-existent signal
* Fixes #4858
2020-06-18 12:20:05 -04:00
Jonathan White
cbf7759e7c Improve YubiKey/OnlyKey detection with more than 2 keys
Add a small delay between key polling to let the hardware interface settle. Prevents invalid serial numbers from being pulled messing up the KeePassXC workflow.
2020-06-10 08:56:16 -04:00
Jonathan White
fbebf30b98 Fix permissions changing on database save
* Saving a database in unsafe mode retains the existing permissions on the kdbx file
* New databases (save as, save backup, new database) and new key files are saved with 0600 permissions (user read/write), fixes #2575
2020-06-07 16:00:56 -04:00
Jonathan White
1ad0184473 Fix minor UX issues with DB Open Widget
* Only clear password field when switching tabs or minimizing. This prevents the setting "Remember Key Files and Hardware Keys" from being useless with multiple databases.
* Convert key file field to Line Edit, simplifies usage. Fix clear field button as well.
* Removed need for clearForms to check if the database is being opened (was a solution to tab switching while unlocking, no longer a problem).
2020-06-06 14:40:22 -04:00
JMcKiern
6c9125402a
Cleanup welcome screen recent databases view (#4822)
* Press "Delete" to remove recent database
* Refresh recent databases on becoming visible
2020-06-06 08:26:46 -04:00
Jonathan White
712b8224c6
Decrease default database icon size to 22px
* Aligns better with entry text and condenses group list
2020-06-04 17:35:59 -04:00
Jonathan White
e039006667 Check for updates every 7 days while running
* Check every hour to see if another update check should be performed. Nothing actually happens unless 7 days has elapsed since the last update check.
* Fixes #3706
2020-06-04 10:03:40 -04:00
Jonathan White
f129768f07 Improve AutoOpen
* Add support for 'ifDevice' feature, closes #2871
* Resolve placeholders for username and password to support references, fixes #2078
* Add support for open databases from an entry when the url starts with 'kdbx://'. Uses the same syntax as AutoOpen. Closes #1536.
2020-06-04 10:03:40 -04:00
Jonathan White
b7104be689 Prevent overwriting of portable config on update
* Move portable configuration files into a config subfolder from the executable. This prevents overwriting the stored config when the application is updated in-place.
* Use .portable file to signal a portable app
* Fix #4751
2020-06-04 10:03:40 -04:00
Jonathan White
9d10792640 Update edit entry widget when backing entry changes
* Fixes #4060
* Also fix not emitting entryModified() when history is truncated. This possibly fixes other crashes with apply button when the history is truncated and then the history page is shown with a deleted entry.
2020-06-04 10:03:40 -04:00
Jonathan White
2073f2ddc3 Fix theming with Qt 5.15
* Fixes #4765
* Fixes #4766
2020-06-04 10:03:40 -04:00
Jonathan White
6f5e13815c Fix resolving resources when running from build directory
* Copy wordlists to build dir share folder
* Change resource path resolution to only test the provided directory, not finding a specific file
2020-06-04 10:03:40 -04:00
Jonathan White
c830f85c09 Various minor bug fixes / enhancements
* Fix issues when Config options were renamed
* Fix compile issues when using clang 10
* Rearrange database menu icons and import database menu icons
* Set minimum size of MainWindow to 800 to prevent search bar from hiding
* Fix not saving password generator options when closing the standalone generator
* Add headers to health check reports
* Don't show hidden content dots when notes are hidden but empty.

* Fix saving new database files in SMB shares on Windows, fixes #4809

* Gracefully handle duplicate attachments :
Instead of bailing out with an error, prepend a random string to the name of duplicate attachment records. This prevents data loss from other programs that mishandled KDBX XML writing. Fixes #2493

* Properly handle blocked import of signed KeeShare database, fixes #4413
2020-06-04 10:03:40 -04:00
Janek Bevendorff
e36cba703e Fix loading of tray icon appearance setting.
The tray icon appearance setting is null by default, since we do not
want to include OSUtils into Config. As a result, we must take special
care to preselect the correct combo box entry on the settings page.
2020-06-04 14:21:38 +02:00
Aaron D. Marasco
a91358e7bf Squash of previous remove_shadows branch 2020-06-02 15:56:16 +02:00
Janek Bevendorff
4f75432fc6 Add option for monochrome tray icon 2020-05-31 00:26:14 +02:00
Janek Bevendorff
9d2e066aca Clean up various parts of the UI and rearrange settings
- Unify widget layouts and margins
- Fix tab order on a bunch of widgets
- Fix broken entry/group edit form layout and replace with grid layout
- Rearrange some settings for better logical grouping
- Fix some settings checkboxes not being enabled/disabled on load
- Fix "General" settings tab scrolling
- Rename "Root" group to "Passwords"
- Update demo.kdbx accordingly and redownload favicons
- Change entry path display to use slash separators
- Reduce Medium and Large icon sizes slightly
2020-05-30 10:45:00 +02:00
Janek Bevendorff
4de99cfe8e
Extract highest resolution from downloaded ICO files 2020-05-29 10:00:32 -04:00
Jonathan White
b5554e05d8
Improve application icons
* Add icons for Database Import, Database Export, and Recent Databases
* Change app exit icon to be distinct from export icon
* Updated and ran makeappicons.sh
2020-05-29 10:00:32 -04:00
Jonathan White
90d5372813
Replace database icons with SVG's
Original source of icons is the icon8 library (http://icons8.com/c/flat-color-icons) and Paomedia (https://github.com/paomedia/small-n-flat). All icons used are licensed MIT or CC0; annotated in COPYING.

* Closes #4071

* Increase default size of database icons to 24px and entry preview panel to 48px
* Add shell script to assemble the database icons

* Use QIcon to seamlessly support High DPI displays and pixmap caching
* Add badge support for KeeShare groups and expired entries.
* Guard against use of QPixmap::fromImage without a GUI

* Add SVG minify and improve `make icons`

Co-authored-by: Wolfram Rösler <wolfram@roesler-ac.de>
2020-05-29 10:00:32 -04:00
Aetf
a1f599c7c4 Add an option to EntrySearcher to skip protected attributes 2020-05-27 22:07:25 -04:00
Aetf
b849fdead5 FdoSecrets: fix new db created from DBus but not saved yet is not exposed by default 2020-05-27 22:07:25 -04:00
Aetf
463bb0b03f FdoSecrets: fix prompt completed signal argument type 2020-05-27 22:07:25 -04:00
Aetf
44779bc862 FdoSecrets: add unit tests 2020-05-27 22:07:25 -04:00
Janek Bevendorff
af6493b07b Hide window and dock icon on macOS when tray enabled.
Transforms application into a UIElement agent app when
minimize to tray is enabled and the window is hidden.
This hides the dock icon and removes the application
from the Cmd+Tab listing. The changes work well together
with macOS's inbuilt hide feature.

Also fixes the buggy tray icon context menu trigger behaviour.
macOS triggers the tray context menu also on normal left
click, which causes the window to toggle at the same time
as the menu. To fix this, window toggling has been disabled
altogether on macOS and users will be shown only the context
menu from now on.

Fixes #1334
2020-05-27 10:55:11 +02:00
Foaly
b17b9683e1 Check correct CMake flag. 2020-05-26 13:34:25 -04:00
Aetf
1fbddf4149 Fix DatabaseTabWidget::lockDatabases returns false even when all tabs are locked 2020-05-24 16:56:02 -04:00
Prabesh Paudel
443614a375 Issue warning before allowing large attachments
Fixes #3782
2020-05-23 13:04:01 -04:00
Toni Spets
a83345d136 SSH Agent: Reset settings when KeeAgent.settings is removed
Fixes #4594
2020-05-23 11:30:31 -04:00
Andrew Meyer
98566fec83 Correct 'save as' behavior to ensure file path remains valid
Copy necessary saving sequence from the save function into saveAs function to prevent inconsistencies when saving to a new file.
2020-05-23 08:44:08 -04:00
Holger Böhnke
eb198271ac Add natural sort of entry list
Introduce a third unsorted status that shows entries in the order they occur in the KDBX file.

* Add keyboard shortcut Ctrl+Alt+Up/Down to move entries up and down in sort order
* Add entry context menu icons to achieve movement up/down
* Only show menu icons when in natural sort order
* Add Material Design icons for moving up/down

* Add feature to track non-data changes and force a save on exit to ensure they are not lost when locking a database. This allows users to make entry movements and group expand/collapse operations and not lose that state.

Remove saveas
2020-05-22 12:13:20 -04:00
varjolintu
43c82ccb09 Custom browser feature for Linux/macOS
* Also move "search in all databases" to the general tab
2020-05-21 14:13:45 -04:00
stingray21
d863496f62 Add DB_DIR placeholder for autoopen urls 2020-05-21 14:13:18 -04:00
Janek Bevendorff
bcb64a231f Use Segoe UI font on Windows.
Qt uses "MS Shell Dlg 2" as the default font, which resolves to
Tahoma and not Segoe UI, which is the actual Windows 10 default font.

See QTBUG-58610
2020-05-21 18:54:03 +02:00
Toni Spets
a1b4a3f8b7 SSH Agent: Track which database owns a key for remove-on-lock
Fixes #4532
2020-05-19 09:23:41 -04:00
Toni Spets
9e17d52e8e SSH Agent: Fix attachment data not updating before apply
Fixes regression since #3833 was merged
2020-05-19 09:22:15 -04:00
varjolintu
92a7fe33bd Use unlock dialog when unlocking a database from browser extension 2020-05-19 08:30:10 -04:00
Andrew Meyer
09f5a74a15 Make 'show/hide passwords' toggle temporary
Deprecates the 'hide passwords' setting in config. Passwords are always hidden on application startup.
2020-05-19 08:29:41 -04:00
Janek Bevendorff
3dc8b7a5d0 Add button to hide pre-release warning for this release. 2020-05-18 23:57:24 +02:00
varjolintu
e367c6df95 Fix merging browser keys
* Introduce protected custom data function to prevent loss during merge operations
2020-05-16 17:41:10 -04:00
varjolintu
48bf4fb85d Fix annoyances with access control dialog
* Don't send database locked/unlocked messages when "search in all databases" is enabled
* After access control dialog closes, only hide main window on macOS, and then only if previously hidden.
2020-05-16 17:40:49 -04:00
Andrew Meyer
45848c3f61 Implement 'Save Database Backup' option
Add an option in the 'Database' menu to save a backup of the current database.

Add unit test for saving database copy

* Open a test database, mark it as modified, and save a copy
* Fail if the copy is not a valid database
* Fail if the original database is saved
* Fail if the original database is no longer marked as modified
2020-05-16 11:00:27 -04:00
Jonathan White
2237cf0188 Fix browser socket path for proxy and app
* Prefer hardcoded string, we never want this server name to change due to arbitrary reasons.
2020-05-15 20:48:51 -04:00
varjolintu
287e822e02 Allow manual editing of browser extension connection keys 2020-05-14 23:29:50 -04:00
Steven Brudenell
d5de042529 Deactivate read-only mode for now. Fixes #803.
Read-only mode isn't in a good state and is triggering bugs. We'll come
up with a good design for read-only mode at a later time.
2020-05-14 20:27:36 -04:00
Jonathan White
49487f9d4a Fix changing focus around the main window using tab
* Override Qt's default [broken] behavior of handling Tab/Shift+Tab to navigate around the MainWindow. Completely fixes trapped focus.

* Improve handling of search results when navigating the UI.

* Fix selecting first entry after ending a search.

* Add keyboard shortcuts to directly focus on search (F1), Group List (F2), and Entry List (F3)

* Fixes #2878, #4636, and #4221
2020-05-14 20:21:32 -04:00
Jonathan White
5142981018 Significantly enhance hardware key robustness
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC.

* Improve messages displayed to user when finding keys and when user interaction is required. Output specific error messages when handling hardware keys during database read/write.

* Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize.

* Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations.

* Fixes #4400
* Fixes #4065
* Fixes #1050
* Fixes #1215
* Fixes #3087
* Fixes #1088
* Fixes #1869
2020-05-14 20:19:56 -04:00
Jonathan White
a145bf9119 Complete refactor of Browser Integration classes
* Removed option to attach KeePassXC to the browser extension. Users must use the proxy application to communicate with KeePassXC.
* Significantly streamlined proxy code. Used same implementation of stdin/stdout interface across all platforms.
* Moved browser service entry point to BrowserService class instead of NativeMessagingHost. BrowserService now coordinates the communication to/from clients.
* Moved settings page definition out of MainWindow
* Decoupled BrowserService from DatabaseTabWidget
* Reduced complexity of various functions and cleaned the ABI (public vs private).
* Eliminated BrowserClients class, moved functionality into the BrowserService
* Renamed HostInstaller to NativeMessageInstaller and renamed NativeMessageHost to BrowserHost.
* Recognize XDG_CONFIG_HOME when installing native message file on Linux. Fix #4121 and fix #4123.
2020-05-14 17:14:17 -04:00
Wolfram Rösler
3b4057a78c Set URL placeholder text to https://example.com
Fixes #3830
2020-05-14 16:52:08 -04:00
BO41
f1080d633e Add group search
* Allow searching by group using the `group:` field.
* Group hierarchies can be searched by including a '/' in the search term.
2020-05-14 16:48:57 -04:00
Jonathan White
485852c9db CLI: Use stderr for password prompt
Fixes #3398.

Convert to QTextStream for all CLI IO and greatly improve CLI tests

* Completely overhaul CLI tests to be much more streamlined and easy to read. Removed unnecessary code blocks by using existing functions.

Co-authored-by: Emma Brooks <me@pluvano.com>
2020-05-14 16:33:25 -04:00
Jonathan White
612f8d2e5b Improve OPVault handling and replace test opvault
* Fix various bugs in opvault parsing to include: TOTP parsing, date handling, naming convention, attachments, and multiple url's.

* Remove category groups that don't have any entries.

* Simplify tests by focusing on the resulting database instead of the parsing mechanics.

* Remove proprietary "freddy" opvault in favor of self-made "keepassxc" opvault.

* Fix #4069, select opvault file on macOS
2020-05-14 15:17:28 -04:00
ameyer0
560209550c
Change settings checkbox texts to positive phrasing (#4715) 2020-05-10 21:35:08 -04:00
Jonathan White
dcff507e02 Fix various issues with KeeShare
* Fix #3790, shares now use the standard FileWatcher class to detect remote file changes using checksums and file system triggers.

* Fix #3895, macOS file selection no longer hangs the app.

* Restore saving of KeeShare settings accidentally removed by 596d2cf
2020-05-10 17:23:53 -04:00
Wolfram Rösler
3c19fdd193 Reports: Add "Known Bad" flag for entries
* Fixes #4168

* Introduce a custom data element stored with an entry to indicate that it is a "Known Bad" entry. This flag causes database reports to skip these entries.
* The current number of known bad entries is displayed in the statistics report.
* Add context menu to reports to easily exclude entries.
2020-05-08 20:51:11 -04:00
lshman
ce8f32e797
Show "New Entry" in the context menu even if an item is selected (#4617) 2020-05-08 20:48:30 -04:00
Janek Bevendorff
adc743503a Fix "Minimise at startup" on Windows
This option didn't work properly when "Hide window to system
tray when minimised" was also enabled.

I don't see a particular reason why Windows shouldn't be calling
hideWindow() like all other platforms. hideWindow() takes care of
choosing the correct minimisation mode based on the user's settings.
2020-05-07 09:57:45 +02:00
Jonathan White
071cc856da Improve MSI Installer
* Include checkboxes to install a desktop shortcut (default no) and start on login (default yes)
* Fix closing KeePassXC.exe and keepassxc-proxy.exe before installation starts
* Improve styling of launch after exit checkbox
2020-05-06 10:44:53 +02:00
Janek Bevendorff
4ba8ef30f2 Add option to launch KeePassXC at system startup
Fixes #1218
2020-05-06 10:44:53 +02:00
Janek Bevendorff
26ea274259 Fix menu menu spacing on low-DPI Windows 2020-05-04 11:02:04 +02:00
Ojas Anand
ab6222a5f8 Use QStringLiteral to concatenate result and unit 2020-05-04 00:05:28 +02:00
Ojas Anand
1b18c5d51d Add "Size" column
- Sizes are displayed in B, KiB, MiB, and GiB with 2 significant
  digits after the decimal
- Column is hidden by default
- TestEntryModel updated for testing proxy model
2020-05-04 00:05:28 +02:00
Janek Bevendorff
d9214db404 Implement Caps Lock warning 2020-05-03 09:59:36 +02:00
Janek Bevendorff
596d2cf425 Refactor Config.
Replaces all string configuration options with enum types
that can be checked by the compiler. This prevents spelling
errors, in-place configuration definitions, and inconsistent
default values. The default value config getter signature was
removed in favour of consistently and centrally default-initialised
configuration values.

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

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

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

Fixes #2574
Fixes #2193
2020-05-02 22:30:27 +02:00
Janek Bevendorff
5add01243d Fix tabbar separator visibility
Fixes separator being visible despite multiple tabs being active
when KeePassXC started hidden in the tray.
2020-04-30 14:24:38 +02:00
Janek Bevendorff
5f9b640da1 Fix icon selection highlights
- Change QListView mode to ListMode
- Increase custom icon size
- Reduce grid spacing
- Improve selected icon state composite
2020-04-28 23:35:03 +02:00
Janek Bevendorff
3dcac2c46c Fix DatabaseOpenDialog layout 2020-04-28 23:35:03 +02:00
Janek Bevendorff
34483a1287 Add central colour palette for widget states.
Hard-coded widget state colours (error, warning, health etc.)
are replace by a central palette class, which also takes care
of determining if KeePassXC is in dark or light mode.

Colours expected to be used as background for normal text
were tested for WCAG level A compliance. Health colours were
adjusted for better harmony with the application theme and
tested for sufficient contrast with a colour blindness simulator.
2020-04-28 23:35:03 +02:00
Janek Bevendorff
2f12294639 Fix CategoryListWidget icons
- Correct colouring of selected icon
- Better selection rectangle correction
2020-04-28 23:35:03 +02:00
Jonathan White
7168bcdbe5 Add clipboard-text and refresh icons to resources 2020-04-28 23:35:03 +02:00
Jonathan White
243f68e0e8 Fix button highlighting in multiple dialogs
* Changed style so that only default buttons have full background highlight. This prevents confusion as to which button in various dialogs is the default/desired choice.

* Move password generator popup into static function outside of PasswordEdit so other parts of the program can easily access it.

* QDialog forces 'autoDefault' property on all buttons causing them to obtain background highlight when they are focused. Moved Password Generator outside of a QDialog and forced 'autoDefault' to false on Browser Access Dialog.

* Fixed button ordering in Totp Setup Dialog

* About dialog close button is now the default button
2020-04-28 23:35:03 +02:00
Janek Bevendorff
fbd78037ff Fix icon search path on Linux 2020-04-28 23:35:03 +02:00
Janek Bevendorff
8d2f7832ed Improve theme colour contrast.
Fixes #4407
Fixes #4637

Additional changes:
- Fix reference entry colour being incompatible with dark themes
- Fix QWizard page being too bright in dark mode
- Prevent unfocused wheel scroll changes to theme setting
2020-04-28 23:35:03 +02:00
Jonathan White
1a3dc2145d Stop file checksum compare when stop is called
* When FileWatcher::stop() is called, also stop the timer that checks the file checksum every 30 seconds.
2020-04-27 14:54:57 -04:00
varjolintu
5795051477 Recycle KeePassHTTP settings 2020-04-12 18:15:58 -04:00
Jonathan White
730367557f Ability to disable animation of message widget
* Allows for persistent messages that can change text without disturbing the user interface
* Immediate improvement to KeeShare group edit window
2020-04-12 18:15:15 -04:00
Jonathan White
7ef1ee916b Fix install of libssl and libcrypto on Windows build
* Replace find_library with find_file. CMake likely changed behavior of find_library to exclude dll files.
2020-04-11 14:32:33 -04:00
Janek Bevendorff
d189f9132e
Merge branch 'master' into develop 2020-04-09 18:27:40 +02:00
Ojas Anand
3552ba2a30 Return keyboard focus after saving database edits (#4287) 2020-04-09 18:15:27 +02:00
Janek Bevendorff
e9754efbbe Fix macOS 10.15.4 codesigning crash.
The recent macOS security patch renders our codesigning
"fix" of setting the sandbox entitlement to false twice
unusable. This patch adds a full provisioning profile
and adjusts the signing procedure to not include
entitlements for Qt frameworks.

The patch also changes the app and bundle ID, so granted
accessibility privileges have to be granted again after
installing the update.

Fixes #4398
Fixes #4515
2020-04-09 16:22:42 +02:00
Tezkerek
6128e5d582 [CLI] On Unix, copy to clipboard using wl-clipboard if xclip is not available. 2020-04-09 15:46:44 +02:00
Toni Spets
ef668f552e SSH Agent: Entry context menu control 2020-04-08 13:44:27 -04:00
Jonathan White
d41a37c9bc Fix crash when adding external ssh key to entry 2020-04-08 13:44:27 -04:00
Jonathan White
2022a5e65c Perform one KDF benchmark at a time
* Prevent using double memory when benchmarking Argon2 performance.
* Improve benchmark results by not overusing CPU and memory simultaneously. Parallel benchmarks were causing artificially strained calculations resulting in a lower than desired number of rounds.
2020-04-08 12:52:32 -04:00
Jonathan White
7b25fe9cc6 Set expiration time to Now when enabling entry expiration
* Fixes #3940
2020-04-08 12:52:12 -04:00
Jonathan White
ab9856ee88 Fix issues with HIBP report
* Show horizontal header in results table
* Correctly handle the case when there are no entries to analyze
* Make countToText static
2020-04-08 12:51:46 -04:00
Ojas Anand
f0709d187d Check if hiding notes by default is enabled, hide text if it is
- Check if hide notes setting is enabled and update EntryModel notes'
  data if so
- Fixes #4412
2020-04-04 09:26:51 -04:00
tuxmaster5000
e316a09a79 Change link sequence to allow static versions of libgpg-error and libgcrypt. 2020-04-02 09:17:42 -04:00
varjolintu
0a61aa0d46 Change database root group Uuid 2020-03-31 19:02:50 -04:00
Wolfram Rösler
83ed9a8d4e
Check passwords against the HIBP online service (#4438)
* Fixes #1083

* Add online HIBP checker dialog to the database reports widget. Permission is requested from the user prior to performing any network operations. 
* The number of times a password has been found in a breach is shown to the user.
* If no passwords are breached then a positive message is presented.

* Source of HIBP icon: https://github.com/simple-icons/simple-icons/blob/develop/icons/haveibeenpwned.svg

Authored-by: Wolfram Rösler <wolfram@roesler-ac.de>
Co-authored-by: Jonathan White <support@dmapps.us>
2020-03-29 09:39:06 -04:00
Toni Spets
464e49d329 Add back missing initializers to KeeAgentSettings 2020-03-28 12:07:53 -04:00
Compilenix
5927b6298d
Add DateTime placeholders to AutoType feature (#4409) 2020-03-18 22:00:24 -04:00
louib
e6c2c7ed93
CLI: Cleanup create options (#4313)
* Add ability to create database with an empty password
* Add password repeat check
* Standardize process between `db-create` and `import` commands
* Improve db-create tests with new password repeat

Co-authored-by: Jonathan White <support@dmapps.us>
2020-03-18 21:51:36 -04:00
Janek Bevendorff
b045160e4f Bundle icons using the Qt resource system.
Simplify resource loading logic and enable reproducible builds.
Fixes #2582
2020-03-14 10:13:12 -04:00
Jonathan White
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