Commit Graph
286 Commits
Author SHA1 Message Date
varjolintu 80e68bb4e8 Fix out-of-bounds writing to browser messages 2026-09-22 21:46:36 +02:00
varjolintu dfdd561fc5 Passkeys: Fix parsing punycode domains 2026-09-21 22:26:59 -04:00
Jonathan White 5ac1b0c98d Center browser dialog on active screen 2026-09-16 18:04:55 -04:00
varjolintu 4243717a0b Fix hiding KeePassXC to system tray on macOS 2026-09-07 06:55:35 -04:00
Sami Vänttinenandvarjolintu 0e1510d71a Browser: Do not allow using references when creating or updating credentials (#13580)
* Introduces EntryPlaceholders class and moves static code away from Entry class.

---------

Co-authored-by: varjolintu <[email protected]>
2026-08-12 15:03:33 -04:00
varjolintu 205891202f Use native user temporary directory path for the browser socket in macOS 2026-07-23 08:45:18 -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
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
Sami Vänttinen d9be1b0682 Passkeys: Fix default BE and BS flag value (#13122) 2026-03-09 17:44:10 +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
varjolintu b370aed3e7 Fix showing URls in browser access dialog 2026-01-17 14:27:58 +01:00
Sami Vänttinen 01b49921fb Passkeys: Add publicKey to register response (#12757) 2026-01-17 14:01:13 +01:00
Isaac ElliottandJonathan White 9031cb530e Allow read-only native message files (#12236)
* Allow read-only native message files

It's possible[^1] for a native message file to be both correct and read-only.
When current versions of `keepassxc` encounter this, it fails, because
it can't write to the file. In this situation it should only fail if
the read-only file's contents are different to those it's trying to
write.

[^1]: e.g. when using an immutable OS management system like NixOS or
   home-manager.

---------

Co-authored-by: Jonathan White <[email protected]>
2025-11-02 10:17:06 -05:00
Alexey Mostovoy ad2f95117a Return on first disabled item in areAllDisabled 2025-09-07 20:18:53 -04:00
varjolintu 7e3e2c10d2 Fix Do not ask permission for HTTP Basic Auth option 2025-09-07 10:56:42 -04:00
varjolintu e9cf38a6e3 Browser: Do not allow site automatically 2025-09-07 10:55: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
varjolintu 5cb6ad6335 Passkeys: Fix ordering of clientDataJSON 2025-05-27 07:09:19 -04:00
varjolintu 8a32b3bc5e Explicitly allow access to newly created browser group 2025-05-22 16:55:07 -04:00
varjolintu a6e92c96d5 Fix settings native messaging path with Tor Browser launcher in Linux 2025-04-12 06:42:03 -04:00
Jonathan White d6e726a9cf Improve browser notice about snap/flatpak support 2025-02-22 16:42:08 -05:00
9ba6ada266 Add support for URL wildcards and exact URL (#9835)
* Add support for URL wildcards with Additional URL feature

* Only check TLD if wildcard is used

* Avoid using network function in no-feature build

---------

Co-authored-by: varjolintu <[email protected]>
Co-authored-by: Jonathan White <[email protected]>
2025-02-09 20:03:15 -05:00
Jonathan White 831704f3b2 Trim file path settings fields prior to save
* Fixes #11630
2025-01-26 07:04:57 -05:00
varjolintu 9670a5e74e Add CustomData::getKeyWithPrefix() 2024-12-25 21:33:19 -05:00
varjolintu 132ca42ec5 Fix renaming extension key name in Database Settings 2024-12-25 21:33:19 -05:00
Sami Vänttinen 2fc24be331 Browser: Fix cancel with database unlock dialog (#11435) 2024-11-10 17:30:38 -05:00
Sami Vänttinen 6e0baf9f2c Support passkeys with Bitwarden import (#11401) 2024-10-24 20:12:47 -04:00
varjolintu ea2e36c676 Add support for group selection when creating a passkey 2024-10-01 08:13:01 -04:00
varjolintu 2f0160438a Allow deleting extension plugin data from Browser Statistics 2024-09-02 12:53:34 -04:00
varjolintu 5351392237 Browser: Resolve references in Access Confirm dialog 2024-08-11 18:31:34 -04:00
louib 166a371050 Refactor: separate GUI sources from core sources
This PR splits the GUI source files from the core source files. The immediate goal is to allow the CLI to require only a minimum number of dynamic libraries. The long term goal is to create an architectural boundary around the core module, in preparation of libkdbx.
2024-06-29 11:50:23 -04:00
Peter Mescalchin 6b1ab1a5ed Update URLs to Chrome Web Store page for KeePassXC-Browser extension 2024-06-22 07:58:48 -04:00
Carlo Teubner 88b76244cf Fix all Qt 5.15 deprecation warnings (#7783)
* Deprecated qSort() -> std::sort()
* Replace QDateTime::toString(Qt::DefaultLocaleShortDate) with Clock::toString()
* Replace QDateTime::toString(Qt::SystemLocaleShortDate) with QLocale::system().toString(..., QLocale::ShortFormat)
* Use QDateTime::startOfDay() instead of QDate(QDateTime) 
  Note: QDateTime::startOfDay() is only available in Qt 5.14, we need to guard it
* Replace QString::SkipEmptyParts with Qt::SkipEmptyParts
  Note: Its designated replacement, Qt::SplitBehavior, was only added in Qt 5.14.
* Don't call deprecated QFlags(nullptr) constructor
* QSet::{toList->values}
* Replace QList::toSet, QSet::fromList with Tools::asSet()
* QHash::insertMulti -> QMultiHash::insert
* QProcess::startDetached: non-deprecated overload
* QProcess::{pid->processId}
* QPainter::{HighQuality->}Antialiasing
* QPalette::{background->window}()
* Use Qt::{Background,Foreground}Role
* endl -> Qt::endl, flush -> Qt::flush
* Make YubiKey::s_interfaceMutex non-recursive
* OpenSSHKeyGenDialog: use non-deprecated QComboBox::sizeAdjustPolicy setting
2024-06-22 07:22:44 -04:00
James CarrollandJonathan White 5f2ee86d72 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 <[email protected]>
2024-06-19 15:49:30 -04:00
varjolintu ad8a00d56b Passkeys: Fix incorrect username fill 2024-06-12 21:27:06 -04:00
varjolintu 1d008dbd72 Passkeys: Return authenticatorData and publicKeyAlgorithm to extension 2024-06-12 21:25:39 -04:00
Carlo TeubnerandChristoph Reiter c3df16147d Cleanup compiler warnings on all platforms (#10847)
Fixes #10730.

Co-authored-by: Christoph Reiter <[email protected]>
2024-06-12 21:25:15 -04:00
Carlo Teubner ecdebd71c1 Fix file permissions for some files
Ensure that files that shouldn't be executable aren't.
2024-06-06 17:35:49 -04:00
Carlo Teubner 9288bef4f5 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-01 15:53:35 -04:00
Sami Vänttinen 5de669eb7b Add action item for removing a passkey from entry (#10777) 2024-05-27 16:50:35 -04:00
Jonathan White 1fd8923746 Fix portable mode detection for native messaging files
* Fixes #10755
2024-05-27 14:47:53 -04:00
varjolintu 92b30ae7ec Passkeys: Register to an existing entry 2024-05-05 13:53:43 -04:00
Sami Vänttinen 5b123e7944 Passkeys: Pass extension JSON data to browser (#10615) 2024-04-25 06:29:51 -04:00
varjolintu cb1ae44a3b Passkeys: Position the confirm dialog with the parent window 2024-04-21 12:23:37 -04:00
varjolintu 41d00135af Passkeys: Fix duplicate database selection 2024-04-21 07:19:16 -04:00
Jonathan White 194409abd6 Remove various undefined/unused functions 2024-03-31 17:19:35 -04:00