Commit Graph

3171 Commits

Author SHA1 Message Date
Jonathan White
b5e0572155 Fix Auto-Type gui guard for tests
Prevent showing gui error dialogs when no gui is present. This can occur during auto-type tests.
2022-06-05 07:04:34 -04:00
Jonathan White
0f3a2531e7 Fix use of modifiers under macOS
* Fix #6463
2022-06-05 07:04:23 -04:00
Jonathan White
dab7047113 Fix file dialog not appearing on snap build
Fix #7607 - Don't disable core dumps when building for snap distribution. Doing so will not allow the xdg-desktop-portal from opening the file dialog. This is because the portal attempts to call entries from /proc/[pid]/xxxx which are restricted to root when core dumps are disabled.
2022-06-05 07:04:11 -04:00
Aetf
0f7b674cbb FdoSecrets: add smarter handling of database unlock requests
This commit implements the following logic:
* If there're already unlocked collections, just use those,
* otherwise, show the unlock dialog until there's an unlocked and exposed collection.

* Fixes #7574
2022-06-04 16:27:18 -04:00
Aetf
e2bf537c4a FdoSecrets: ask to unlock the database when creating items
Also only emit databaseUnlockFinished after the database is unlocked

Fix #7989
2022-06-04 15:49:34 -04:00
SnipFoo
806b8b0901 Add config variable for specifying a default file name for the database 2022-06-04 13:13:49 -04:00
J.M. Dana
a740fe128c Add password strength indicator to PasswordEditWidget
Fixes #7437 (entry edit view only)
Fixes #5220
2022-05-31 07:34:50 -04:00
Patrick Sean Klein
65a1d1b0f7 Limit zxcvbn entropy estimation length
Limit the use of zxcvbn based password entropy estimation to 256 bytes. After this threshold, the average per-byte entropy from the zxcvbn calculation is added for each additional byte. In practice, this produces a slightly higher entropy calculation for purely randomized passwords than zxcvbn would normally calculate. However, the time to calculate is capped leading to a much better user experience and removing unnecessary calculations.

