From ac9fcc623d1808ee2eab6ebf9162997165d564d7 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Wed, 13 Dec 2023 09:41:36 +0100 Subject: [PATCH] solve build issue and warnings Signed-off-by: Matthieu Gallien --- NEXTCLOUD.cmake | 5 ++--- config.h.in | 2 +- src/gui/accountsettings.cpp | 2 +- src/libsync/account.cpp | 8 ++++++++ src/libsync/clientsideencryption.cpp | 2 +- src/libsync/clientsideencryption.h | 3 +-- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/NEXTCLOUD.cmake b/NEXTCLOUD.cmake index c942be4da55a4..ca85a3fe93b46 100644 --- a/NEXTCLOUD.cmake +++ b/NEXTCLOUD.cmake @@ -54,7 +54,8 @@ set( APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR ${NEXTCLOUD_BACKGROUND_COLOR} CA set( APPLICATION_WIZARD_HEADER_TITLE_COLOR "#ffffff" CACHE STRING "Hex color of the text in the wizard header") option( APPLICATION_WIZARD_USE_CUSTOM_LOGO "Use the logo from ':/client/theme/colored/wizard_logo.(png|svg)' else the default application icon is used" ON ) -set(ENCRYPTION_HARDWARE_TOKEN_DRIVER_PATH "{}") +set(ENCRYPTION_HARDWARE_TOKEN_DRIVER_PATH "") +set (CLIENTSIDEENCRYPTION_ENFORCE_USB_TOKEN false) # ## Windows Shell Extensions & MSI - IMPORTANT: Generate new GUIDs for custom builds with "guidgen" or "uuidgen" @@ -81,5 +82,3 @@ endif() if (APPLE) option( BUILD_FILE_PROVIDER_MODULE "Build the macOS virtual files File Provider module" OFF ) endif() - -set (CLIENTSIDEENCRYPTION_ENFORCE_USB_TOKEN true) diff --git a/config.h.in b/config.h.in index 2bf9c2699979a..b1866a098b4e6 100644 --- a/config.h.in +++ b/config.h.in @@ -63,6 +63,6 @@ #cmakedefine CLIENTSIDEENCRYPTION_ENFORCE_USB_TOKEN @CLIENTSIDEENCRYPTION_ENFORCE_USB_TOKEN@ -#cmakedefine ENCRYPTION_HARDWARE_TOKEN_DRIVER_PATH @ENCRYPTION_HARDWARE_TOKEN_DRIVER_PATH@ +#cmakedefine ENCRYPTION_HARDWARE_TOKEN_DRIVER_PATH "@ENCRYPTION_HARDWARE_TOKEN_DRIVER_PATH@" #endif diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 419e7ce54fbcc..aa8a0ed1063de 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -1109,7 +1109,7 @@ void AccountSettings::migrateCertificateForAccount(const AccountPtr &account) _ui->encryptionMessage->removeAction(action); } - account->e2e()->migrateCertificate(this, account); + account->e2e()->migrateCertificate(); slotE2eEncryptionGenerateKeys(); } diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp index 512e1d5d8cf61..895a8ab9ba712 100644 --- a/src/libsync/account.cpp +++ b/src/libsync/account.cpp @@ -1051,12 +1051,20 @@ bool Account::askUserForMnemonic() const bool Account::enforceUseHardwareTokenEncryption() const { +#if defined CLIENTSIDEENCRYPTION_ENFORCE_USB_TOKEN return CLIENTSIDEENCRYPTION_ENFORCE_USB_TOKEN; +#else + return false; +#endif } QString Account::encryptionHardwareTokenDriverPath() const { +#if defined ENCRYPTION_HARDWARE_TOKEN_DRIVER_PATH return ENCRYPTION_HARDWARE_TOKEN_DRIVER_PATH; +#else + return {}; +#endif } QByteArray Account::encryptionCertificateFingerprint() const diff --git a/src/libsync/clientsideencryption.cpp b/src/libsync/clientsideencryption.cpp index 812c6b52b01e4..3168313eb8f57 100644 --- a/src/libsync/clientsideencryption.cpp +++ b/src/libsync/clientsideencryption.cpp @@ -1743,7 +1743,7 @@ void ClientSideEncryption::forgetSensitiveData(const AccountPtr &account) Q_EMIT userCertificateNeedsMigrationChanged(); } -void ClientSideEncryption::migrateCertificate(QWidget *settingsDialog, const AccountPtr &account) +void ClientSideEncryption::migrateCertificate() { _usbTokenInformation.clear(); } diff --git a/src/libsync/clientsideencryption.h b/src/libsync/clientsideencryption.h index 0a32c36f21d4c..c23518da9bb2f 100644 --- a/src/libsync/clientsideencryption.h +++ b/src/libsync/clientsideencryption.h @@ -252,8 +252,7 @@ public slots: const OCC::AccountPtr &account); void forgetSensitiveData(const OCC::AccountPtr &account); - void migrateCertificate(QWidget *settingsDialog, - const OCC::AccountPtr &account); + void migrateCertificate(); private slots: void generateKeyPair(const OCC::AccountPtr &account);