<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/cf6a61c3fae7ae6bd701e9cb81b81e804a2cbc91">https://github.com/macports/macports-ports/commit/cf6a61c3fae7ae6bd701e9cb81b81e804a2cbc91</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new cf6a61c3fae KeePassXC: fix compilation on macos < 10.11
</span>cf6a61c3fae is described below
<span style='display:block; white-space:pre;color:#808000;'>commit cf6a61c3fae7ae6bd701e9cb81b81e804a2cbc91
</span>Author: tenzap <fabstz-it@yahoo.fr>
AuthorDate: Sat Mar 26 11:06:16 2022 +0100
<span style='display:block; white-space:pre;color:#404040;'> KeePassXC: fix compilation on macos < 10.11
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Add patch to fix compilation with qt < 5.7 (for macos 10.7)
</span><span style='display:block; white-space:pre;color:#404040;'> Update touchid patch to fix compilation on macos < 10.11
</span>---
security/KeePassXC/Portfile | 26 ++-
security/KeePassXC/files/patch-qt56-qoverload.diff | 26 +++
security/KeePassXC/files/patch-touch-id.diff | 200 ++++++++++++++++++---
3 files changed, 218 insertions(+), 34 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/security/KeePassXC/Portfile b/security/KeePassXC/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index e159ab3086d..aaecc4aad5b 100755
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/security/KeePassXC/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/security/KeePassXC/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -33,7 +33,7 @@ license_noconflict openssl
</span> if {${subport} eq ${name}} {
# stable
github.setup keepassxreboot keepassxc 2.7.0
<span style='display:block; white-space:pre;background:#ffe0e0;'>- revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ revision 1
</span> github.tarball_from releases
distname keepassxc-${version}-src
use_xz yes
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -103,6 +103,7 @@ depends_lib-append port:argon2 \
</span>
patchfiles patch-no-deployqt.diff \
patch-no-findpackage-path.diff \
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-qt56-qoverload.diff \
</span> patch-touch-id.diff
# KeePassXC uses -fstack-protector-strong on Clang [1]. That flag is not
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -129,6 +130,12 @@ configure.pre_args-append \
</span> -DWITH_XC_UPDATECHECK=OFF \
-DWITH_XC_DOCS=OFF
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# In the future the Touch ID feature may require Darwin 17 (10.13)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://github.com/keepassxreboot/keepassxc/issues/2484
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${os.major} < 16} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.pre_args-append -DWITH_XC_TOUCHID=OFF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # QTest::addRow was introduced in Qt 5.9
# Don't build tests in that case
if {[vercmp ${qt5.version} 5.9] < 0} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -136,16 +143,21 @@ if {[vercmp ${qt5.version} 5.9] < 0} {
</span> }
post-destroot {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- xinstall -d ${destroot}${prefix}/share/doc/${name}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set kp_doc_path ${destroot}${prefix}/share/doc/${name}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -d ${kp_doc_path}
</span> xinstall -W ${worksrcpath} COPYING LICENSE.BSD LICENSE.CC0 \
LICENSE.GPL-2 LICENSE.GPL-3 LICENSE.LGPL-2.1 LICENSE.LGPL-3 \
LICENSE.MIT LICENSE.NOKIA-LGPL-EXCEPTION LICENSE.OFL \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ${destroot}${prefix}/share/doc/${name}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${kp_doc_path}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set kp_app_path ${applications_dir}/KeePassXC.app/Contents/MacOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set kp_bin_path ${destroot}${prefix}/bin
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ln -s ${applications_dir}/KeePassXC.app/Contents/MacOS/keepassxc-cli \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ${destroot}${prefix}/bin/keepassxc-cli
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ln -s ${applications_dir}/KeePassXC.app/Contents/MacOS/keepassxc-proxy \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ${destroot}${prefix}/bin/keepassxc-proxy
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ln -s ${kp_app_path}/keepassxc-cli \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${kp_bin_path}/keepassxc-cli
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ln -s ${kp_app_path}/keepassxc-proxy \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${kp_bin_path}/keepassxc-proxy
</span> }
test.run yes
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/security/KeePassXC/files/patch-qt56-qoverload.diff b/security/KeePassXC/files/patch-qt56-qoverload.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..0212d22540c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/security/KeePassXC/files/patch-qt56-qoverload.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,26 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+commit f7391d904999138158d9bca9e7c34ef18550e2fe
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Author: tenzap <fabstz-it@yahoo.fr>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Sat Mar 26 11:23:32 2022 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fix compilation of TagsEdit.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ qOverload appeared with qt5.7
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Reported error:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ keepassxc-2.7.0-src/src/gui/tag/TagsEdit.cpp:414:34: error: use of undeclared identifier 'qOverload'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ connect(completer.get(), qOverload<QString const&>(&QCompleter::activated), [this](QString const& text) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ^
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/src/gui/tag/TagsEdit.cpp b/src/gui/tag/TagsEdit.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index b4bfb7f..a347940 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/tag/TagsEdit.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/tag/TagsEdit.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -411,7 +411,7 @@ struct TagsEdit::Impl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void setupCompleter()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ completer->setWidget(ifce);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- connect(completer.get(), qOverload<QString const&>(&QCompleter::activated), [this](QString const& text) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ connect(completer.get(), static_cast<void (QCompleter::*)(QString const&)>(&QCompleter::activated), [this](QString const& text) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ currentText(text);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ });
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/security/KeePassXC/files/patch-touch-id.diff b/security/KeePassXC/files/patch-touch-id.diff
</span><span style='display:block; white-space:pre;color:#808080;'>index 3a4a012fb35..86b3c1ae1dd 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/security/KeePassXC/files/patch-touch-id.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/security/KeePassXC/files/patch-touch-id.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,43 +1,189 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/touchid/TouchID.mm
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/touchid/TouchID.mm
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -105,10 +105,12 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- &error);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+commit 1e927a3ae50211f9bcff54858d04fc4474bfe13d
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Author: tenzap <fabstz-it@yahoo.fr>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Sat Mar 26 10:44:33 2022 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ restore WITH_XC_TOUCHID configure option
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ To be able to compile on macOS versions that don't support TouchID and related APIs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/CMakeLists.txt b/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index baa399d..a685ff0 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -59,6 +59,9 @@ option(WITH_XC_UPDATECHECK "Include automatic update checks; disable for control
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(UNIX AND NOT APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ option(WITH_XC_FDOSECRETS "Implement freedesktop.org Secret Storage Spec server side API." OFF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if(APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ option(WITH_XC_TOUCHID "Include TouchID support for macOS." ON)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ option(WITH_XC_DOCS "Enable building of documentation" ON)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(WITH_CCACHE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -82,6 +85,9 @@ if(WITH_XC_ALL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(UNIX AND NOT APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(WITH_XC_FDOSECRETS ON)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(WITH_XC_TOUCHID ON)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Prefer WITH_XC_NETWORKING setting over WITH_XC_UPDATECHECK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 38d162e..d46a163 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -240,6 +240,9 @@ add_feature_info(UpdateCheck WITH_XC_UPDATECHECK "Automatic update checking")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(UNIX AND NOT APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_feature_info(FdoSecrets WITH_XC_FDOSECRETS "Implement freedesktop.org Secret Storage Spec server side API.")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if(APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ add_feature_info(TouchID WITH_XC_TOUCHID "TouchID integration")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_subdirectory(browser)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_subdirectory(proxy)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -351,10 +354,13 @@ if(WITH_XC_KEESHARE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- target_link_libraries(keepassx_core "-framework Foundation -framework AppKit -framework Carbon -framework Security -framework LocalAuthentication")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ target_link_libraries(keepassx_core "-framework Foundation -framework AppKit -framework Carbon")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(Qt5MacExtras_FOUND)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ target_link_libraries(keepassx_core Qt5::MacExtras)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(WITH_XC_TOUCHID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ target_link_libraries(keepassx_core "-framework Security -framework LocalAuthentication")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(HAIKU)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ target_link_libraries(keepassx_core network)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/src/config-keepassx.h.cmake b/src/config-keepassx.h.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 6b855c6..da94bba 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/config-keepassx.h.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/config-keepassx.h.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -19,6 +19,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine WITH_XC_SSHAGENT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine WITH_XC_KEESHARE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine WITH_XC_UPDATECHECK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine WITH_XC_TOUCHID
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine WITH_XC_FDOSECRETS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine WITH_XC_DOCS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/src/gui/DatabaseOpenWidget.cpp b/src/gui/DatabaseOpenWidget.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index bfa4af1..2e7ebf4 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/DatabaseOpenWidget.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/DatabaseOpenWidget.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -59,7 +59,7 @@ namespace
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (isQuickUnlockAvailable()) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if defined(Q_CC_MSVC)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return getWindowsHello()->hasKey(filename);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif defined(Q_OS_MACOS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif defined(Q_OS_MACOS) && defined (WITH_XC_TOUCHID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return TouchID::getInstance().containsKey(filename);
</span> #endif
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101201
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sacObject = SecAccessControlCreateWithFlags(kCFAllocatorDefault,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- kSecAccessControlTouchIDCurrentSet, // depr: kSecAccessControlBiometryCurrentSet,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- &error);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if __clang_major__ >= 9 && MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -279,7 +279,7 @@ void DatabaseOpenWidget::openDatabase()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if defined(Q_CC_MSVC)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // Store the password using Windows Hello
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ getWindowsHello()->storeKey(m_filename, keyData);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif defined(Q_OS_MACOS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif defined(Q_OS_MACOS) && defined(WITH_XC_TOUCHID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // Store the password using TouchID
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ TouchID::getInstance().storeKey(m_filename, keyData);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -336,7 +336,7 @@ QSharedPointer<CompositeKey> DatabaseOpenWidget::buildDatabaseKey()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_ui->messageWidget->showMessage(tr("Failed to authenticate with Windows Hello"), MessageWidget::Error);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return {};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif defined(Q_OS_MACOS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif defined(Q_OS_MACOS) && defined(WITH_XC_TOUCHID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!TouchID::getInstance().getKey(m_filename, keyData)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // Failed to retrieve Quick Unlock data
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_ui->messageWidget->showMessage(tr("Failed to authenticate with Touch ID"), MessageWidget::Error);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -532,7 +532,7 @@ void DatabaseOpenWidget::resetQuickUnlock()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if defined(Q_CC_MSVC)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ getWindowsHello()->reset(m_filename);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif defined(Q_OS_MACOS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif defined(Q_OS_MACOS) && defined(WITH_XC_TOUCHID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ TouchID::getInstance().reset(m_filename);
</span> #endif
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -236,6 +238,9 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ load(m_filename);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp b/src/gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 2dae5cb..e5c5cff 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -200,7 +200,7 @@ bool DatabaseSettingsWidgetDatabaseKey::save()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_db->setKey(newKey, true, false, false);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(Q_OS_MACOS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(Q_OS_MACOS) && defined(WITH_XC_TOUCHID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ TouchID::getInstance().reset(m_db->filePath());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #elif defined(Q_CC_MSVC)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ getWindowsHello()->reset(m_db->filePath());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/src/touchid/TouchID.mm b/src/touchid/TouchID.mm
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 236711e..668a41b 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/touchid/TouchID.mm
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/touchid/TouchID.mm
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,7 +1,9 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define SECURITY_ACCOUNT_PREFIX QString("KeepassXC_TouchID_Keys_")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "touchid/TouchID.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "config-keepassx.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef WITH_XC_TOUCHID
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "crypto/Random.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "crypto/SymmetricCipher.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "crypto/CryptoHash.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -24,6 +26,7 @@ inline QString hash(const QString& value)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QByteArray result = CryptoHash::hash(value.toUtf8(), CryptoHash::Sha256).toHex();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return QString(result);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif //defined(WITH_XC_TOUCHID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /**
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Singleton
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -35,6 +38,7 @@ inline QString hash(const QString& value)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return instance;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef WITH_XC_TOUCHID
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /**
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Generates a random AES 256bit key and uses it to encrypt the PasswordKey that
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * protects the database. The encrypted PasswordKey is kept in memory while the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -230,12 +234,16 @@ inline QString hash(const QString& value)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return m_encryptedMasterKeys.contains(dbPath);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif //defined(WITH_XC_TOUCHID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /**
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Dynamic check if TouchID is available on the current machine.
</span> */
bool TouchID::isAvailable()
{
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if MAC_OS_X_VERSION_MIN_REQUIRED < 101201
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifndef WITH_XC_TOUCHID
</span> + return false;
+#else
// cache result
if (this->m_available != TOUCHID_UNDEFINED) {
return (this->m_available == TOUCHID_AVAILABLE);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -264,6 +269,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -264,8 +272,10 @@ inline QString hash(const QString& value)
</span> this->m_available = TOUCHID_NOT_AVAILABLE;
return false;
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif //defined(WITH_XC_TOUCHID)
</span> }
<span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef WITH_XC_TOUCHID
</span> typedef enum
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -294,7 +300,9 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- policyCode = LAPolicyDeviceOwnerAuthenticationWithBiometricsOrWatch;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101201
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- policyCode = LAPolicyDeviceOwnerAuthenticationWithBiometrics;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if __clang_major__ >= 9 && MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ kTouchIDResultNone,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -329,3 +339,4 @@ inline QString hash(const QString& value)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ this->m_encryptedMasterKeys.remove(databasePath);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif //defined(WITH_XC_TOUCHID)
</span></pre><pre style='margin:0'>
</pre>