Fixes #7712
2022-05-30 10:46:39 -04:00
Hugo
1009650b5c
Move socket into separate directory (#8030)
This is mostly to ease setup and configuration with sandboxed browsers.

The socket currently existing in `$XDG_RUNTIME_DIR`. When sandboxing a browser, it would be unsafe to mount this directory inside the sandbox.
Mounting the socket into the sandbox's filesystem is also not possible in cases where KeePassXC is [re]started after the browser has started.

This commit moves the socket into its own isolated subdirectory, which can be safely mounted into sandboxes. Sandbox engines can create the directory themselves (in case the browser starts before KeePassXC). Both Flatpak and Firejail support this configuration.

A symlink is also created, linking the previous location to the new location. This is meant for backwards compatibility and should eventually be dropped.

The directory can't be named `org.keepassxc.KeePassXC.BrowserServer`,
since that would collide with the symlink. Instead, the directory has been created to match the format used for Flatpak builds, which make it a bit less of a snowflake build, while following accepted conventions.

Given that the preferred path now matches what Flatpak uses, the block handling Flatpak and non-Flatpak is now the same.

If `$XDG_RUNTIME_DIR` is undefined, the temporary directory is used, though reading the socket from this location is discouraged.

Closes: https://github.com/keepassxreboot/keepassxc/issues/8018
References: https://github.com/keepassxreboot/keepassxc/discussions/6741
2022-05-28 18:19:48 -04:00
Carlo Teubner
b14bec3bb0 Remove unused header files 2022-05-28 17:26:41 -04:00
Aetf
a4c5997050 FdoSecrets: skip entries in recycle bin when searching (fix #7933) 2022-05-28 15:36:17 -04:00
Nicolas Roeser
aa97bd5213 Align generator logic and UI for math symbols
In the password generator widget, the checkable push button for the math
symbols is missing the GREATER-THAN SIGN (U+003E), even though it is
among the possible characters during password generation when the button
is checked. Add the missing character to the text displayed to users.

While at it, also fix a wrong comment containing the possible
characters.
2022-05-28 15:24:57 -04:00
Rosen Penev
a4d4adb1f6 clang-tidy: use nullptr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-05-03 15:32:54 -04:00
Rosen Penev
7e1d980d08 clang-tidy: use auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-05-01 16:02:02 -04:00
Rosen Penev
f3f1520f81 clang-tidy: C++ headers
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-05-01 16:01:46 -04:00
Rosen Penev
7e44b67906 clang-tidy: use override
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-05-01 16:01:31 -04:00
Rosen Penev
44333fef0a clang-tidy: use range loop
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-05-01 16:01:11 -04:00
Carlo Teubner
9bf61bfc5c Fix Botan deprecation warning
Use the non-deprecated PK_Signer constructor overload, by explicitly
passing in our random-number generator.
2022-04-18 09:45:29 -04:00
Piraty
7edeceec03
Link ykcore against pthread (#7807) 2022-04-15 10:27:04 +02:00
hka
692c95b11e
Normalize path (slashes to be precise) when opening a database or saving the last used database paths (#7864)
Fixes #7821
2022-04-12 21:05:06 +02:00
Aetf
6b0eeb9722 FdoSecrets: do not share entry <-> item property by multiple unlock prompts
Fixes #7753
2022-04-05 18:08:46 -04:00
louib
7cd824ae1c
Upstream Flathub patches (#7728) 2022-04-04 19:04:18 -04:00
Jonathan White
31db3c325d Fix compiling with minizip-ng
* minizip-ng has slightly different defines and function names than the original minizip. These changes adapt the existing code to use the minizip-ng versions if necessary.
2022-04-03 13:28:39 -04:00
Jonathan White
656e6161a0 Add tags to history comparison 2022-04-03 13:28:39 -04:00
Jonathan White
44be95cc1b Fix crash when building history changes
* Replace rarely hit asserts with defined nullptr checks when replacing references without a group
* Fix #7603
* Replace TOTP history comparison with checking the actual TOTP output instead of a compiled string
2022-04-03 13:28:39 -04:00
Jonathan White
48a3fd8e3c Fix detection of hardware keys in keepassxc-cli
* Split calls to finding hardware keys into sync and async methods. This has the side effect of simplifying the code.
* Check for keys before performing challenge/response if no keys have been found previously.
* Correct timeout of user interaction message to interact with the hardware key.
* Correct error in TestCli::testYubiKeyOption
2022-04-03 13:26:12 -04:00
Jonathan White
7d7c635423 Disable debug messages in release builds
Also correct / remove various debug messages
2022-04-03 13:26:12 -04:00
Jonathan White
097be1a5cd Fix Auto-Typing single character placeholders
* Fix #7743 - Include # in placeholder list
* This change fixes typing single character placeholders (escaped placeholders) on Windows. Previously we were sending these as raw key presses which didn't properly press Shift or other modifiers. Now they are sent as unicode characters unless in virtual mode (the expected behavior).
2022-04-02 12:51:33 -04:00
Jonathan White
c5d25ac371 Fix Auto-Type modifiers on Windows
Also add documentation on modifiers.

* Fix #7626
2022-04-02 12:51:33 -04:00
Jonathan White
dd5217734c Improve Entry Preview layout
* Fix #7672 - notes preview spans the entire length of the preview pane again
* Fix #4242 - Allow selecting entry title text in preview
* Improve multi-line tag preview
* Fixup alignment and spacing of fields
2022-04-02 12:50:54 -04:00
Jonathan White
41061cfde8 Improve speed of AES KDF transform
* Remove parallel left/right block calculations in favor of calculating both blocks simultaneously. This brings the calculation within parity of 2.6.6.
* Fix #7682
2022-04-02 12:50:43 -04:00
Jonathan White
d8da81d87c Revert DatabaseOpenDialog to be always on top on Linux
Fixes regression due to issues with dialogs appearing above other windows on some Linux Desktop Envs.
2022-04-02 12:50:31 -04:00
Toni Spets
2b8d670f17 SSH Agent: Fix Windows agent selection, radio buttons 2022-04-02 08:47:00 -04:00
Bernhard Kirchen
aca197a96f
Add 12 hours expiration preset (#7738)
* Add hours precision to TimeDelta

* Add 12 hours expiration preset

Fixes #7369
2022-03-31 07:02:28 -04:00
Rosa Hase
044fc8d50c Use setChangeCurrentOnDrag property to handle drag and drop between tabs
.FIXES #7155
2022-03-29 23:19:32 -04:00
Janek Bevendorff
5c45cf2d76 Clear quick unlock secrets when database tab is closed 2022-03-29 23:17:38 -04:00
Janek Bevendorff
7eb7172635 Fix regression: Hide password before unlocking database
Fixes #7724
2022-03-29 23:17:38 -04:00
Jonathan White
02602da257 Several improvements to tags editing
* Fix #7602 - Allow spaces in tag names
* Fix #7528 - Allow pasting text into the tags field. Text is split by comma creating tags for each section of text. If there are no commas then the pasted text becomes a tag.
* Fix tags editing not causing the entry to be marked as modified.
2022-03-29 18:41:31 -04:00
Jonathan White
ad61d71c6e CLI: Add missing parameters to add/edit commands
This adds the `-c` parameter to the password generator when adding/editing entries via the CLI.
2022-03-28 22:08:01 -04:00
Toni Spets
fc5a07b46d Auto-Type: Map ASCII dead keys on Linux
Special handling of ASCII keys that are common in passwords that
may be dead on the current keyboard layout and prevents going to
keysym emulation fallback.
2022-03-28 06:24:58 -04:00
tenzap
01b15fbeba Fix compilation on macOS < 12.0.1
Used methods for touchID on macOS require macOS >= 12.0.1
2022-03-27 15:54:22 -04:00
tenzap
c33995e075 fix compilation of TagsEdit.cpp
qOverload appeared with qt5.7

Reported error:
keepassxc-2.7.0-src/src/gui/tag/TagsEdit.cpp:414:34: error: use of undeclared identifier 'qOverload'
        connect(completer.get(), qOverload<QString const&>(&QCompleter::activated), [this](QString const& text) {
                                 ^
2022-03-27 15:52:31 -04:00
Jonathan White
4178e72fe0 Reduce delay when searching entries in Auto-Type select dialog
* Fix #7596
2022-03-23 16:15:45 -04:00
Jonathan White
eac60b3228 Correct timing issue with entry level Auto-Type on some platforms
* Fixes #7584
2022-03-22 16:10:05 -04:00
Aetf
7d3c3b09fb FdoSecrest: allow remember decision for future entries
Also added a reset decision button in session management tab

Fixes #7464

* Fix distorted button in settings page: the default margin in QToolBar is too large for our use case in a table row.
2022-03-21 08:42:17 -04:00
Jonathan White
9e21df2515
Remove unused variable from Windows Auto-Type 2022-03-21 07:41:56 -04:00
alcroito
ab153a24ec Run macdeployqt only once at install time
Instead of running macdeployqt once for each extra helper binary and
plugin (plus the main run for the application itself), collect all the
binaries that should be processed and run macdeloyqt only once after
all the binaries have been installed.

This also moves the main app macdeployqt call from a POST_BUILD step
to an install(CODE) step, making increment rebuilds of the app faster.

To ensure that macdeployqt is called after all the binaries are
installed, a new post_install subdirectory is needed to
circumvent CMake's limitation regarding the default order of
installation.
CMake first runs the current directory install() calls and then it's
child subdirectory ones. Because we want macdeployqt to be the last
install() call, it needs to be done inside a subdirectory that is
added last.

Note due to a bug in macdeployqt, the deployed app inside the .dmg
file will fail to run on arm macs, due to broken code signature.
See https://bugreports.qt.io/browse/QTBUG-101696 for details.

For the final release, the release-tool should take care of proper
resigning.
2022-03-21 00:15:57 +01:00
Janek Bevendorff
60f7744ec6 Fix translations 2022-03-20 23:31:52 +01:00
Jonathan White
1ca358f3fd Improve KDBX error messages 2022-03-20 23:31:52 +01:00
Jonathan White
cf5429a39b Allow colon in tags and sort alphabetically
* Fix #7489 - allow colon and period in tag names
* Fix #7490 - sort tags alphabetically
2022-03-20 13:33:46 -04:00
Jonathan White
4cc5850c86 Fix broken documentation menu items 2022-03-20 13:33:32 -04:00
Jonathan White
7da9899c48 Correct snapcraft build and update appdata xml 2022-03-20 13:33:32 -04:00
Jonathan White
9569438295 Always enable Auto-Type help button 2022-03-20 17:49:03 +01:00
Jonathan White
8a7eb36950 Several fixes for Auto-Type
* On Windows, offer explicit methods to use the virtual keyboard style of typing. This partially reverts 1150b69836 by going back to the standard unicode method by default. However, uses can either add {MODE=VIRTUAL} to their sequence or choose "Use Virtual Keyboard" / CTRL+4 from the selection dialog.

* Took this opportunity to clean up the signature of  AutoType::performAutoType and AutoType::performAutoTypeWithSequence by removing the "hideWindow" attribute.

* Show keyboard shortcuts on the selection dialog context menu

* Fix selection dialog help icon color when in dark theme
2022-03-19 08:23:53 -04:00
Jonathan White
392cab2e36 Remove unused/duplicate icons 2022-03-19 08:23:53 -04:00
Chih-Hsuan Yen
c363e4a969 Generate the D-Bus adaptor class on the fly
That prevents mismatches between the adaptor class and the D-Bus
definition file.

Note that this is a backward-incompatible change. For example, the
command to lock all databases is changed from

> dbus-send --session --print-reply --dest=org.keepassxc.KeePassXC.MainWindow --type=method_call /keepassxc org.keepassxc.MainWindow.lockAllDatabases

to

> dbus-send --session --print-reply --dest=org.keepassxc.KeePassXC.MainWindow --type=method_call /keepassxc org.keepassxc.KeePassXC.MainWindow.lockAllDatabases

Fixes: https://github.com/keepassxreboot/keepassxc/issues/5355
2022-03-13 06:15:48 -04:00
Janek Bevendorff
e07d143c9b
Skip "StatusIndicator" window in Auto-Type window list (#7527)
Starting with macOS 12.2, when the audio recording indicator is shown, the
"Window Server" process injects a "StatusIndicator" window into the list of
active windows, which messes with Auto-Type's window title matching. This
window has an Alpha value of 1 (so technically, it is not invisible), and it
is always in front of all other windows. Hence, the only way to skip it is by
title and owner name.

Fixes #7418
2022-03-12 21:07:36 +01:00
Jonathan White
4bc32d37ac Retain quick unlock if Hardware Key is missing
* The hardware key missing error message is properly shown and the user can try to Quick Unlock again after plugging in or tapping the hardware key in time.
2022-03-10 16:54:15 -05:00
Jonathan White
0ad75ccb8f Fix missing include in alloc preventing some secure deallocations 2022-03-07 11:15:59 -05:00
Jonathan White
a2140d7081 Update contributors and Patrons on About Dialog 2022-03-06 12:50:30 -05:00
Jonathan White
e5a2958458 Revert back to Argon2 reference library
* Fix #7487 - Botan does not use threads when calculating Argon2 KDF leading to very poor performance for a parallelism value > 1.
* Include port file for vcpkg backed builds
2022-03-06 12:50:17 -05:00
alcroito
abfebea4f2 Fix rpath handling and deployment of macOS helper binaries
CPack by default invokes the 'make install' target to install
all project files into a staging area for further packaging.

The order of installation follows the order of install() commands.

One of the first install() commands is the one that installs the
KeePassXC.app bundle and all the contents inside of it,
which includes POST_BUILD copied binaries like keepassxc-cli
and keepassxc-proxy.

Subsequent install(TARGETS) commands would then override the
keepassxc-cli and keepassxc-proxy binaries inside the staging area
with the ones which didn't have macdeployqt run on them (the ones from
src/cli and src/proxy).
Launching the binaries would then fail because of missing rpath
adjustments.

The libkeepassxc-autotype-cocoa.so library was working fine because
there is no install(TARGETS) command for it in a WITH_APP_BUNDLE build,
so the POST_BUILD copy with the adjusted rpaths was preserved.

To fix the issue and make the handling consistent, macdeployqt is no
longer run at POST_BUILD time, but instead at 'make install' time,
after each binary is installed by install(TARGETS).

libkeepassxc-autotype-cocoa.so also has its install command run
unconditionally now.

The build dir binaries that are POST_BUILD copied into
src/KeePassXC.app continue to run because they use the build dir
rpaths that CMake embeds by default. They don't macdeployqt run for
them anymore, which slightly speeds up the build time.

Fixes: #7475
2022-03-05 11:03:50 -05:00
Jonathan White
e85425050b Properly press AltGr key in Windows Auto-Type
* Fix #7456
2022-02-25 06:05:21 -05:00
Jonathan White
f3b0fe46b4
Fix excluding characters in password generator
* Fixes #7451
2022-02-23 17:57:52 -05:00
Sami Vänttinen
7284a8062a
Fix password generator responses (#7404)
* Respond directly to the current client instead of broadcasting

* Append requestID to generate-password response
2022-02-23 17:48:50 -05:00
Sami Vänttinen
6791024995
Fix new password generator closed reply with Browser Integration (#7359) 2022-02-23 17:48:50 -05:00
Jonathan White
4f0710350f Add support for Windows Hello
* Special thanks to @HexF and @smlu for their contributions towards this feature.

* Add MVP support for Windows Hello as a Quick Unlock solution using the WinRT API. This works by signing a random challenge vector with the Windows Hello protected key store (typically from TPM). The signed challenge is hashed using SHA-256 and then used as the encryption key to encrypt the database credentials. Credentials are encrypted using AES-256/GCM. This ensures the database password can only be decrypted following a successful authentication with Windows Hello in the future.

* Unify Touch ID and Windows Hello behavior under the Quick Unlock branding. Remove all timeout features of Touch ID as they are unnecessary and complicate the feature for no security gain.

* Quick Unlock is automatically reset only when the database key is changed vice whenever database settings are modified.

* Don't set database unlock dialog as always on top. This allows Touch ID and Windows Hello prompts to appear above the dialog properly.

* Prevent quick unlock when using AutoOpen or opening from the command line.
2022-02-22 17:53:50 -05:00
Jonathan White
a76daeb4c5 Add key serialization to support Quick Unlock 2022-02-22 17:53:50 -05:00
Bernhard Kirchen
acce1bc5ce entry preview: blend background of tags when inactive 2022-02-21 11:53:37 -05:00
Toni Spets
bfbc0e5ec6 Auto-Type: Allow retyping with automatic relock
If relock after performing Auto-Type is enabled it will wait until
specified timeout before doing so.

Retype time is now configurable and is decreased from the old
hardcoded 30 seconds down to 15 seconds to keep the default a bit
more secure while still allowing the user to set it higher for
their liking.

To restore old behavior the user can set retype time to 0 which
will make the database relock instantly.

Auto-Type relock setting relocated to Auto-Type tab to group it
better with the other Auto-Type settings.
2022-02-20 16:12:16 -05:00
Jonathan White
0701d1d6cd Fix styling of database tag view in main window
* Also allow collapsing the entire left splitter instead of a dedicated option to hide the group view.
2022-02-20 15:37:22 -05:00
Magnus Groß
d10c5a4e2a Detect system dark mode preference changes without restart on Linux
The new org.freedesktop.appearance.color-scheme key allows us to do this
in a reliable way.

Recently freedesktop standardized the system dark mode preference in a
desktop environment independent way in the xdg-desktop-portal
specification.

The specification can be seen here: d7a304a006/data/org.freedesktop.impl.portal.Settings.xml (L33-L45)

KDE supports this since KDE Plasma 5.24 and Gnome supports this since
Gnome 42.

Relevant blog post: https://blogs.gnome.org/alexm/2021/10/04/dark-style-preference/

Fixes #7146
2022-02-17 20:17:45 -05:00
Jonathan White
58615d78bd Fix using modifier keys
* Fix error in regex that prevented use of modifier keys in general.
* Added '#' modifier to press the "Meta" button. This correlates to the Windows key on Windows and Command key on macOS.
* Fix #6695 - send proper modifier keys based on documentation
2022-02-08 19:07:43 -05:00
Jonathan White
1150b69836 Fix Windows Auto-Type sending characters to virtualized guests
* Fix #1833
2022-02-08 19:07:43 -05:00
Toni Spets
5927821896 Auto-Type: Only match non-empty associations
Previously empty associations matched any window but since you can
use a wildcard (*) if you specifically want that this change makes
it possible to define multiple sequences for the global search
if you need to.

Additionally show empty associations in the list as "(empty)" to
better differentiate between rows if no title is set.
2022-02-08 19:07:00 -05:00
Balazs Gyurak
6897787d8f Show expired entries on DB unlock
* Show banner message about expired entries
* Add config option and expiration offset
* Only show expiry warning on first DB unlock
* Default to on with 3-day offset from expiration
2022-01-31 07:19:45 -05:00
Jonathan White
3c824cb500 Add powershell version of release-tool 2022-01-31 07:00:08 -05:00
Matt Miller
b29e8fb0b5 Update tab order for CSV import dialog to match screen order (order top-bottom first then left-right) 2022-01-28 21:28:54 -05:00
Jonathan White
6a12f450e6
Fix access denied errors when using KeeShare export/sync (#7322) 2022-01-28 21:28:01 -05:00
Patrick Klein
bce8c84c26
Remove obsolete read only state from database. (#7324) 2022-01-28 21:26:53 -05:00
oysteins-a
c914c116e4 Fixed typo occurences 2022-01-28 21:25:31 -05:00
Jonathan White
7f92504a2d Fix wildcard window title matching in Auto-Type
* Fixes #6413
2022-01-28 19:38:30 -05:00
Xavier Valls
4a21cee98c Add tags feature
* show the tags in the entry preview
* allow searching by tag
* add a sidebar listing the tags in the database
* filter entries by tag on click
* Introduce a new TagsEdit widget that provides pill aesthetics, fast removal functionality and autocompletion
* add tests for the tags feature
* introduce the "is" tag for searching. Support for weak passwords and expired added.
2022-01-28 16:13:49 -05:00
varjolintu
7efaca6fbe Accept kdbx:// urls in Edit Entry view 2021-12-30 08:14:30 -05:00
Sami Vänttinen
cd642e7fee
Add support for Browser statistics (#7197)
Co-authored-by: Jonathan White <support@dmapps.us>
2021-12-30 07:31:06 -05:00
osx user
15d1b2f0ab Show what changed between entry history items
* Also show what is changed on the current state
* Closes #2621
2021-12-22 05:52:54 -05:00
Jonathan White
12990e59ad KeeShare: Remove checking signed container
* Remove QuaZip dependency in favor of minizip
* Remove signature checks, but maintain signatures for backwards compatibility
* Remove UI components related to certificates except for personal certificate for backwards compatibility
* Default to unsigned containers (*.kdbx)
2021-12-14 23:23:23 -05:00
Lorenzo Tucci
c88d8c870f Add lock selected database action on toolbar
Closes #6445

Switch tab when locking a database and move Lock Database actions to the Database section of the toolbar.
2021-12-12 23:40:59 -05:00
Daniel Peshev
456726556d Add url field to download favicon 2021-12-12 12:32:11 -05:00
varjolintu
12d16f67ae Download favicon in the background after credential add 2021-12-12 08:14:14 -05:00
Geert Ijewski
d16fc2d62a Add db statistic output to CLI db-info command.
Closes #6920
2021-12-08 23:41:05 -05:00
mckeema
6c4a82bd51 Make selected text copyable instead of copying password
* Fixes 7209
2021-12-08 19:39:51 -05:00
Patrick Klein
a0a063b57f
Add -i/--include option to "generate" CLI command. (#7112) 2021-12-07 23:40:09 -05:00
evgfilim1
b3896f2600 Add simple detection of timestamp resolution
Set access time equal to modification time
2021-12-03 12:07:18 -05:00
Toni Spets
606096278b Auto-Type: Remember previous selected global match
This makes using multi-stage login forms slightly easier as you
can avoid typing the search terms multiple times.
2021-11-26 10:31:20 -05:00
Toni Spets
2fb1c076d4 SSH Agent: Show correct error messages in main window
Fixes #7152
2021-11-24 22:37:28 -05:00
tenzap
dc7ad6c1b7
Fix syntax issue & add a missing header (#7160)
* Fix syntax to prevent compilation issue

Fix build failure with AppleClang 7 & 8.

Error was:
src/core/CustomData.cpp:30:41: error: default initialization of an object of const type 'const CustomData::CustomDataItem' without a user-provided default constructor
static const CustomData::CustomDataItem NULL_ITEM;
                                        ^
                                                 {}
src/core/Metadata.cpp:32:39: error: default initialization of an object of const type 'const Metadata::CustomIconData' without a user-provided default constructor
static const Metadata::CustomIconData NULL_ICON;
                                      ^

src/core/Metadata.cpp:32:48: note: add an explicit initializer to initialize 'NULL_ICON'
static const Metadata::CustomIconData NULL_ICON;
                                               ^
                                               {}

* Add missing QUuid header

Fixes this compilation issue with LLVM clang 9, possibly also due to an old QT5

tests/TestTools.cpp:96:39: error: incomplete type 'QUuid' named in nested name specifier
    auto validUuid = Tools::uuidToHex(QUuid::createUuid());
                                      ^~~~~~~
/opt/local/libexec/qt5/lib/QtCore.framework/Headers/qmetatype.h:1887:1: note: forward declaration of 'QUuid'
QT_FOR_EACH_STATIC_CORE_CLASS(QT_FORWARD_DECLARE_STATIC_TYPES_ITER)
^
/opt/local/libexec/qt5/lib/QtCore.framework/Headers/qmetatype.h:108:18: note: expanded from macro 'QT_FOR_EACH_STATIC_CORE_CLASS'
    F(QUuid, 30, QUuid) \
                 ^
tests/TestTools.cpp:101:40: error: incomplete type 'QUuid' named in nested name specifier
    auto nonHexUuid = Tools::uuidToHex(QUuid::createUuid()).replace(0, 1, 'p');
                                       ^~~~~~~
/opt/local/libexec/qt5/lib/QtCore.framework/Headers/qmetatype.h:1887:1: note: forward declaration of 'QUuid'
QT_FOR_EACH_STATIC_CORE_CLASS(QT_FORWARD_DECLARE_STATIC_TYPES_ITER)
^
/opt/local/libexec/qt5/lib/QtCore.framework/Headers/qmetatype.h:108:18: note: expanded from macro 'QT_FOR_EACH_STATIC_CORE_CLASS'
    F(QUuid, 30, QUuid) \
                 ^
2021-11-24 22:36:31 -05:00
tenzap
61e378077e
Fix compilation on macOS when clang < 9 or Qt < 5.12 (#7117)
* fix compilation on Qt not having QOperatingSystemVersion::MacOSBigSur

The code uses 'QOperatingSystemVersion::MacOSBigSur' which doesn't exist
in all Qt versions (it has been backported to Qt 5.12.10+ & 5.15.1+ only).
On older macos systems like El Capitan the last supported
version of Qt is 5.11

This will fix compilation issue on such older systems and on systems
running with Qt not supporting QOperatingSystemVersion::MacOSBigSur

Compilation error was:
error: no member named 'MacOSBigSur' in 'QOperatingSystemVersion'

* Fix compilation when osx <= 10.9

* AppKitImpl.mm: button property is new in 10.10. It is used for a feature of
  KeePassXC that is only available from 10.17 onwards. So we don't need it when
  compiling on <= 10.9
error: property 'button' not found on object of type 'NSStatusItem *'
        NSString* appearance = [dummy.button.effectiveAppearance.name lowercaseString];
                                      ^

* The code uses @available syntax which is supported by
  AppleClang >= 9 or LLVM >= 5.
  We check __clang_major__ to allow compilation on older versions
  of macOS that don't have a recent clang. For example on El Capitan.

* Fix compilation when osx <= 10.8

* AppKitImpl.mm: AXIsProcessTrustedWithOptions exists from 10.9 onwards
error: use of undeclared identifier 'kAXTrustedCheckOptionPrompt'
error: use of undeclared identifier 'AXIsProcessTrustedWithOptions'

* Fix compilation when osx <= 10.7

* MacUtils.cpp: CoreGraphics exists from 10.8 onwards only, capslock detection
  feature would have to be implemented on OSX <= 10.7

* AppKitImpl.mm: CGDisplayStreamRef exists from 10.8 onwards only. It is used for a
  feature of KeePassXC that is only available from 10.15 onwards. So we don't need it
  when compiling on <= 10.7
error: unknown type name 'CGDisplayStreamRef'

* AppKitImpl.mm: Syntax is not understood by 10.7, update it to be understandable
  by <= 10.7
error: expected method to read dictionary element not found on object of type 'NSDictionary *'
    NSRunningApplication* app = userInfo[NSWorkspaceApplicationKey];
                                ^

* The code uses @available syntax which is supported by
  AppleClang >= 9 or LLVM >= 5.
  We check __clang_major__ to allow compilation on older versions
  of macOS that don't have a recent clang.

* Fix compilation error on OS X 10.11

src/core/Alloc.cpp:44:10: error: no type named 'free' in namespace 'std'
    std::free(ptr);
    ~~~~~^

This is a regression, since it was fixed in [1]

Per [2], std::free() needs #include <cstdlib>. That file is included
indirectly on newer systems.

[1] 7c6c027d33
[2] https://en.cppreference.com/w/cpp/memory/c/free

* fix compilation when macos SDK <= 10.14

These methods are only available from macOS 10.15
  - kSecAccessControlWatch
  - LAPolicy.deviceOwnerAuthenticationWithBiometricsOrWatch

The code uses @available syntax which is supported by
AppleClang >= 9 or LLVM >= 5.
We check __clang_major__ to allow compilation on older versions
of macOS that don't have a recent clang.
2021-11-24 22:35:38 -05:00
Patrick Sean Klein
296cbf0df7 Add sorting of HTML export
- Closes #6164
- Implement sorting support in HtmlExporter
- Add ExportDialog class and UI, which allows to configure export options.
2021-11-24 00:12:13 -05:00
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