Commit Graph
4990 Commits
Author SHA1 Message Date
Jonathan White fb41d01373 Fix repeating Touch ID prompt on MacOS 2026-08-09 07:04:45 -04:00
Jonathan White 2d2336c5fa Fix issues 2026-08-09 07:04:44 -04:00
Jonathan White bf5e8d8548 WIP: Enable centralized secret storage
* Also enables pin unlock to be stored

TODO: Clean up pin unlock interface with polkit
2026-08-09 07:04:43 -04:00
Jonathan White dc87823929 Add documentation on pin unlock 2026-08-09 07:04:42 -04:00
Jonathan White c42987d167 Address PR comments 2026-08-09 07:04:42 -04:00
Jonathan White e69328801e Add safeguard to using Argon2 function 2026-08-09 07:04:41 -04:00
Jonathan White 213c79b2d9 Add Pin Quick Unlock option
* Introduce QuickUnlockManager to fall back to pin unlock if OS native options are not available.
2026-08-09 07:04:41 -04:00
Jonathan White 775c43c118 Add support to remember quick unlock on Windows and macOS 2026-08-09 07:04:40 -04:00
e590413544 Fix history items losing entry CustomData (#13573)
* Fix history items losing entry CustomData

Entry::beginUpdate() copied attributes, attachments and auto-type
associations into the temporary history item but not CustomData, unlike
clone() and copyDataFrom(). As a result every history item was created
with empty CustomData, and restoring an entry from history wiped its
CustomData, losing KeePassXC-Browser settings and other client metadata.

Copy CustomData into the history item like the other components and add
TestEntry::testHistoryItemCustomData covering creation and restore.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Removed redundant code to ensure consistency

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Jonathan White <[email protected]>
2026-08-08 22:48:36 -04:00
Adrien Ollier 0b0b2938eb refactor(configure_file): change extension of configure_file input files
Input files of configure_file are traditionnally suffixed with .in.
.cmake extension is preferably reserved to scripts.
2026-08-02 13:29:36 -04:00
varjolintu 205891202f Use native user temporary directory path for the browser socket in macOS 2026-07-23 08:45:18 -04:00
H-TTTTT 33b83d0b68 Fix CSV import header auto-mapping under non-English UI (#13531)
CSV files exported by KeePassXC always use English canonical headers.
When the UI locale translated field labels, only untranslated names
(URL, TOTP) matched. Also match the English export headers so
re-import works regardless of UI language.

Fixes #13523
2026-07-23 06:43:18 -04:00
IgorandJonathan White 58a2919650 Fix #13073: Respect password generator settings for new entries (#13277)
* Fix #13073: Respect password generator settings for new entries

---------

Co-authored-by: Jonathan White <[email protected]>
2026-07-23 06:42:48 -04:00
Adrien OllierandJonathan White caa7d14761 Cleanup line reader code for CLI (#13330)
* refactor(LineReader): Make use of the LineReader class in a much simpler way

The LineReader is made a concrete class whose declaration is independent of the readline library. Only its implementation depends on the presence or absence of the readline library. The LineReader code is embedded in a new library : line_reader, to make the cli library independant of the USE_READLINE definition.

* refactor(readline): better FindReadline module

The readline library is now searched with pkg-config first. If pkg-config is not installed, the search is manual. In both cases, the Readline::readline target is created, embedding transitive requirements.

FindReadline module was written with the help of Le Chat AI (https://chat.mistral.ai/chat)

---------

Co-authored-by: Jonathan White <[email protected]>
2026-07-23 06:41:11 -04:00
ryain11andJonathan White e888fec070 Fix password strength evaluation for referenced passwords (#13479)
* Also fix password strength in entry view

---------

Co-authored-by: Jonathan White <[email protected]>
2026-07-21 12:58:23 -04:00
Janek Bevendorff 6a534f38c6 Remove metastream IDs from UUID list to prevent potential use after free 2026-07-11 21:36:05 +02:00
Raman Gupta be192d422b Fix directory creation error handling
When a directory is created successfully for saving attachments, do not error.

Resolves #13504.
2026-07-08 12:50:49 -04:00
Nikos Apostolakis 91461e1f86 Add tamper-detection tests for HmacBlockStream 2026-07-05 23:55:59 -04:00
Adrien Ollier ce28e2afb7 Refactor UrlTools to be a namespace
UrlTools does not need to inherit from QObject or even be a class.
It is a collection of regular functions.
refactor(urltools): Make regular expression static

domainHasIllegalCharacters() constructs a QRegularExpression on every call.
Since the pattern is constant, make it static const QRegularExpression
  to avoid repeated regex compilation in hot paths
  (e.g., domain validation during browsing/passkey operations).

refactor(urltools): Remove the unnecessary convertVariantToUrl function

format code

refactor(urltools): Include What You Use

refactor(urltools): Use URL_WILDCARD directly in implementation

refactor(urltools): some more inprovements

- code format
- use pure Qt functions for the string handling
- use chop to remove the last character of a QString
- make another QRegularExpression static const
2026-06-29 08:55:10 -04:00
Waqar Ahmed 32c5d6dd9b Fix incorrect model reset
beginResetModel/endResetModel in a QStandardItemModel doesn't make sense

Fixes following warnings

beginResetModel called on EntryURLModel(0x55c23c0dec40) without calling endResetModel first
endResetModel called on EntryURLModel(0x55c23c0dec40) without calling beginResetModel first
beginResetModel called on EntryURLModel(0x55c23c861120) without calling endResetModel first
endResetModel called on EntryURLModel(0x55c23c861120) without calling beginResetModel first
beginResetModel called on EntryURLModel(0x55c23cd1ab30) without calling endResetModel first
endResetModel called on EntryURLModel(0x55c23cd1ab30) without calling beginResetModel first
2026-06-29 08:52:25 -04:00
Toni Spets f58d5fee82 Update desktop database when updating desktop file 2026-06-29 14:24:39 +03:00
Toni Spets 12bd15962e Bake Auto-Type plugins to the main binary
The plugin architecture wasn't very useful when we only had a single
plugin per platform before Wayland was added. Even with Wayland all the
dependencies are built into the main executable anyway making the plugin
a shim.

This fixes issues with the Wayland plugin that caused memory corruption
when allocations done from the plugin were free'd by the main
application. The plugin system was not meant to be used this way.
2026-06-29 07:10:43 +03:00
Jonathan White 740bbbd65b Fix missing -D in cmake opts setting
* Bug found using copilot review
2026-06-28 23:56:27 -04:00
tesla 4d8c77f4e6 UI: Add tag prefix to search help widget 2026-06-28 23:55:57 -04:00
Arpit Jain ed0dc92fff Recognize {PGDN} Auto-Type placeholder
The {PGDN} placeholder is documented but only pgup/pgdown are registered
in g_placeholderToKey, so {PGDN} fails to resolve and aborts the rest of
the Auto-Type sequence.

Add pgdn as an alias for Qt::Key_PageDown, mirroring the existing
ins/insert and del/delete aliases (lookup already lowercases the
placeholder). Also assert {PGDN} in the syntax-check test.

Fixes #13379

Signed-off-by: Arpit Jain <[email protected]>
2026-06-28 23:55:15 -04:00
luo jiyin 003e7af49c Fix multiple spelling typos across codebase (#13424)
* fix(changelog,appdata,test): correct typos (ambigious→ambiguous, verticle→vertical, Localtion→Location, Bottons→Buttons, rectange→rectangle)

* fix(dbus,nixutils,keeshare,cr-recovery): correct typos (definiton→definition, executeable→executable, Certicate→Certificate, padd→pad)
2026-06-28 23:54:42 -04:00
yjdyamv 4bb02145fe Center dialogs on screen when triggered from system tray
Fixes regression when moving to Qt6
2026-06-28 23:54:16 -04:00
xboxones1 ff09ff2bfe Prevent DatabaseOpenWidget elements from shrinking vertically 2026-06-27 22:47:28 -04:00
Toni Spets 23053454ee Allow the last row of Auto-Type settings to stretch
Some earlier Qt6 versions behaved differently and didn't understand the
last spacer is supposed to stretch vertically. This is clearly visible in
the AppImage build that uses older Qt6.
2026-06-26 18:40:08 +03:00
Toni Spets 6bb009d12e Install desktop file for AppImage
On first launch, we'll install a desktop file for the current user that
points to the specific AppImage that was used to start. We'll also
update it on every launch if any changes are made to it to ensure it
always points at the latest release.

We'll also use systemd-run if possible to ensure our DBus identity is
consistent on Wayland for Auto-Type to work in all possible scenarios.
2026-06-26 18:40:08 +03:00
Toni Spets 962a0b966d Use qmake6 for AppImage builds
Our CI build images have both Qt5 and Qt6 and the default qmake is for
Qt5. This confuses linuxdeploy and it needs a hint.
2026-06-24 17:09:30 -04:00
Toni Spets fa583f31d3 Document Wayland Auto-Type quirks 2026-06-22 23:57:26 -04:00
Toni Spets feb8c245e1 Wayland Auto-Type with XDG Desktop Portals (#13359)
Needs an implementation of global shortcuts to bind the global trigger
and an implementation of remote desktop to type entries.
2026-06-20 14:16:21 +03:00
Blessio bbc28b931b Fix: Windows SDK path resolution without CMAKE implicit link directories
This commit enhances the CMake configuration for Windows builds by
providing more robust path resolution for the Windows SDK.
2026-06-04 13:11:13 -04:00
John Lawniczak 81f34ff978 Fix KeePass1 group time field validation 2026-06-04 13:10:52 -04:00
varjolintu 608967954c Fix KPH mention in browser documents 2026-06-03 06:16:52 -04:00
Jess Sullivan b9bcbfc592 Fix: address #12631 2026-05-27 15:58:15 -04:00
Caesar Woo 80c2ad7a0d Fix flatpak builds (#13382) 2026-05-27 15:56:20 -04:00
Michał Kępień 02784b0eee Fix race in dark mode detection (#13366)
The current dark mode detection implementation is prone to a race
between an asynchronous D-Bus method call in NixUtils::NixUtils() and
bootstrap logic in Bootstrap::bootstrap().  This race condition causes
dark mode detection to fail intermittently during application startup.

The sequence of events in the failing case is as follows:

 1. In the Application constructor, osUtils is instantiated, causing
    the NixUtils constructor to run.

 2. An asynchronous D-Bus method call is issued to query the value of
    the org.freedesktop.appearance.color-scheme key.

 3. Bootstrap code runs.  In particular, a prctl() system call is
    issued to set the keepassxc process "dumpable" attribute to 0.

 4. xdg-desktop-portal begins handling the D-Bus method call initiated
    in step 2.  Flatpak detection logic is invoked, triggering an
    attempt to access /proc/<pid>/root, where <pid> is the PID of the
    keepassxc process.

 5. Since the keepassxc process had its "dumpable" attribute set to 0
    in step 3, its /proc/<pid>/root entry becomes owned by root.  This
    causes the access attempt from xdg-desktop-portal to fail, which in
    turn causes the D-Bus method call to fail as well.  As a result, the
    registered callback (NixUtils::handleColorSchemeRead()) is never
    invoked, effectively breaking dark mode detection.

If xdg-desktop-portal completes its permission checks before the
prctl() system call is issued (that is, if the order of steps 3 and 4
is reversed), everything works correctly.

Fix by replacing the asynchronous D-Bus method call with a synchronous
one, preventing bootstrap code from executing while the D-Bus call is
still pending.

* Use ReadOne D-Bus method instead of Read

The org.freedesktop.portal.Settings.Read method is deprecated.  Replace
its use with org.freedesktop.portal.Settings.ReadOne and adjust reply
handling accordingly.

Remove NixUtils::handleColorSchemeRead(), which is no longer needed.
2026-05-23 18:53:09 -04:00
36fbca49f7 Fix running windeployqt for Qt6 (#13356)
---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: droidmonkey <[email protected]>
2026-05-23 10:37:43 -05:00
Max 86fec5c049 changed minimum number of threads in the QThreadPool from 2 to 3 2026-05-20 09:36:36 -05:00
Jonathan White bbd4423a30 Fix saving SSH Agent settings
* Fixes #13351
* This unfortunately breaks backwards compatibility with the _original_ KeeAgent plugin for KeePass2. Qt6 refuses to write XML in UTF-16 format, so we have to use UTF-8. This should not be a big deal at all since our SSH agent integration has surpassed the original KeeAgent with features at this point.
2026-05-18 16:51:44 -04:00
Jonathan White 0d69edd88d Fix typo in Windows clipboard exclusion 2026-05-17 16:04:39 -04:00
Sami Vänttinen 7c7ca4575e WIP: Qt6 transition (#11651)
Update KeePassXC to use Qt 6.
2026-05-04 15:16:51 +03:00
varjolintu 703855bec3 Fix CMakeFiles for BSDs 2026-04-25 10:13:45 -04:00
Adrien Ollier 89e4b146bc fix(BOTAN3): compilation failed due to a bad definition 2026-04-25 07:48:36 -04:00
Jonathan Whiteandvarjolintu aa0cac5c03 Refactor: move to simple default builds (#11003)
* Remove individual feature flags in favor of a single `KPXC_MINIMAL` flag that removes advanced features from the build. Basic features are no longer guarded by feature flags.
* Basic features: Auto-Type, Yubikey, KeeShare
* Advanced features include: Browser (and passkeys), SSH Agent, and Secret Service
* Networking, Documentation, and Update Checking remain as feature flags to accommodate various distro requirements.

This change also cleans up the main CMakeLists.txt by re-arranging some content and placing macros into a dedicated include file. The minimum CMake version was bumped to 3.16.0 to conform to our minimum Ubuntu support of Focal (20.04). This also allows us to default to C++20, we fall back to C++17 for Qt versions less than 5.15.0 due to lack of support.

Lastly this change removes the KEEPASSXC_BUILD_TYPE="PreRelease" which is never used. We only support "Snapshot" and "Release" now.

Additional cleanup of CMakeLists:

1. Removed always-true CMake version guard  if(CMAKE_VERSION >= 3.14.0)

2. Removed dead GCC 4.8 stack protector fallback; C++20 requires GCC 10+, and -fstack-protector-strong has been available since GCC 4.9.

3. Removed dead ASan LSan version guard for the same reason.

4. Converted set_target_properties( COMPILE_DEFINITIONS) to target_compile_definitions() on both keepassxc_core and keepassxc_gui. Both are now PRIVATE since the symbol is an internal build detail.

5. Scoped Qt5Gui_PRIVATE_INCLUDE_DIRS to keepassxc_gui preventing Qt-internal headers from leaking into every target in the build.

6. Use cmake_parse_arguments to cleanup test case definition macros. Remove test output formats as they are never used and can be controlled when tests are run.

* moved /fsanitize=address to compile options instead of definitions for MSVC builds

---------

Co-authored-by: varjolintu <[email protected]>
2026-04-18 22:37:30 -04:00
Alexandre Petit 007839bd90 Fix sshAgent casacading calls with QSignalBlocker 2026-04-16 23:11:35 -04:00
Adrien OllierandJonathan White 8ab21631cb Refactor: avoid naming lambda expressions and use STL algorithm (#13231)
* Refactor: avoid naming lambda expressions and use STL algorithm

Lambda expressions in C++ are designed to be anonymous, lightweight, and local,
intended to encapsulate concise logic without the need for formal declarations.
Explicitly naming them (e.g., assigning to a variable or using a named `auto`)
contradicts their purpose: it introduces redundancy, adds unnecessary weight,
and blurs the line between lambdas and regular functions.

This change removes unnecessary lambda names and replaces the custom logic with
a standard STL algorithm, making the code more idiomatic, maintainable, and
aligned with the STL's philosophy of generic, reusable components.

* Refactor: Use std::any_of and lambda for deleted object checks

Replace manual for-loop iteration with std::any_of and a lambda expression
to check for the presence of a deleted object by UUID. This improves code
clarity, conciseness, and aligns with modern C++ best practices by leveraging
STL algorithms and functional-style expressions.

The second overload of containsDeletedObject() is now implemented by reusing
the first, avoiding code duplication and ensuring consistency.

* Run code format

* refactor(config): replace manual loop with `std::any_of` for roaming settings validation

- Remove the local lambda function `isValidSetting` and replace it with a direct use of `std::any_of` in the loop.
- Improve code readability and maintainability by leveraging the C++ Standard Library.
- Reduce redundancy and make the logic more concise and idiomatic.

This change ensures the code is more aligned with modern C++ practices while maintaining the same functionality.

* refactor(icons): simplify image format validation using `std::all_of`

- Replace manual loop and flag-based validation with `std::all_of` to check for non-alphanumeric characters in image formats.
- Improve code clarity and reduce boilerplate by leveraging the C++ Standard Library.
- Maintain the same filtering logic while making the code more concise and idiomatic.

---------

Co-authored-by: Jonathan White <[email protected]>
2026-04-16 17:13:41 -04:00
Roman Mateea 4fbdf0c498 Fixed uninitialized variable m_mode in SymmetricCipher.h (#13173) 2026-04-16 10:09:16 -04:00