From 080b02e9d538658d2ff6254022f2a8161e2b7da8 Mon Sep 17 00:00:00 2001 From: Christian Kieschnick Date: Fri, 4 Jan 2019 09:33:00 +0100 Subject: [PATCH] KeeShare uses only one flag - checks for QuaZip Changed flag for KeeShare to * enable insecure sharing in all cases * enable secure sharing if QuaZip was found --- CMakeLists.txt | 32 +++++++++++++++++--------------- src/CMakeLists.txt | 2 +- src/gui/AboutDialog.cpp | 4 ++-- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3370f1873..6e34a82c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,8 +47,7 @@ option(WITH_XC_NETWORKING "Include networking code (e.g. for downlading website option(WITH_XC_BROWSER "Include browser integration with keepassxc-browser." OFF) option(WITH_XC_YUBIKEY "Include YubiKey support." OFF) option(WITH_XC_SSHAGENT "Include SSH agent support." OFF) -option(WITH_XC_KEESHARE_INSECURE "Sharing integration with KeeShare with insecure sources" OFF) -option(WITH_XC_KEESHARE_SECURE "Sharing integration with KeeShare with secure sources" OFF) +option(WITH_XC_KEESHARE "Sharing integration with KeeShare" OFF) if(APPLE) option(WITH_XC_TOUCHID "Include TouchID support for macOS." OFF) endif() @@ -60,20 +59,12 @@ if(WITH_XC_ALL) set(WITH_XC_BROWSER ON) set(WITH_XC_YUBIKEY ON) set(WITH_XC_SSHAGENT ON) - set(WITH_XC_KEESHARE_INSECURE ON) - set(WITH_XC_KEESHARE_SECURE ON) + set(WITH_XC_KEESHARE ON) if(APPLE) set(WITH_XC_TOUCHID ON) endif() endif() -if(WITH_XC_KEESHARE_INSECURE OR WITH_XC_KEESHARE_SECURE) - set(WITH_XC_KEESHARE ON) -else() - set(WITH_XC_KEESHARE OFF) -endif() - - if(WITH_XC_SSHAGENT OR WITH_XC_KEESHARE) set(WITH_XC_CRYPTO_SSH ON) else() @@ -367,10 +358,21 @@ endif() include_directories(SYSTEM ${ARGON2_INCLUDE_DIR}) # Optional -if(WITH_XC_KEESHARE_SECURE) - find_package(QuaZip REQUIRED) - - include_directories(SYSTEM ${QUAZIP_INCLUDE_DIR}) +if(WITH_XC_KEESHARE) + find_package(QuaZip QUIET) + if(QuaZip_FOUND) + message(STATUS "Found QuaZip - allow KeeShare with secure container\n") + set(WITH_XC_KEESHARE_INSECURE ON) + set(WITH_XC_KEESHARE_SECURE ON) + include_directories(SYSTEM ${QUAZIP_INCLUDE_DIR}) + else() + message(STATUS "No QuaZip - restrict KeeShare to insecure container\n") + set(WITH_XC_KEESHARE_INSECURE ON) + set(WITH_XC_KEESHARE_SECURE OFF) + endif() +else() + set(WITH_XC_KEESHARE_INSECURE OFF) + set(WITH_XC_KEESHARE_SECURE OFF) endif() # Optional diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 446b74447..f0313d4e9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -202,7 +202,7 @@ add_feature_info(Auto-Type WITH_XC_AUTOTYPE "Automatic password typing") add_feature_info(Networking WITH_XC_NETWORKING "Compile KeePassXC with network access code (e.g. for downloading website icons)") add_feature_info(KeePassXC-Browser WITH_XC_BROWSER "Browser integration with KeePassXC-Browser") add_feature_info(SSHAgent WITH_XC_SSHAGENT "SSH agent integration compatible with KeeAgent") -add_feature_info(KeeShare-Insecure WITH_XC_KEESHARE_INSECURE "Sharing integration with KeeShare with insecure sources") +add_feature_info(KeeShare-Insecure WITH_XC_KEESHARE_INSECURE "Sharing integration with KeeShare restricted to insecure sources") add_feature_info(KeeShare-Secure WITH_XC_KEESHARE_SECURE "Sharing integration with KeeShare with secure sources") add_feature_info(YubiKey WITH_XC_YUBIKEY "YubiKey HMAC-SHA1 challenge-response") if(APPLE) diff --git a/src/gui/AboutDialog.cpp b/src/gui/AboutDialog.cpp index 9c9bf88e2..cbc0c5cf0 100644 --- a/src/gui/AboutDialog.cpp +++ b/src/gui/AboutDialog.cpp @@ -91,9 +91,9 @@ AboutDialog::AboutDialog(QWidget* parent) #if defined(WITH_XC_KEESHARE_SECURE) && defined(WITH_XC_KEESHARE_INSECURE) extensions += "\n- " + tr("KeeShare (secure and insecure sharing)"); #elif defined(WITH_XC_KEESHARE_SECURE) - extensions += "\n- " + tr("KeeShare (secure sharing)"); + extensions += "\n- " + tr("KeeShare (only secure sharing)"); #elif defined(WITH_XC_KEESHARE_INSECURE) - extensions += "\n- " + tr("KeeShare (insecure sharing)"); + extensions += "\n- " + tr("KeeShare (only insecure sharing)"); #endif #ifdef WITH_XC_YUBIKEY extensions += "\n- " + tr("YubiKey");