Commit Graph

4621 Commits

Author SHA1 Message Date
Rafael Sadowski
59bd71ddca
Verify USB listener callback handle
Do not use `handle` if `libusb_hotplug_register_callback` fails
2024-06-30 22:23:27 -04:00
Carlo Teubner
29feb5da79
Passkey importer: fix file picker parent
When selecting "Database → Import Passkey", we show a file picker.
Previously, we did not specify a parent widget for it. This could have
undesirable effects on its presentation. (For example, with the Sway
tiling Wayland compositor, it would show the file picker as a tiled
window rather than a floating one.)

Fix the issue by passing in the parent widget. This is also in line with
all other usages of FileDialog::getOpenFileName() in this project.
2024-06-30 22:23:18 -04:00
Jonathan White
ff89a05743
Show character count in password generator dialog (#10940)
Displays the number of characters in the password field in the password generator dialog. This fixes #10858.
2024-06-30 22:22:59 -04:00
varjolintu
fe7f1e0a51
Passkeys: Fix showing correct username in the reports 2024-06-30 22:10:07 -04:00
Michal Suchanek
a0b8abecb8
Increase the time interval for window show workaround
When the keepassxc window is shown something generetes a hide event, and it is hidden again immediately.

The 50ms interval for avoiding hiding the window when shown is not enough, even on modern systems.

Make the interval longer.
2024-06-30 22:09:21 -04:00
James Carroll
1de0da3d44
Snap: Remove $HOME access from keepassxc-proxy 2024-06-30 22:09:15 -04:00
Jonathan White
8f6dd13b0a
Update translations 2024-06-19 17:32:55 -04:00
Jonathan White
809fb0d457
Version Bump to 2.7.9 2024-06-19 17:26:36 -04:00
Guido Falsi
3ab7166e63
Correct libusb usage on FreeBSD (#10736)
Change type of Handle on FreeBSD. On FreeBSD the libusb_hotplug_register_callback() function uses a pointer to a struct as a handle.

---------

Co-authored-by: Janek Bevendorff <janek@keepassxc.org>
2024-06-19 17:12:40 -04:00
James Carroll
ee08ef421d
Snap: Improve Web-browser Native Messaging host functionality (#10906)
* Snap: Improve Web-browser Native Messaging host functionality

This commit allows for the snap distribution of KeepassXC to self-manage native messaging manifests
This is done by making the binary aware of the snapd environment changes that currently prevent this.
Furthermore, the snap sandbox is expanded to the bare minimum needed to access these privileged files.

Please note if running a self-compiled / untrusted KeepassXC snap build (I.E, installed with --dangerous)
that you must manually run `sudo snap connect keepassxc:browser-native-messaging` to grant permissions.

This will work on all distributions that expose `/snap/bin/` - such as Ubuntu, Debian, etc.
For systems which don't provide `/snap/`, such as Fedora, follow instructions for enabling "Classic" snaps.
e.g., `sudo ln -s /var/lib/snapd/snap /snap`

---------

Co-authored-by: Jonathan White <support@dmapps.us>
2024-06-19 15:50:52 -04:00
Jonathan White
48bf993ac5
Fix Copy Password button when text is selected
When the user chooses to copy the password for an entry to the clipboard, previously there was logic to check if text was selected, and if so, that text was instead copied to the clipboard. That made sense if
(a) the user invoked the Copy Password action via its keyboard shortcut, and (b) that keyboard shortcut was configured (as per default) to be Ctrl-C, i.e. the same as the system action for copy-to-clipboard.

However, it made no sense if the user invoked that action in some other way, for example by clicking the corresponding toolbar button.

It also made no sense in the case that the Copy Password action had some other keyboard shortcut assigned. Also, if some other action had Ctrl-C assigned, the logic would not kick in then.

Fix all of the above by modifying the keyboard shortcut logic to intervene precisely in the case where a shortcut is pressed that matches the system copy-to-clipboard shortcut; only in that case do we now check if text is selected and if so copy that to the clipboard instead of the action we would otherwise take.

Fixes #10734.
2024-06-19 15:50:52 -04:00
Carlo Teubner
b7e6679a58
Search entry: respect shortcut config on Copy key
If the system Copy key sequence (i.e. Ctrl+C or Cmd+C) is pressed while
inside the search entry without any text being selected, previously we
would copy the currently selected entry's password. This made sense when
keyboard shortcuts were fixed. Now that they are configurable, change it
to re-route the event to the main window, which can then take the
appropriate action (i.e. Ctrl+C might be bound to some other action).
2024-06-16 17:39:09 -04:00
Carlo Teubner
071145dd19
App settings: fix widget tab order
Fixes #9765.
2024-06-16 17:20:27 -04:00
Carlo Teubner
22811471ac
Improve Entry placeholder resolution (#10846)
* Entry placeholder resolution: don't overdo it

After resolving placeholders, previously the code would do it all over again if anything had changed, multiple times up to the recursion limit. This would have the effect of applying a much greater recursion limit, which is confusing and unnecessary, and probably undesired.

* Entry tweaks and minor refactoring

- Entry::size(): when computing tag size, use same delimiter set as in other places in the code
- Factor tag delimiter set regex out into global constant
- Placeholder resolution: remove unnecessary special casing for self-referential placeholders (these are taken care of by existing recursion depth limit)
- Placeholder resolution: less wasteful string building loop
- Move some constants from being public static data members of Entry to being local to Entry.cpp (in anonymous namespace)
- Migrate some QRegEx instances to QRegularExpression, the modern alternative
- Miscellanous minor code cleanups

* Entry: fix hitting recursion limit with {braces}

When encountering a {brace-enclosed} substring, the placeholder resolution logic would previously keep recursing until it hit the recursion depth limit (currently 10). This would lead to "Maximum depth of replacement has been reached" messages, and was also wasting CPU cycles.

Fixes #1741

---------

Co-authored-by: Jonathan White <support@dmapps.us>
2024-06-16 17:20:16 -04:00
Jonathan White
ed3f7f5a16
Improve overall database settings behavior
* Fixes #10723 - only display password strength warning when actively editing the password
* Also improve behavior of minimum quality warning
* Improve behavior and handling of password changes with the database settings dialog
* Prevents loss of newly entered password when toggling between elements in the settings page
* On error, switch to tab that prevents saving database settings for easier correction
2024-06-16 17:19:57 -04:00
Jonathan White
f83cd81ad7
Fix encryption settings behavior
* Fixes #10558
2024-06-16 17:13:11 -04:00
Jonathan White
c3259b2610
Improve CSV import when title field isn't specified
* Fixes #10433
2024-06-16 17:11:33 -04:00
Jonathan White
54afbe6a2f
Improve handling of clipboard actions
* Fix #10804
2024-06-16 17:11:21 -04:00
Jonathan White
0aba77ee55
Improve handling of encrypted Bitwarden json
* Fixes #10785
2024-06-16 17:11:13 -04:00
Jonathan White
cf023253a0
Fix password clear timer inconsistency
* Fixes #10695
2024-06-16 17:11:01 -04:00
Jonathan White
c464f2bfe9
Prevent checking file hash with an empty path
A warning is issued from Qt when the path is empty. This happens most often during test runs, but can also occur when closing a database before everything gets cleaned up.
2024-06-16 17:10:53 -04:00
Carlo Teubner
f19d254a0c
TestGui: testTotp: use QTRY_COMPARE
That test failed, presumably because of inherent raciness: https://ci.keepassxc.org/buildConfiguration/KeePassXC_MacOS/248424?expandBuildDeploymentsSection=false&hideTestsFromDependencies=false&hideProblemsFromDependencies=false&expandBuildChangesSection=true&expandBuildProblemsSection=true&showLog=248423_1081_942&logFilter=debug&logView=flowAware

Paper over the raciness by using QTRY_COMPARE instead of QCOMPARE.
2024-06-16 17:10:32 -04:00
varjolintu
e7f9d58541
Passkeys: Fix incorrect username fill 2024-06-16 17:10:17 -04:00
Kevin J
8cbbe7cdfc
Fix sidebar resize behaviour (#10641)
* Fix database view splitters resize behaviour
* Set default ratio sizes for first-run based on the size of the database widget itself
* Fix setting splitter sizes before database widget has had a chance to render for the first time
* Disallow collapsing the entry view (source of several bug reports)

Fixes: #10613

---------

Co-authored-by: Jonathan White <support@dmapps.us>
2024-06-16 17:10:06 -04:00
varjolintu
8bdc7c4702
Passkeys: Return authenticatorData and publicKeyAlgorithm to extension 2024-06-16 17:10:00 -04:00
Carlo Teubner
018686afeb
Cleanup compiler warnings on all platforms (#10847)
Fixes #10730.

Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
2024-06-16 17:09:48 -04:00
Carlo Teubner
abcff25e57
Fix passphrase generator test (#10890)
* Fix passphrase generator test

Previously, the test case was assuming the wrong regex. In particular, the default word list (eff_large.wordlist) contains several words that contain dashes. Adjust the regex used in the test to reflect this. This should fix rare test failures
2024-06-16 17:09:34 -04:00
Alexander Wilms
64eb3d0c82
Add keywords to .desktop file
Taken from Github topics
2024-06-16 17:09:16 -04:00
Carlo Teubner
e26dbc5608
Botan: don't call deprecated functions (#10826)
* Botan: use raw_private_key_bits() if available

Botan 3.x introduces raw_private_key_bits() as an alias for
get_private_key(), and deprecates the latter.

* Botan: use Cipher_Dir::Encryption

Botan 3.x introduces Cipher_Dir::Encryption as an alias for
Cipher_Dir::ENCRYPTION, and deprecates the latter. Likewise for
Decryption/DECRYPTION.
2024-06-02 07:38:50 -04:00
Steve Mokris
42a2443d62
Restore macOS monospace font size prior to #10282 2024-06-02 07:38:10 -04:00
Jonathan White
6fbab25478
Add action item for removing a passkey from entry (#10777) 2024-06-02 07:38:03 -04:00
Jonathan White
2f43ca42be
Fix broken build when using system zxcvbn (#10717)
* Fix broken build when using system zxcvbn

Fixup of zxcvbn include statement added in 5513ff5. A zxcvbn/ directory
prefix breaks building with system zxcvbn. Remove this prefix to align
this include statement with ones present in other files. Add zxcvbn
libraries as dependency to CliTest.

* Move src/zxcvbn/ to src/thirdparty/zxcvbn
2024-06-02 07:37:34 -04:00
Frans-Willem Post
95b91a0890
Prevent HTML overflow, fix issue #10647 2024-06-02 07:35:56 -04:00
Jonathan White
6f77d98642
Fix Flatpak config issues
Remove #ifdef guards from Config.h/cpp (no harm to non-Flatpak distros)

Cleanup #ifdef usage in NixUtils.cpp
2024-06-02 07:35:39 -04:00
Jonathan White
1b3abf8ab0
Fix SSH Agent broken decrypt button (#10638)
* SSH Agent: Fix broken decrypt button (Fixes #10637)

---------

Co-authored-by: Jonathan White <support@dmapps.us>
2024-06-02 07:35:25 -04:00
Jonathan White
1bdf1bbbed
Fix portable mode detection for native messaging files
* Fixes #10755
2024-06-02 07:34:29 -04:00
Jonathan White
1125a02d1e
Fix Alt modifier on Windows Auto-Type
* Fixes #10791
2024-06-02 07:33:24 -04:00
Mounir IDRASSI
6e362ee637
Fix wrong DACL memory size on Windows (createWindowsDACL) (#10712)
Each AddAccessAllowedAce invocation should be matched with a corresponding sizeof(ACCESS_ALLOWED_ACE) and the respective GetLengthSid of the SID being used. This ensures that there is enough space in the ACL for each entry.

The issue manifest itself only when WITH_XC_SSHAGENT is defined.
2024-06-02 07:33:18 -04:00
Stefan Forstenlechner
388b4a736a
Improve build time with MSVC
`/MP` = Build with multiple processes

see https://learn.microsoft.com/en-us/cpp/build/reference/mp-build-with-multiple-processes?view=msvc-170
2024-06-02 07:33:06 -04:00
Jonathan White
87bf232e97
Update README 2024-05-06 20:55:27 -04:00
Jonathan White
f6757d35ad
Update translations 2024-05-05 16:40:29 -04:00
Jonathan White
235015cb56
Bump version to 2.7.8 2024-05-05 16:33:56 -04:00
Jonathan White
75de62327d
Fix issues with Hardware Key auto detection
* Fix #10656 - Add a small delay when before auto-polling hardware keys to all them to settle immediately after plugging in. This resolves an issue where the key's serial number could not be resolved due to hardware timeout.
* Also fix use of uninitialized variable if polling serial number fails for whatever reason.

* Fix typo in macOS key registration code

* Prevent registering duplicate listeners on window focus. These were not de-registered because we didn't trigger on unfocus. Show/Hide are sufficient triggers to add and remove listeners.
2024-05-05 16:33:23 -04:00
Jonathan White
8f98d390e3
Keep key file text when provided on command line
* Fixes #10552
2024-05-05 16:26:54 -04:00
Jonathan White
c9d71e7781
Passkeys: Register to an existing entry 2024-05-05 16:07:00 -04:00
Jonathan White
505f338d28
Fix issues with locking database
* Fix #6593 - force close any modal dialogs associated with a database widget that is being locked.

* Partial fix for #721 but doesn't address the problem of needing to save a modified entry or database while locking.

* Also improves import dialog behavior if databases(s) lock while it is visible.
2024-05-05 16:04:14 -04:00
Jonathan White
ffc72c896c
Fix issues with Entry Editing
* Fix #10653 - prevent category switching if no category was actually hidden/visible. Also properly select a new category when a change is made instead of just changing the widget page.

* Fix apply button still being enabled after it is pressed and successfully committed
2024-05-05 16:04:08 -04:00
egglessness
8c91836038
Add configurable password strength check on database password (#9782)
* Set default value of DatabasePasswordMinimumQuality to 3 (do not accept a master password that is less than Good)

* Add custom message box button "Continue with weak password"
2024-04-29 17:26:06 -04:00
Jonathan White
d14821fb16
Bitwarden and 1PUX importer improvements
* Fixes #10400
  - Support TOTP entries with bare secrets instead of otpauth urls for Bitwarden. Vice-versa for 1PUX.
  - Support Bitwarden Argon2id encryption scheme

* Fixes #10380 - Support Bitwarden organization collections
2024-04-29 09:53:31 -04:00
Jonathan White
2dfc0e540c
Preserve Secret Service exposed group setting on merge
* Fixes #9371 - adds secret service custom data key to the list of protected custom data (will not be overwritten on merge)
2024-04-29 09:53:25 -04:00