Commit Graph
855 Commits
Author SHA1 Message Date
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
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
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
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
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
Jess Sullivan b9bcbfc592 Fix: address #12631 2026-05-27 15:58:15 -04:00
Sami Vänttinen 7c7ca4575e WIP: Qt6 transition (#11651)
Update KeePassXC to use Qt 6.
2026-05-04 15:16:51 +03: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
Jonathan White ad4a807e70 Fix the TOTP Gui test for Ubuntu Jammy
* For some reason the C locale setting is not respected in Jammy and the test fails due to attribute sorting
2026-04-13 06:04:12 -04:00
Jonathan White 379be00127 Add more entry types for Proton Pass importer
* Fixes #13130

* Add wifi and sshKey import types
* Add catch-all import type to prevent loss of data when Proton Pass introduces new things
2026-03-15 06:06:19 -04:00
Jonathan WhiteandJanek Bevendorff 56521023b8 Support TIMEOTP autotype and entry placeholder (#13117)
* Additional fix for #7263 to support KeePass2 placeholder for TOTP

---------

Co-authored-by: Janek Bevendorff <[email protected]>
2026-03-08 23:17:36 -04:00
Janek Bevendorff 5c91c9986a Mock datetime to avoid test failures on second lapse (#13115)
Fixes #13059
2026-03-08 22:26:10 +01:00
Sami Vänttinenandvarjolintu a1cddad37c Add support for nested folders with Bitwarden import (#13081)
Co-authored-by: varjolintu <[email protected]>
2026-03-08 16:18:22 +01:00
Sami Vänttinenandvarjolintu 2dd56c76cc Fix showing correct checkbox value in entry Browser Integration settings (#12980)
Co-authored-by: varjolintu <[email protected]>
2026-03-08 16:17:27 +01:00
Sami Vänttinenandvarjolintu 1ce2ce9bb8 Passkeys: Set BE and BS flags to true (#13042)
Passkeys: Set BE flag to true

---------

Co-authored-by: varjolintu <[email protected]>
2026-03-08 13:08:15 +01:00
Janek BevendorffandJonathan White ada379fddd Fix Linux test failures (#13113)
* Fix test failure introduced by ab31a748fa (#10993)

* Fix tray hiding test failure

Introduced by 43904d87b7 (#10928), but somehow hasn't posed an issue until now.

* Try to make attachment GUI test more robust

---------

Co-authored-by: Jonathan White <[email protected]>
2026-03-06 17:59:02 -05:00
Sami Vänttinen 01b49921fb Passkeys: Add publicKey to register response (#12757) 2026-01-17 14:01:13 +01:00
Jonathan White 97d4edd9b8 Take delays into account when Auto-Type TOTP values
* Fixes #12682
2025-11-23 16:13:26 -05:00
copilot-swe-agent[bot]anddroidmonkey a5c9ffbef7 Fix CSV import regression with root group names
Fix the issue where CSV export/import creates nested root groups when the database has a custom root group name.

Added comprehensive tests to verify the fix works for both custom and default root group names, and preserves existing behavior for single-level groups.

Implement heuristic approach for CSV import root group detection:

- Analyzes all CSV rows before processing to find consistent first path components
- Only skips the first component if it appears in 80% or more of paths
- Handles absolute paths (starting with "/") by ignoring them in analysis
- Preserves existing behavior when no clear common root is found

Co-authored-by: droidmonkey <[email protected]>
2025-11-23 13:09:23 +01:00
xboxones1 f39e0937b9 Fix markdown type for >= QT 5.15.18 (#12654) and advance vcpkg baseline
- Fix markdown type for >= QT 5.15.18 (#12654) 

- Fix deprecation warnings about implicit capturing of "this"

- Advance vcpkg baseline to fix macOS Qt building
  Fixes Qt build errors on macOS 26 Tahoe.
  See https://github.com/microsoft/vcpkg/pull/48298
2025-11-22 21:26:40 +01:00
Jonathan White e542070902 Allow for escape syntax to enable literal placeholders
* Fixes #11890
2025-11-09 10:45:07 -05:00
Sven Strickroth 44daca921a Escape accelerators
(fixes issue #12037)

Signed-off-by: Sven Strickroth <[email protected]>
2025-11-07 15:47:14 -05:00
592d553ff8 Add URL double-click action option to Settings (#12322)
* Closes #4717

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: juzu-o <[email protected]>
Co-authored-by: Jonathan White <[email protected]>
2025-11-02 12:32:11 -05:00
Jonathan White ebf0676661 Fix Auto-Type Empty Window Behavior
* Fixes #9282
* Also improve documentation for window title matching behavior
2025-11-02 10:16:41 -05:00
Siddhant ShekharandJonathan White d9ccf767d0 Sanitize username to prevent single-instance detection failure (#12559)
---------

Co-authored-by: Jonathan White <[email protected]>
2025-11-01 10:25:10 -04:00
682269f622 Bitwarden import: Add support for timestamps and password history (#12588)
* Closes #12587

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: droidmonkey <[email protected]>
Co-authored-by: Jonathan White <[email protected]>
2025-10-26 08:10:01 -04:00
5736c6379c Implement {UUID} placeholder and nested reference support (#12511)
* Closes #12509
* Implement the {UUID} placeholder
* Implement nested placeholder de-referencing when resolving entry references to support a reference like {REF:U@I:{UUID}} which is equivalent to {USERNAME} placeholder.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: droidmonkey <[email protected]>
Co-authored-by: Jonathan White <[email protected]>
2025-09-27 19:08:22 -04:00
Tamino BauknechtandJonathan White c0ea6f65f9 Database merge confirmation dialog (#10173)
* Add Entry::calculateDifference()

This new function contains the logic that was previously in
EntryHistoryModel::calculateHistoryModifications().
It allows the re-use to display the differences in case of a merge.

* Introduce Database Merge Confirmation Dialog

Adds a dialog allowing a user to review the changes of a merge operation.
This dialog displays the changes and allows the user to abort the merge
without modifying the database.

Fixes #1152

* Added dry run option to Merger
* Changed behavior when actual merge differs from dry run to just output a warning to console
* Fixed KeeShare conflicting with merge operations in the middle of a merge

---------

Co-authored-by: Jonathan White <[email protected]>
2025-09-14 12:02:22 -04:00
CopilotandJonathan White dd023ca157 Fix pre-release issues with attachment viewer (#12244)
* Fix translation issues for "FIT" and "New Attachment" in attachment editor

* Fix markdown preview persistence and enable external links in attachment editor

* Update preview panel if manually moved from collapsed position

* Match edit view scroll position (by percentage) when changed. This ensures the preview remains in relative sync with the edited document, for example when a large amount of HTML reduces down to a short preview document.

* Fix default preview size to be half the width of the edit widget.

* Set tab stop to 10 and remove base ui file

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Jonathan White <[email protected]>
2025-09-08 06:22:20 -04:00
Jonathan White 7ea141652e Update base translations and improve consistency (#12432)
* Improve confirmation prompts and tooltips for delete actions in the GUI

* Fixes #10543
2025-09-07 20:16:36 -04:00
Jessy LANGEandJonathan White 7ec0f1f5a8 Add "press enter to search" option (#12263)
* Also increase auto-search timeout to 500 ms to improve user experience, especially with large databases. The previous value of 100ms guaranteed a search was performed after every character entered, even when typing relatively fast. 

---------

Co-authored-by: Jonathan White <[email protected]>
2025-07-06 14:16:25 -04:00
Jonathan White 76b2f377df Enforce new-line at end of code files 2025-07-06 11:50:24 -04:00
Jonathan White 74326616c5 Fix two problems with URL wildcard matching
* Fixes #12255
* Periods were not being escaped in the url string before being used in a regex resulting in matching 'any character' between domain parts
* Wildcards entered as `*.` were being replaced with simply `*` resulting in unexpected matches to occur. Fixing this has a side effect of `https://*.github.com` NOT matching `https://github.com` which should be the expected behavior. Users can enter both url's if they desire to match the primary and all sub domains or leave out the wildcard entirely to use normal matching behavior.
2025-07-04 09:06:27 -04:00
Jonathan White f62ea95499 Don't add space to invalid TOTP strings
* Fixes #11357
* Introduces validity parameter to TOTP generator function for future use elsewhere in the code base
* Fixes this in preview panel and TOTP dialog
* Disable actions to copy/show TOTP if the settings are invalid
* Show an error message on the TOTP setup dialog if the settings are invalid
* Show a TOTP icon with an x if the settings are invalid
2025-06-19 16:22:17 -04:00
Jonathan White b5f4e98925 Fix handling of small passphrase wordlists
* Fixes #11856
* Set the minimum recommended wordlist size to 1,296 - equal to the EFF Short List
* Issue a clear warning when using a smaller wordlist but do not prevent generation of passphrases
* Improve wording when removing custom wordlist
2025-06-19 16:22:17 -04:00
Kuznetsov Oleg f2a4cc7e66 Refactor attachment handling system with enhanced UI (#12085)
* Renamed NewEntryAttachmentsDialog to EditEntryAttachmentsDialog for clarity.
* Introduced EditEntryAttachmentsDialog class to manage editing of existing attachments.
* Added functionality to preview attachments while editing them.
* Enhanced EntryAttachmentsModel with rowByKey method for better key management.
* Add image attachment support with zoom functionality.
* Add html and markdown detection.
* Improve button layout on the attachment section when editing an entry
2025-06-19 13:27:23 -04:00
2c3a1a03cb Add predefined search for TOTP entries (#12199)
Fixes #9362
This commit was authored by GitHub copilot agent and reviewed by @droidmonkey.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: droidmonkey <[email protected]>
Co-authored-by: Jonathan White <[email protected]>
2025-06-19 09:24:01 -04:00
varjolintu 3c7c3b0a5f Fix loose URL comparison 2025-06-15 09:27:12 -04:00
varjolintu 5cb6ad6335 Passkeys: Fix ordering of clientDataJSON 2025-05-27 07:09:19 -04:00
varjolintu 640366ad4d Remove obsolete TLD test 2025-04-09 06:38:21 -04:00
Jonathan White 37ddbb3cd2 Remove Config::createTempFileInstance 2025-03-30 08:14:12 -04:00
Jonathan White fcb32efd05 Improve handling of remote sync saving
* Fixes sporadic failures on gui tests on Windows
* Corrects inability to write to temporary config file while running tests
* Corrects errors when using MockRemoteProcess due to missing functions
2025-03-30 08:14:12 -04:00
Jonathan White 1b1643b5d1 Fix various quirks with CSV import widget and parser
* Fixes #11502 - correct improper handling of text qualifiers

* Improve layout of csv import widget
* Hide error messages when trying to import again
2025-03-01 17:14:13 -05:00
Jonathan White 244ed42231 Improve remote sync tests 2025-02-23 22:18:47 -05:00
An-anonymous-coder 86f74a00d0 Removed newline and words with hyphen (#11409)
The newline at the end of the file was removed, as well as 4 words that contain a hyphen:
drop-in
felt-tip
t-shirt
yo-yo
2025-02-23 09:46:25 -05:00
Adrian Martin ab6b6f36a0 Feature: HTML export from CLI tool (#11590)
This commit introduces support for exporting a KeePassXC database in
HTML format via the CLI tool. The key changes include:
- Refactoring HtmlExporter:
  - Moved HtmlExporter to the format directory and made its API
    compatible with CsvExporter.
  - Since the original HtmlExporter had a direct dependency on the
    gui/Icons functions and indirect dependencies on the
    gui/DatabaseIcons class, only the non-GUI parts were moved to
    format/HtmlExporter.
  - All icon-related functionality was encapsulated in a new child
    class, gui/HtmlGuiExporter.
    - The gui/HtmlGuiExporter retains the original functionality of the
      HtmlExporter class.
    - The format/HtmlExporter now generates HTML export without icons.
      Adding icon support to format/HtmlExporter would require moving
      icon management logic to the core, which could have broader
      implications.
- CLI integration:
  - Updated cli/Export to use format/HtmlExporter.
- GUI Integration:
  - Updated gui/export/ExportDialog to use gui/HtmlGuiExporter.
- Build System Updates:
  - Updated CMakeLists.txt to build HtmlExporter as part of core_SOURCES
    and HtmlGuiExporter as part of gui_SOURCES.
- Testing:
  - Updated TestCli to automatically verify the output of the HTML
    export.

Signed-off-by: AdriandMartin <[email protected]>
2025-02-23 08:43:06 -05:00
varjolintu 0b5ae1775c Prevent using URL wildcards in TLD 2025-02-12 16:05:01 -05:00