2018-10-19 15:41:56 -04:00
|
|
|
# Copyright (C) 2018 KeePassXC Team <team@keepassxc.org>
|
2017-12-19 18:19:04 -05:00
|
|
|
# Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
|
2010-08-07 09:10:44 -04:00
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 2 or (at your option)
|
|
|
|
# version 3 of the License.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2012-05-21 17:37:29 -04:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
2010-08-13 12:08:06 -04:00
|
|
|
|
2017-06-28 09:18:24 -04:00
|
|
|
find_library(ZXCVBN_LIBRARIES zxcvbn)
|
|
|
|
if(NOT ZXCVBN_LIBRARIES)
|
2018-10-19 15:41:56 -04:00
|
|
|
add_library(zxcvbn STATIC zxcvbn/zxcvbn.c)
|
2020-06-01 15:08:26 -04:00
|
|
|
# Disable error-level shadow issues
|
|
|
|
if(CC_HAS_Wshadow_compatible_local)
|
|
|
|
set_property(SOURCE zxcvbn/zxcvbn.c APPEND PROPERTY COMPILE_OPTIONS "-Wno-shadow-compatible-local")
|
|
|
|
endif()
|
|
|
|
if(CC_HAS_Wshadow_local)
|
|
|
|
set_property(SOURCE zxcvbn/zxcvbn.c APPEND PROPERTY COMPILE_OPTIONS "-Wno-shadow-local")
|
|
|
|
endif()
|
2018-10-19 15:41:56 -04:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/zxcvbn)
|
|
|
|
set(ZXCVBN_LIBRARIES zxcvbn)
|
2017-06-28 09:18:24 -04:00
|
|
|
endif(NOT ZXCVBN_LIBRARIES)
|
2017-06-28 08:58:29 -04:00
|
|
|
|
2010-08-07 09:10:44 -04:00
|
|
|
set(keepassx_SOURCES
|
2019-02-21 16:28:45 -05:00
|
|
|
core/Alloc.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
core/AutoTypeAssociations.cpp
|
2019-07-07 15:29:11 -04:00
|
|
|
core/Base32.cpp
|
|
|
|
core/Bootstrap.cpp
|
|
|
|
core/Clock.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
core/Config.cpp
|
|
|
|
core/CustomData.cpp
|
|
|
|
core/Database.cpp
|
2021-10-09 13:38:32 -04:00
|
|
|
core/DatabaseStats.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
core/Entry.cpp
|
|
|
|
core/EntryAttachments.cpp
|
|
|
|
core/EntryAttributes.cpp
|
|
|
|
core/EntrySearcher.cpp
|
2018-12-18 22:28:56 -05:00
|
|
|
core/FileWatcher.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
core/Group.cpp
|
2019-06-24 18:03:42 -04:00
|
|
|
core/HibpOffline.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
core/InactivityTimer.cpp
|
|
|
|
core/Merger.cpp
|
|
|
|
core/Metadata.cpp
|
2021-05-27 21:50:15 -04:00
|
|
|
core/ModifiableObject.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
core/PasswordGenerator.cpp
|
2020-02-01 08:42:34 -05:00
|
|
|
core/PasswordHealth.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
core/PassphraseGenerator.cpp
|
2020-03-08 20:27:16 -04:00
|
|
|
core/Resources.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
core/SignalMultiplexer.cpp
|
|
|
|
core/TimeDelta.cpp
|
|
|
|
core/TimeInfo.cpp
|
|
|
|
core/Tools.cpp
|
|
|
|
core/Translator.cpp
|
|
|
|
cli/Utils.cpp
|
2018-10-28 14:55:00 -04:00
|
|
|
cli/TextStream.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
crypto/Crypto.cpp
|
|
|
|
crypto/CryptoHash.cpp
|
|
|
|
crypto/Random.cpp
|
|
|
|
crypto/SymmetricCipher.cpp
|
|
|
|
crypto/kdf/Kdf.cpp
|
|
|
|
crypto/kdf/AesKdf.cpp
|
|
|
|
crypto/kdf/Argon2Kdf.cpp
|
|
|
|
format/CsvExporter.cpp
|
2020-10-08 19:09:42 -04:00
|
|
|
format/CsvParser.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
format/KeePass1Reader.cpp
|
|
|
|
format/KeePass2.cpp
|
|
|
|
format/KeePass2RandomStream.cpp
|
|
|
|
format/KdbxReader.cpp
|
|
|
|
format/KdbxWriter.cpp
|
|
|
|
format/KdbxXmlReader.cpp
|
|
|
|
format/KeePass2Reader.cpp
|
|
|
|
format/KeePass2Writer.cpp
|
|
|
|
format/Kdbx3Reader.cpp
|
|
|
|
format/Kdbx3Writer.cpp
|
|
|
|
format/Kdbx4Reader.cpp
|
|
|
|
format/Kdbx4Writer.cpp
|
|
|
|
format/KdbxXmlWriter.cpp
|
2019-05-19 17:49:48 -04:00
|
|
|
format/OpData01.cpp
|
|
|
|
format/OpVaultReader.cpp
|
|
|
|
format/OpVaultReaderAttachments.cpp
|
|
|
|
format/OpVaultReaderBandEntry.cpp
|
|
|
|
format/OpVaultReaderSections.cpp
|
2020-01-05 21:00:25 -05:00
|
|
|
gui/styles/styles.qrc
|
2020-04-11 11:01:50 -04:00
|
|
|
gui/styles/StateColorPalette.cpp
|
2020-01-05 21:00:25 -05:00
|
|
|
gui/styles/base/phantomcolor.cpp
|
|
|
|
gui/styles/base/BaseStyle.cpp
|
|
|
|
gui/styles/dark/DarkStyle.cpp
|
|
|
|
gui/styles/light/LightStyle.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
gui/AboutDialog.cpp
|
|
|
|
gui/Application.cpp
|
|
|
|
gui/CategoryListWidget.cpp
|
|
|
|
gui/Clipboard.cpp
|
|
|
|
gui/CloneDialog.cpp
|
2021-03-13 14:07:49 -05:00
|
|
|
gui/DatabaseIcons.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
gui/DatabaseOpenWidget.cpp
|
|
|
|
gui/DatabaseTabWidget.cpp
|
|
|
|
gui/DatabaseWidget.cpp
|
|
|
|
gui/DatabaseWidgetStateSync.cpp
|
|
|
|
gui/EntryPreviewWidget.cpp
|
|
|
|
gui/DialogyWidget.cpp
|
|
|
|
gui/EditWidget.cpp
|
|
|
|
gui/EditWidgetIcons.cpp
|
|
|
|
gui/EditWidgetProperties.cpp
|
|
|
|
gui/FileDialog.cpp
|
|
|
|
gui/Font.cpp
|
2021-05-31 10:40:20 -04:00
|
|
|
gui/GuiTools.cpp
|
2021-03-13 14:07:49 -05:00
|
|
|
gui/HtmlExporter.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
gui/IconModels.cpp
|
|
|
|
gui/KeePass1OpenWidget.cpp
|
|
|
|
gui/KMessageWidget.cpp
|
|
|
|
gui/MainWindow.cpp
|
|
|
|
gui/MessageBox.cpp
|
|
|
|
gui/MessageWidget.cpp
|
2019-05-19 17:49:48 -04:00
|
|
|
gui/OpVaultOpenWidget.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
gui/PasswordEdit.cpp
|
|
|
|
gui/PasswordGeneratorWidget.cpp
|
|
|
|
gui/ApplicationSettingsWidget.cpp
|
2020-10-05 20:41:00 -04:00
|
|
|
gui/Icons.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
gui/SearchWidget.cpp
|
|
|
|
gui/SortFilterHideProxyModel.cpp
|
|
|
|
gui/SquareSvgWidget.cpp
|
|
|
|
gui/TotpSetupDialog.cpp
|
|
|
|
gui/TotpDialog.cpp
|
|
|
|
gui/TotpExportSettingsDialog.cpp
|
2018-11-23 18:57:41 -05:00
|
|
|
gui/DatabaseOpenDialog.cpp
|
2019-11-22 06:54:28 -05:00
|
|
|
gui/URLEdit.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
gui/WelcomeWidget.cpp
|
|
|
|
gui/csvImport/CsvImportWidget.cpp
|
|
|
|
gui/csvImport/CsvImportWizard.cpp
|
|
|
|
gui/csvImport/CsvParserModel.cpp
|
|
|
|
gui/entry/AutoTypeAssociationsModel.cpp
|
|
|
|
gui/entry/EditEntryWidget.cpp
|
|
|
|
gui/entry/EntryAttachmentsModel.cpp
|
|
|
|
gui/entry/EntryAttachmentsWidget.cpp
|
|
|
|
gui/entry/EntryAttributesModel.cpp
|
|
|
|
gui/entry/EntryHistoryModel.cpp
|
|
|
|
gui/entry/EntryModel.cpp
|
|
|
|
gui/entry/EntryView.cpp
|
2021-10-10 10:36:19 -04:00
|
|
|
gui/export/ExportDialog.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
gui/group/EditGroupWidget.cpp
|
|
|
|
gui/group/GroupModel.cpp
|
|
|
|
gui/group/GroupView.cpp
|
2022-01-23 10:00:48 -05:00
|
|
|
gui/tag/TagModel.cpp
|
|
|
|
gui/tag/TagsEdit.cpp
|
2020-07-01 19:16:40 -04:00
|
|
|
gui/databasekey/KeyComponentWidget.cpp
|
|
|
|
gui/databasekey/PasswordEditWidget.cpp
|
|
|
|
gui/databasekey/YubiKeyEditWidget.cpp
|
|
|
|
gui/databasekey/KeyFileEditWidget.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
gui/dbsettings/DatabaseSettingsWidget.cpp
|
|
|
|
gui/dbsettings/DatabaseSettingsDialog.cpp
|
|
|
|
gui/dbsettings/DatabaseSettingsWidgetGeneral.cpp
|
2021-01-19 13:05:53 -05:00
|
|
|
gui/dbsettings/DatabaseSettingsWidgetMaintenance.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
gui/dbsettings/DatabaseSettingsWidgetMetaDataSimple.cpp
|
|
|
|
gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp
|
2020-07-01 19:16:40 -04:00
|
|
|
gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp
|
2020-02-01 08:42:34 -05:00
|
|
|
gui/reports/ReportsWidget.cpp
|
|
|
|
gui/reports/ReportsDialog.cpp
|
|
|
|
gui/reports/ReportsWidgetHealthcheck.cpp
|
|
|
|
gui/reports/ReportsPageHealthcheck.cpp
|
2020-03-29 09:39:06 -04:00
|
|
|
gui/reports/ReportsWidgetHibp.cpp
|
|
|
|
gui/reports/ReportsPageHibp.cpp
|
2020-02-01 08:42:34 -05:00
|
|
|
gui/reports/ReportsWidgetStatistics.cpp
|
|
|
|
gui/reports/ReportsPageStatistics.cpp
|
2020-01-28 15:42:57 -05:00
|
|
|
gui/osutils/OSUtilsBase.cpp
|
2020-10-03 12:16:35 -04:00
|
|
|
gui/osutils/ScreenLockListener.cpp
|
|
|
|
gui/osutils/ScreenLockListenerPrivate.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
gui/settings/SettingsWidget.cpp
|
2018-11-01 21:33:27 -04:00
|
|
|
gui/widgets/ElidedLabel.cpp
|
2021-02-21 08:28:10 -05:00
|
|
|
gui/widgets/KPToolBar.cpp
|
2018-11-01 21:33:27 -04:00
|
|
|
gui/widgets/PopupHelpWidget.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
gui/wizard/NewDatabaseWizard.cpp
|
|
|
|
gui/wizard/NewDatabaseWizardPage.cpp
|
|
|
|
gui/wizard/NewDatabaseWizardPageMetaData.cpp
|
|
|
|
gui/wizard/NewDatabaseWizardPageEncryption.cpp
|
2020-07-01 19:16:40 -04:00
|
|
|
gui/wizard/NewDatabaseWizardPageDatabaseKey.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
keys/CompositeKey.cpp
|
|
|
|
keys/FileKey.cpp
|
|
|
|
keys/PasswordKey.cpp
|
2021-04-22 23:07:49 -04:00
|
|
|
keys/ChallengeResponseKey.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
streams/HashedBlockStream.cpp
|
|
|
|
streams/HmacBlockStream.cpp
|
|
|
|
streams/LayeredStream.cpp
|
|
|
|
streams/qtiocompressor.cpp
|
|
|
|
streams/StoreDataStream.cpp
|
|
|
|
streams/SymmetricCipherStream.cpp
|
|
|
|
totp/totp.cpp)
|
2016-12-23 19:04:43 -05:00
|
|
|
if(APPLE)
|
2018-10-19 15:41:56 -04:00
|
|
|
set(keepassx_SOURCES
|
|
|
|
${keepassx_SOURCES}
|
2018-01-25 07:21:05 -05:00
|
|
|
core/MacPasteboard.cpp
|
2020-01-28 15:42:57 -05:00
|
|
|
gui/osutils/macutils/MacUtils.cpp
|
2020-10-03 12:16:35 -04:00
|
|
|
gui/osutils/macutils/ScreenLockListenerMac.cpp
|
2020-01-28 15:42:57 -05:00
|
|
|
gui/osutils/macutils/AppKitImpl.mm
|
|
|
|
gui/osutils/macutils/AppKit.h)
|
2016-12-23 19:04:43 -05:00
|
|
|
endif()
|
2018-02-28 10:31:21 -05:00
|
|
|
if(UNIX AND NOT APPLE)
|
2018-10-19 15:41:56 -04:00
|
|
|
set(keepassx_SOURCES
|
|
|
|
${keepassx_SOURCES}
|
2020-10-03 12:16:35 -04:00
|
|
|
gui/osutils/nixutils/ScreenLockListenerDBus.cpp
|
2020-12-13 23:23:25 -05:00
|
|
|
gui/osutils/nixutils/NixUtils.cpp
|
|
|
|
gui/osutils/nixutils/X11Funcs.cpp)
|
2021-01-09 11:26:06 -05:00
|
|
|
qt5_add_dbus_adaptor(keepassx_SOURCES
|
|
|
|
gui/org.keepassxc.KeePassXC.MainWindow.xml
|
|
|
|
gui/MainWindow.h
|
|
|
|
MainWindow)
|
2016-12-23 19:04:43 -05:00
|
|
|
endif()
|
2021-09-06 22:26:00 -04:00
|
|
|
if(WIN32)
|
2018-10-19 15:41:56 -04:00
|
|
|
set(keepassx_SOURCES
|
|
|
|
${keepassx_SOURCES}
|
2020-10-03 12:16:35 -04:00
|
|
|
gui/osutils/winutils/ScreenLockListenerWin.cpp
|
2020-01-28 15:42:57 -05:00
|
|
|
gui/osutils/winutils/WinUtils.cpp)
|
2022-02-21 20:40:01 -05:00
|
|
|
if (MSVC)
|
|
|
|
list(APPEND keepassx_SOURCES winhello/WindowsHello.cpp)
|
|
|
|
endif()
|
2016-12-23 19:04:43 -05:00
|
|
|
endif()
|
2010-08-07 09:10:44 -04:00
|
|
|
|
2020-03-08 20:27:16 -04:00
|
|
|
set(keepassx_SOURCES ${keepassx_SOURCES}
|
|
|
|
../share/icons/icons.qrc
|
|
|
|
../share/wizard/wizard.qrc)
|
|
|
|
|
2018-10-19 15:41:56 -04:00
|
|
|
set(keepassx_SOURCES_MAINEXE main.cpp)
|
2012-10-23 08:52:59 -04:00
|
|
|
|
2018-01-16 18:56:47 -05:00
|
|
|
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)")
|
2018-01-17 07:55:13 -05:00
|
|
|
add_feature_info(KeePassXC-Browser WITH_XC_BROWSER "Browser integration with KeePassXC-Browser")
|
2017-10-29 11:17:24 -04:00
|
|
|
add_feature_info(SSHAgent WITH_XC_SSHAGENT "SSH agent integration compatible with KeeAgent")
|
2021-05-16 20:16:01 -04:00
|
|
|
add_feature_info(KeeShare WITH_XC_KEESHARE "Sharing integration with KeeShare")
|
2018-01-16 18:56:47 -05:00
|
|
|
add_feature_info(YubiKey WITH_XC_YUBIKEY "YubiKey HMAC-SHA1 challenge-response")
|
2019-04-09 21:06:13 -04:00
|
|
|
add_feature_info(UpdateCheck WITH_XC_UPDATECHECK "Automatic update checking")
|
Add Freedesktop.org Secret Storage Spec Server Side API (Fix #1403)
This plugin implements the Secret Storage specification version 0.2.
While running KeePassXC, it acts as a Secret Service server, registered
on DBus, so clients like seahorse, python-secretstorage, or other
implementations can connect and access the exposed database in KeePassXC.
Squashed commits:
- Initial code
- Add SessionAdaptor and fix build
- The skeletons for all dbus objects are in place
- Implement collection creation and deletion
- Emit collectionChanged signal
- Implement app-wise settings page
- Implement error message on GUI
- Implement settings
- Fix uuid to dbus path
- Implement app level settings
- Add freedesktop logo
- Implement database settings page
- Change database settings to a treeview
- Move all settings read/write to one place
- Rename SecretServiceOptionsPage to SettingsWidgetFdoSecrets
- Fix selected group can not be saved if the user hasn't click on the item
- Show selected group per database in app settings
- Disable editing of various readonly widgets
- Remove unused warning about non exposed database
- Fix method signature on dbus adaptors
- Fix type derived from DBusObject not recognized as QDBusContext
- Resolve a few TODOs around error handling
- Remove const when passing DBus exposed objects
- Move dismiss to PromptBase
- Implement per collection locking/unlocking
- Fix const correctness on Item::setSecret
- Implement SecretService::getSecrets
- Rework the signal connections around collections.
- Remove generateId from DBusObject
- Per spec, use encoded label as DBus object path for collections
- Fix some corner cases around collection name changes
- Implement alias
- Fix wrong alias dbus path
- Implement encryption per spec
- Cleanup SessionCipher
- Implement searchItems for SecretService
- Use Tools::uuidToHex
- Implement Item attributes and delete
- Implement createItem
- Always check if the database is unlocked before perform any operation
- Add missing ReadAlias/SetAlias on service
- Reorganize and fix OpenSession always returning empty output
- Overhaul error handling
- Make sure default alias is always present
- Remove collection aliases early in doDelete
- Handles all content types, fix setProperties not working
- Fix sometimes there is an extraneous leading zero when converting from MPI
- Fix session encryption negotiation
- Do not expose recycle bin
- Protect against the methods not called from DBus
- Also emit collectionChanged signal when lock state changes
- Show notification when entry secret is requested
- Add a README file
- Actually close session when client disconnects
- Gracefully return alternative label when collection is locked
- Reorganize, rename secretservice to fdosecrets
- Fix issues reported by clazy
- Unify UI strings and fix icon
- Implement a setting to skip confirmation when deleting entries from DBus
- Remove some unused debugging log
- Simply ignore errors when DBus context is not available. QtDBus won't set QDBusContext when deliver property get/set, and there is no way to get a QDBusMessage in property getter/setter.
- Simplify GcryptMPI using std::unique_ptr and add unit test
- Format code in fdosecrets
- Move DBusReturnImpl to details namespace
- Fix crash when locking a database: don't modify exposedGroup setting in customData when database is deleted
- Make sure Collection::searchItems works, whether it's locked or not
- Fix FdoSecrets::Collection becomes empty after a database reload
- Fix crash when looping while modifying the list
2019-03-25 23:07:18 -04:00
|
|
|
if(UNIX AND NOT APPLE)
|
|
|
|
add_feature_info(FdoSecrets WITH_XC_FDOSECRETS "Implement freedesktop.org Secret Storage Spec server side API.")
|
|
|
|
endif()
|
2016-12-04 13:57:24 -05:00
|
|
|
|
2017-12-12 03:15:23 -05:00
|
|
|
add_subdirectory(browser)
|
|
|
|
add_subdirectory(proxy)
|
|
|
|
if(WITH_XC_BROWSER)
|
|
|
|
set(keepassxcbrowser_LIB keepassxcbrowser)
|
2018-10-24 10:49:53 -04:00
|
|
|
set(keepassx_SOURCES ${keepassx_SOURCES} gui/dbsettings/DatabaseSettingsWidgetBrowser.cpp)
|
2019-08-15 05:35:11 -04:00
|
|
|
set(keepassx_SOURCES ${keepassx_SOURCES} gui/entry/EntryURLModel.cpp)
|
2021-12-30 07:31:06 -05:00
|
|
|
set(keepassx_SOURCES ${keepassx_SOURCES} gui/reports/ReportsWidgetBrowserStatistics.cpp)
|
|
|
|
set(keepassx_SOURCES ${keepassx_SOURCES} gui/reports/ReportsPageBrowserStatistics.cpp)
|
2017-12-12 03:15:23 -05:00
|
|
|
endif()
|
|
|
|
|
2016-12-27 22:24:22 -05:00
|
|
|
add_subdirectory(autotype)
|
2017-01-30 19:18:35 -05:00
|
|
|
add_subdirectory(cli)
|
2018-10-19 14:42:49 -04:00
|
|
|
add_subdirectory(qrcode)
|
|
|
|
set(qrcode_LIB qrcode)
|
2016-12-27 22:24:22 -05:00
|
|
|
|
2018-10-01 10:26:24 -04:00
|
|
|
add_subdirectory(keeshare)
|
|
|
|
if(WITH_XC_KEESHARE)
|
|
|
|
set(keeshare_LIB keeshare)
|
|
|
|
endif()
|
|
|
|
|
2017-10-29 11:17:24 -04:00
|
|
|
add_subdirectory(sshagent)
|
|
|
|
if(WITH_XC_SSHAGENT)
|
|
|
|
set(sshagent_LIB sshagent)
|
|
|
|
endif()
|
|
|
|
|
Add Freedesktop.org Secret Storage Spec Server Side API (Fix #1403)
This plugin implements the Secret Storage specification version 0.2.
While running KeePassXC, it acts as a Secret Service server, registered
on DBus, so clients like seahorse, python-secretstorage, or other
implementations can connect and access the exposed database in KeePassXC.
Squashed commits:
- Initial code
- Add SessionAdaptor and fix build
- The skeletons for all dbus objects are in place
- Implement collection creation and deletion
- Emit collectionChanged signal
- Implement app-wise settings page
- Implement error message on GUI
- Implement settings
- Fix uuid to dbus path
- Implement app level settings
- Add freedesktop logo
- Implement database settings page
- Change database settings to a treeview
- Move all settings read/write to one place
- Rename SecretServiceOptionsPage to SettingsWidgetFdoSecrets
- Fix selected group can not be saved if the user hasn't click on the item
- Show selected group per database in app settings
- Disable editing of various readonly widgets
- Remove unused warning about non exposed database
- Fix method signature on dbus adaptors
- Fix type derived from DBusObject not recognized as QDBusContext
- Resolve a few TODOs around error handling
- Remove const when passing DBus exposed objects
- Move dismiss to PromptBase
- Implement per collection locking/unlocking
- Fix const correctness on Item::setSecret
- Implement SecretService::getSecrets
- Rework the signal connections around collections.
- Remove generateId from DBusObject
- Per spec, use encoded label as DBus object path for collections
- Fix some corner cases around collection name changes
- Implement alias
- Fix wrong alias dbus path
- Implement encryption per spec
- Cleanup SessionCipher
- Implement searchItems for SecretService
- Use Tools::uuidToHex
- Implement Item attributes and delete
- Implement createItem
- Always check if the database is unlocked before perform any operation
- Add missing ReadAlias/SetAlias on service
- Reorganize and fix OpenSession always returning empty output
- Overhaul error handling
- Make sure default alias is always present
- Remove collection aliases early in doDelete
- Handles all content types, fix setProperties not working
- Fix sometimes there is an extraneous leading zero when converting from MPI
- Fix session encryption negotiation
- Do not expose recycle bin
- Protect against the methods not called from DBus
- Also emit collectionChanged signal when lock state changes
- Show notification when entry secret is requested
- Add a README file
- Actually close session when client disconnects
- Gracefully return alternative label when collection is locked
- Reorganize, rename secretservice to fdosecrets
- Fix issues reported by clazy
- Unify UI strings and fix icon
- Implement a setting to skip confirmation when deleting entries from DBus
- Remove some unused debugging log
- Simply ignore errors when DBus context is not available. QtDBus won't set QDBusContext when deliver property get/set, and there is no way to get a QDBusMessage in property getter/setter.
- Simplify GcryptMPI using std::unique_ptr and add unit test
- Format code in fdosecrets
- Move DBusReturnImpl to details namespace
- Fix crash when locking a database: don't modify exposedGroup setting in customData when database is deleted
- Make sure Collection::searchItems works, whether it's locked or not
- Fix FdoSecrets::Collection becomes empty after a database reload
- Fix crash when looping while modifying the list
2019-03-25 23:07:18 -04:00
|
|
|
add_subdirectory(fdosecrets)
|
|
|
|
if(WITH_XC_FDOSECRETS)
|
|
|
|
set(fdosecrets_LIB fdosecrets)
|
|
|
|
endif()
|
|
|
|
|
2021-09-05 08:51:25 -04:00
|
|
|
add_subdirectory(thirdparty)
|
|
|
|
|
2016-12-13 15:14:39 -05:00
|
|
|
set(autotype_SOURCES
|
2018-10-19 15:41:56 -04:00
|
|
|
core/Tools.cpp
|
|
|
|
autotype/AutoType.cpp
|
|
|
|
autotype/AutoTypeAction.cpp
|
2021-02-15 17:28:16 -05:00
|
|
|
autotype/AutoTypeMatchModel.cpp
|
|
|
|
autotype/AutoTypeMatchView.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
autotype/AutoTypeSelectDialog.cpp
|
2021-02-13 22:08:29 -05:00
|
|
|
autotype/PickcharsDialog.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
autotype/ShortcutWidget.cpp
|
2018-10-27 15:39:50 -04:00
|
|
|
autotype/WindowSelectComboBox.cpp)
|
2016-12-13 15:14:39 -05:00
|
|
|
|
2021-09-06 22:26:00 -04:00
|
|
|
if(WIN32)
|
2018-10-19 15:41:56 -04:00
|
|
|
set(keepassx_SOURCES_MAINEXE ${keepassx_SOURCES_MAINEXE} ${CMAKE_SOURCE_DIR}/share/windows/icon.rc)
|
2012-10-23 08:52:59 -04:00
|
|
|
endif()
|
|
|
|
|
2017-02-20 19:06:32 -05:00
|
|
|
if(WITH_XC_YUBIKEY)
|
Implement support for Yubikeys and potential other tokens via wireless NFC using smartcard readers (Rebase) (#6895)
* Support NFC readers for hardware tokens using PC/SC
This requires a new library dependency: PCSC.
The PCSC library provides methods to access smartcards. On Linux, the third-party pcsc-lite package is used. On Windows, the native Windows API (Winscard.dll) is used. On Mac OSX, the native OSX API (framework-PCSC) is used.
* Split hardware key access into multiple classes to handle different methods of communicating with the keys.
* Since the Yubikey can now be a wireless token as well, the verb "plug in" was replaced with a more
generic "interface with". This shall indicate that the user has to present their token to the reader, or plug it in via USB.
* Add PC/SC interface for YubiKey challenge-response
This new interface uses the PC/SC protocol and API
instead of the USB protocol via ykpers. Many YubiKeys expose their functionality as a CCID device, which can be interfaced with using PC/SC. This is especially useful for NFC-only or NFC-capable Yubikeys, when they are used together with a PC/SC compliant NFC reader device.
Although many (not all) Yubikeys expose their CCID functionality over their own USB connection as well, the HMAC-SHA1 functionality is often locked in this mode, as it requires eg. a touch on the gold button. When accessing the CCID functionality wirelessly via NFC (like this code can do using a reader), then the user interaction is to present the key to the reader.
This implementation has been tested on Linux using pcsc-lite, Windows using the native Winscard.dll library, and Mac OSX using the native PCSC-framework library.
* Remove PC/SC ATR whitelist, instead scan for AIDs
Before, a whitelist of ATR codes (answer to reset, hardware-specific)
was used to scan for compatible (Yubi)Keys.
Now, every connected smartcard is scanned for AIDs (applet identifier),
which are known to implement the HMAC-SHA1 protocol.
This enables the support of currently unknown or unreleased hardware.
Co-authored-by: Jonathan White <support@dmapps.us>
2021-10-01 10:39:07 -04:00
|
|
|
list(APPEND keepassx_SOURCES
|
|
|
|
keys/drivers/YubiKey.h
|
|
|
|
keys/drivers/YubiKey.cpp
|
|
|
|
keys/drivers/YubiKeyInterface.cpp
|
|
|
|
keys/drivers/YubiKeyInterfaceUSB.cpp
|
|
|
|
keys/drivers/YubiKeyInterfacePCSC.cpp)
|
2014-05-26 03:41:54 -04:00
|
|
|
else()
|
Implement support for Yubikeys and potential other tokens via wireless NFC using smartcard readers (Rebase) (#6895)
* Support NFC readers for hardware tokens using PC/SC
This requires a new library dependency: PCSC.
The PCSC library provides methods to access smartcards. On Linux, the third-party pcsc-lite package is used. On Windows, the native Windows API (Winscard.dll) is used. On Mac OSX, the native OSX API (framework-PCSC) is used.
* Split hardware key access into multiple classes to handle different methods of communicating with the keys.
* Since the Yubikey can now be a wireless token as well, the verb "plug in" was replaced with a more
generic "interface with". This shall indicate that the user has to present their token to the reader, or plug it in via USB.
* Add PC/SC interface for YubiKey challenge-response
This new interface uses the PC/SC protocol and API
instead of the USB protocol via ykpers. Many YubiKeys expose their functionality as a CCID device, which can be interfaced with using PC/SC. This is especially useful for NFC-only or NFC-capable Yubikeys, when they are used together with a PC/SC compliant NFC reader device.
Although many (not all) Yubikeys expose their CCID functionality over their own USB connection as well, the HMAC-SHA1 functionality is often locked in this mode, as it requires eg. a touch on the gold button. When accessing the CCID functionality wirelessly via NFC (like this code can do using a reader), then the user interaction is to present the key to the reader.
This implementation has been tested on Linux using pcsc-lite, Windows using the native Winscard.dll library, and Mac OSX using the native PCSC-framework library.
* Remove PC/SC ATR whitelist, instead scan for AIDs
Before, a whitelist of ATR codes (answer to reset, hardware-specific)
was used to scan for compatible (Yubi)Keys.
Now, every connected smartcard is scanned for AIDs (applet identifier),
which are known to implement the HMAC-SHA1 protocol.
This enables the support of currently unknown or unreleased hardware.
Co-authored-by: Jonathan White <support@dmapps.us>
2021-10-01 10:39:07 -04:00
|
|
|
list(APPEND keepassx_SOURCES
|
|
|
|
keys/drivers/YubiKey.h
|
|
|
|
keys/drivers/YubiKeyStub.cpp)
|
2014-05-26 03:41:54 -04:00
|
|
|
endif()
|
|
|
|
|
2019-01-30 09:11:50 -05:00
|
|
|
if(WITH_XC_NETWORKING)
|
2019-07-07 15:29:11 -04:00
|
|
|
list(APPEND keepassx_SOURCES
|
2020-03-29 09:39:06 -04:00
|
|
|
core/HibpDownloader.cpp
|
2019-07-07 15:29:11 -04:00
|
|
|
core/NetworkManager.cpp
|
|
|
|
gui/UpdateCheckDialog.cpp
|
2020-10-03 13:51:13 -04:00
|
|
|
gui/IconDownloader.cpp
|
2019-07-07 15:29:11 -04:00
|
|
|
gui/IconDownloaderDialog.cpp
|
|
|
|
updatecheck/UpdateChecker.cpp)
|
2019-01-30 09:11:50 -05:00
|
|
|
endif()
|
|
|
|
|
2022-02-21 20:40:01 -05:00
|
|
|
if(APPLE)
|
2018-10-19 15:41:56 -04:00
|
|
|
list(APPEND keepassx_SOURCES touchid/TouchID.mm)
|
2019-02-21 16:28:45 -05:00
|
|
|
# TODO: Remove -Wno-error once deprecation warnings have been resolved.
|
|
|
|
set_source_files_properties(touchid/TouchID.mm PROPERTY COMPILE_FLAGS "-Wno-old-style-cast -Wno-error")
|
2018-04-04 11:39:26 -04:00
|
|
|
endif()
|
|
|
|
|
2019-05-07 12:56:55 -04:00
|
|
|
configure_file(config-keepassx.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-keepassx.h)
|
|
|
|
configure_file(git-info.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/git-info.h)
|
|
|
|
|
2016-12-13 15:14:39 -05:00
|
|
|
add_library(autotype STATIC ${autotype_SOURCES})
|
|
|
|
target_link_libraries(autotype Qt5::Core Qt5::Widgets)
|
|
|
|
|
2012-05-21 17:37:29 -04:00
|
|
|
add_library(keepassx_core STATIC ${keepassx_SOURCES})
|
2010-08-07 09:10:44 -04:00
|
|
|
|
2017-02-15 18:44:20 -05:00
|
|
|
set_target_properties(keepassx_core PROPERTIES COMPILE_DEFINITIONS KEEPASSX_BUILDING_CORE)
|
|
|
|
target_link_libraries(keepassx_core
|
2018-10-19 15:41:56 -04:00
|
|
|
autotype
|
|
|
|
${keepassxcbrowser_LIB}
|
|
|
|
${qrcode_LIB}
|
Add Freedesktop.org Secret Storage Spec Server Side API (Fix #1403)
This plugin implements the Secret Storage specification version 0.2.
While running KeePassXC, it acts as a Secret Service server, registered
on DBus, so clients like seahorse, python-secretstorage, or other
implementations can connect and access the exposed database in KeePassXC.
Squashed commits:
- Initial code
- Add SessionAdaptor and fix build
- The skeletons for all dbus objects are in place
- Implement collection creation and deletion
- Emit collectionChanged signal
- Implement app-wise settings page
- Implement error message on GUI
- Implement settings
- Fix uuid to dbus path
- Implement app level settings
- Add freedesktop logo
- Implement database settings page
- Change database settings to a treeview
- Move all settings read/write to one place
- Rename SecretServiceOptionsPage to SettingsWidgetFdoSecrets
- Fix selected group can not be saved if the user hasn't click on the item
- Show selected group per database in app settings
- Disable editing of various readonly widgets
- Remove unused warning about non exposed database
- Fix method signature on dbus adaptors
- Fix type derived from DBusObject not recognized as QDBusContext
- Resolve a few TODOs around error handling
- Remove const when passing DBus exposed objects
- Move dismiss to PromptBase
- Implement per collection locking/unlocking
- Fix const correctness on Item::setSecret
- Implement SecretService::getSecrets
- Rework the signal connections around collections.
- Remove generateId from DBusObject
- Per spec, use encoded label as DBus object path for collections
- Fix some corner cases around collection name changes
- Implement alias
- Fix wrong alias dbus path
- Implement encryption per spec
- Cleanup SessionCipher
- Implement searchItems for SecretService
- Use Tools::uuidToHex
- Implement Item attributes and delete
- Implement createItem
- Always check if the database is unlocked before perform any operation
- Add missing ReadAlias/SetAlias on service
- Reorganize and fix OpenSession always returning empty output
- Overhaul error handling
- Make sure default alias is always present
- Remove collection aliases early in doDelete
- Handles all content types, fix setProperties not working
- Fix sometimes there is an extraneous leading zero when converting from MPI
- Fix session encryption negotiation
- Do not expose recycle bin
- Protect against the methods not called from DBus
- Also emit collectionChanged signal when lock state changes
- Show notification when entry secret is requested
- Add a README file
- Actually close session when client disconnects
- Gracefully return alternative label when collection is locked
- Reorganize, rename secretservice to fdosecrets
- Fix issues reported by clazy
- Unify UI strings and fix icon
- Implement a setting to skip confirmation when deleting entries from DBus
- Remove some unused debugging log
- Simply ignore errors when DBus context is not available. QtDBus won't set QDBusContext when deliver property get/set, and there is no way to get a QDBusMessage in property getter/setter.
- Simplify GcryptMPI using std::unique_ptr and add unit test
- Format code in fdosecrets
- Move DBusReturnImpl to details namespace
- Fix crash when locking a database: don't modify exposedGroup setting in customData when database is deleted
- Make sure Collection::searchItems works, whether it's locked or not
- Fix FdoSecrets::Collection becomes empty after a database reload
- Fix crash when looping while modifying the list
2019-03-25 23:07:18 -04:00
|
|
|
${fdosecrets_LIB}
|
2018-10-19 15:41:56 -04:00
|
|
|
Qt5::Core
|
|
|
|
Qt5::Concurrent
|
|
|
|
Qt5::Network
|
|
|
|
Qt5::Widgets
|
2021-04-04 08:56:00 -04:00
|
|
|
${BOTAN2_LIBRARIES}
|
Implement support for Yubikeys and potential other tokens via wireless NFC using smartcard readers (Rebase) (#6895)
* Support NFC readers for hardware tokens using PC/SC
This requires a new library dependency: PCSC.
The PCSC library provides methods to access smartcards. On Linux, the third-party pcsc-lite package is used. On Windows, the native Windows API (Winscard.dll) is used. On Mac OSX, the native OSX API (framework-PCSC) is used.
* Split hardware key access into multiple classes to handle different methods of communicating with the keys.
* Since the Yubikey can now be a wireless token as well, the verb "plug in" was replaced with a more
generic "interface with". This shall indicate that the user has to present their token to the reader, or plug it in via USB.
* Add PC/SC interface for YubiKey challenge-response
This new interface uses the PC/SC protocol and API
instead of the USB protocol via ykpers. Many YubiKeys expose their functionality as a CCID device, which can be interfaced with using PC/SC. This is especially useful for NFC-only or NFC-capable Yubikeys, when they are used together with a PC/SC compliant NFC reader device.
Although many (not all) Yubikeys expose their CCID functionality over their own USB connection as well, the HMAC-SHA1 functionality is often locked in this mode, as it requires eg. a touch on the gold button. When accessing the CCID functionality wirelessly via NFC (like this code can do using a reader), then the user interaction is to present the key to the reader.
This implementation has been tested on Linux using pcsc-lite, Windows using the native Winscard.dll library, and Mac OSX using the native PCSC-framework library.
* Remove PC/SC ATR whitelist, instead scan for AIDs
Before, a whitelist of ATR codes (answer to reset, hardware-specific)
was used to scan for compatible (Yubi)Keys.
Now, every connected smartcard is scanned for AIDs (applet identifier),
which are known to implement the HMAC-SHA1 protocol.
This enables the support of currently unknown or unreleased hardware.
Co-authored-by: Jonathan White <support@dmapps.us>
2021-10-01 10:39:07 -04:00
|
|
|
${PCSC_LIBRARIES}
|
2018-10-19 15:41:56 -04:00
|
|
|
${ZXCVBN_LIBRARIES}
|
2020-04-02 01:59:34 -04:00
|
|
|
${ZLIB_LIBRARIES}
|
2022-03-05 10:45:57 -05:00
|
|
|
${ARGON2_LIBRARIES}
|
2021-09-05 08:51:25 -04:00
|
|
|
${thirdparty_LIBRARIES}
|
2020-04-02 01:59:34 -04:00
|
|
|
)
|
2018-10-01 10:26:24 -04:00
|
|
|
|
|
|
|
if(WITH_XC_SSHAGENT)
|
|
|
|
target_link_libraries(keepassx_core sshagent)
|
|
|
|
endif()
|
|
|
|
if(WITH_XC_KEESHARE)
|
|
|
|
target_link_libraries(keepassx_core keeshare)
|
|
|
|
endif()
|
2017-05-04 16:52:10 -04:00
|
|
|
|
|
|
|
if(APPLE)
|
2022-02-21 20:40:01 -05:00
|
|
|
target_link_libraries(keepassx_core "-framework Foundation -framework AppKit -framework Carbon -framework Security -framework LocalAuthentication")
|
2017-10-15 18:27:07 -04:00
|
|
|
if(Qt5MacExtras_FOUND)
|
2018-10-19 15:41:56 -04:00
|
|
|
target_link_libraries(keepassx_core Qt5::MacExtras)
|
2017-10-15 18:27:07 -04:00
|
|
|
endif()
|
2017-05-04 16:52:10 -04:00
|
|
|
endif()
|
2019-03-24 09:26:34 -04:00
|
|
|
if(HAIKU)
|
|
|
|
target_link_libraries(keepassx_core network)
|
|
|
|
endif()
|
2018-10-19 15:41:56 -04:00
|
|
|
if(UNIX AND NOT APPLE)
|
2020-12-13 23:23:25 -05:00
|
|
|
target_link_libraries(keepassx_core Qt5::DBus Qt5::X11Extras X11)
|
2019-10-21 04:49:09 -04:00
|
|
|
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
|
2017-02-15 18:44:20 -05:00
|
|
|
endif()
|
2021-09-06 22:26:00 -04:00
|
|
|
if(WIN32)
|
2018-04-26 23:04:36 -04:00
|
|
|
target_link_libraries(keepassx_core Wtsapi32.lib Ws2_32.lib)
|
2022-02-21 20:40:01 -05:00
|
|
|
if (MSVC)
|
|
|
|
target_link_libraries(keepassx_core WindowsApp.lib)
|
|
|
|
endif()
|
2017-05-04 16:52:10 -04:00
|
|
|
endif()
|
2012-05-21 14:24:06 -04:00
|
|
|
|
2021-09-06 22:26:00 -04:00
|
|
|
if(WIN32)
|
2018-10-19 15:41:56 -04:00
|
|
|
include(GenerateProductVersion)
|
|
|
|
generate_product_version(
|
|
|
|
WIN32_ProductVersionFiles
|
|
|
|
NAME "KeePassXC"
|
|
|
|
COMPANY_NAME "KeePassXC Team"
|
|
|
|
VERSION_MAJOR ${KEEPASSXC_VERSION_MAJOR}
|
|
|
|
VERSION_MINOR ${KEEPASSXC_VERSION_MINOR}
|
|
|
|
VERSION_PATCH ${KEEPASSXC_VERSION_PATCH}
|
|
|
|
)
|
2017-02-19 16:23:04 -05:00
|
|
|
endif()
|
|
|
|
|
2017-05-05 13:49:52 -04:00
|
|
|
add_executable(${PROGNAME} WIN32 ${keepassx_SOURCES_MAINEXE} ${WIN32_ProductVersionFiles})
|
2017-02-15 18:44:20 -05:00
|
|
|
target_link_libraries(${PROGNAME} keepassx_core)
|
2012-05-21 14:24:06 -04:00
|
|
|
|
2013-03-29 11:27:02 -04:00
|
|
|
set_target_properties(${PROGNAME} PROPERTIES ENABLE_EXPORTS ON)
|
|
|
|
|
2017-05-05 13:49:52 -04:00
|
|
|
if(APPLE AND WITH_APP_BUNDLE)
|
2020-03-24 19:24:27 -04:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/share/macosx/embedded.provisionprofile DESTINATION ${BUNDLE_INSTALL_DIR})
|
2018-10-19 15:41:56 -04:00
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/share/macosx/Info.plist.cmake ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
|
|
|
|
set_target_properties(${PROGNAME} PROPERTIES
|
|
|
|
MACOSX_BUNDLE ON
|
2022-02-21 20:40:01 -05:00
|
|
|
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist
|
|
|
|
CPACK_BUNDLE_APPLE_ENTITLEMENTS "${CMAKE_SOURCE_DIR}/share/macosx/keepassxc.entitlements")
|
2018-10-19 15:41:56 -04:00
|
|
|
|
|
|
|
if(QT_MAC_USE_COCOA AND EXISTS "${QT_LIBRARY_DIR}/Resources/qt_menu.nib")
|
|
|
|
install(DIRECTORY "${QT_LIBRARY_DIR}/Resources/qt_menu.nib"
|
|
|
|
DESTINATION "${DATA_INSTALL_DIR}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CPACK_GENERATOR "DragNDrop")
|
|
|
|
set(CPACK_DMG_FORMAT "UDBZ")
|
|
|
|
set(CPACK_DMG_DS_STORE "${CMAKE_SOURCE_DIR}/share/macosx/DS_Store.in")
|
|
|
|
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/share/macosx/background.tiff")
|
|
|
|
set(CPACK_DMG_VOLUME_NAME "${PROGNAME}")
|
|
|
|
set(CPACK_SYSTEM_NAME "OSX")
|
|
|
|
set(CPACK_STRIP_FILES ON)
|
|
|
|
set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION}")
|
|
|
|
include(CPack)
|
2012-05-21 14:24:06 -04:00
|
|
|
endif()
|
2012-10-22 14:40:03 -04:00
|
|
|
|
2017-10-15 18:27:07 -04:00
|
|
|
install(TARGETS ${PROGNAME}
|
2018-10-19 15:41:56 -04:00
|
|
|
BUNDLE DESTINATION . COMPONENT Runtime
|
|
|
|
RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT Runtime)
|
2017-10-15 18:27:07 -04:00
|
|
|
|
2021-09-06 22:26:00 -04:00
|
|
|
if(WIN32)
|
2018-10-19 15:41:56 -04:00
|
|
|
if(${CMAKE_SIZEOF_VOID_P} EQUAL "8")
|
|
|
|
set(OUTPUT_FILE_POSTFIX "Win64")
|
|
|
|
else()
|
|
|
|
set(OUTPUT_FILE_POSTFIX "Win32")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# We have to copy the license file in the configuration phase.
|
|
|
|
# CMake checks that CPACK_RESOURCE_FILE_LICENSE actually exists and
|
|
|
|
# we have to copy it because WiX needs it to have a .txt extension.
|
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy
|
|
|
|
"${CMAKE_SOURCE_DIR}/LICENSE.GPL-2"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/INSTALLER_LICENSE.txt")
|
|
|
|
|
2021-11-23 09:22:36 -05:00
|
|
|
# Prepare portal zip file
|
|
|
|
set(CPACK_INSTALL_SCRIPTS "${CMAKE_SOURCE_DIR}/cmake/MakePortableZip.cmake")
|
|
|
|
|
2019-01-30 22:26:33 -05:00
|
|
|
string(REGEX REPLACE "-.*$" "" KEEPASSXC_VERSION_CLEAN ${KEEPASSXC_VERSION})
|
2018-10-19 15:41:56 -04:00
|
|
|
|
2019-01-30 15:00:47 -05:00
|
|
|
set(CPACK_GENERATOR "ZIP;WIX")
|
2018-10-19 15:41:56 -04:00
|
|
|
set(CPACK_STRIP_FILES OFF)
|
|
|
|
set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION}-${OUTPUT_FILE_POSTFIX}")
|
|
|
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROGNAME})
|
|
|
|
set(CPACK_PACKAGE_VERSION ${KEEPASSXC_VERSION_CLEAN})
|
|
|
|
set(CPACK_PACKAGE_VENDOR "${PROGNAME} Team")
|
|
|
|
string(REGEX REPLACE "/" "\\\\\\\\" CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/share/windows/installer-header.bmp")
|
|
|
|
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/INSTALLER_LICENSE.txt")
|
|
|
|
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
|
|
|
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/share/windows/keepassxc.ico")
|
|
|
|
set(CPACK_NSIS_MUI_UNIICON "${CPACK_NSIS_MUI_ICON}")
|
|
|
|
set(CPACK_NSIS_INSTALLED_ICON_NAME "\\\\${PROGNAME}.exe")
|
|
|
|
string(REGEX REPLACE "/" "\\\\\\\\" CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP "${CMAKE_SOURCE_DIR}/share/windows/installer-wizard.bmp")
|
|
|
|
set(CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP "${CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP}")
|
|
|
|
set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROGNAME}.lnk' '$INSTDIR\\\\${PROGNAME}.exe'")
|
|
|
|
set(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete '$SMPROGRAMS\\\\$START_MENU\\\\${PROGNAME}.lnk'")
|
|
|
|
set(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS "ExecWait 'Taskkill /IM KeePassXC.exe'")
|
|
|
|
set(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS}\nExecWait 'Taskkill /IM keepassxc-proxy.exe /F'")
|
|
|
|
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait 'Taskkill /IM KeePassXC.exe'")
|
|
|
|
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\nExecWait 'Taskkill /IM keepassxc-proxy.exe /F'")
|
|
|
|
set(CPACK_NSIS_URL_INFO_ABOUT "https://keepassxc.org")
|
|
|
|
set(CPACK_NSIS_DISPLAY_NAME ${PROGNAME})
|
|
|
|
set(CPACK_NSIS_PACKAGE_NAME "${PROGNAME} v${KEEPASSXC_VERSION}")
|
|
|
|
set(CPACK_NSIS_MUI_FINISHPAGE_RUN "../${PROGNAME}.exe")
|
|
|
|
set(CPACK_WIX_UPGRADE_GUID 88785A72-3EAE-4F29-89E3-BC6B19BA9A5B)
|
|
|
|
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/share/windows/keepassxc.ico")
|
|
|
|
set(CPACK_WIX_UI_BANNER "${CMAKE_SOURCE_DIR}/share/windows/wix-banner.bmp")
|
|
|
|
set(CPACK_WIX_UI_DIALOG "${CMAKE_SOURCE_DIR}/share/windows/wix-dialog.bmp")
|
2020-05-05 21:47:26 -04:00
|
|
|
set(CPACK_WIX_UI_REF "KPXC_InstallDir")
|
2018-10-19 15:41:56 -04:00
|
|
|
set(CPACK_WIX_TEMPLATE "${CMAKE_SOURCE_DIR}/share/windows/wix-template.xml")
|
|
|
|
set(CPACK_WIX_PATCH_FILE "${CMAKE_SOURCE_DIR}/share/windows/wix-patch.xml")
|
2020-05-05 21:47:26 -04:00
|
|
|
set(CPACK_WIX_EXTRA_SOURCES
|
|
|
|
"${CMAKE_SOURCE_DIR}/share/windows/KPXC_InstallDir.wxs"
|
|
|
|
"${CMAKE_SOURCE_DIR}/share/windows/KPXC_InstallDirDlg.wxs"
|
|
|
|
"${CMAKE_SOURCE_DIR}/share/windows/KPXC_ExitDlg.wxs")
|
|
|
|
set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "https://keepassxc.org")
|
2018-10-19 15:41:56 -04:00
|
|
|
set(CPACK_WIX_EXTENSIONS "WixUtilExtension.dll")
|
|
|
|
include(CPack)
|
|
|
|
|
2021-09-06 22:26:00 -04:00
|
|
|
if(NOT VCPKG_INSTALLED_DIR)
|
|
|
|
install(CODE "set(gp_tool \"objdump\")" COMPONENT Runtime)
|
2018-10-19 15:41:56 -04:00
|
|
|
|
2021-09-06 22:26:00 -04:00
|
|
|
# Deploy all 3rd party library dependencies first
|
|
|
|
install(CODE "include(BundleUtilities)
|
|
|
|
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${PROGNAME}.exe\" \"\" \"\")"
|
|
|
|
COMPONENT Runtime)
|
2019-04-20 12:12:00 -04:00
|
|
|
|
2021-09-06 22:26:00 -04:00
|
|
|
# Use windeployqt.exe to setup Qt dependencies
|
|
|
|
if(Qt5Core_VERSION VERSION_LESS "5.14.1")
|
|
|
|
set(WINDEPLOYQT_MODE "--release")
|
|
|
|
if(CMAKE_BUILD_TYPE_LOWER STREQUAL "debug")
|
|
|
|
set(WINDEPLOYQT_MODE "--debug")
|
|
|
|
endif()
|
2020-04-09 14:18:04 -04:00
|
|
|
endif()
|
|
|
|
|
2021-09-06 22:26:00 -04:00
|
|
|
install(CODE "execute_process(COMMAND ${WINDEPLOYQT_EXE} ${PROGNAME}.exe ${WINDEPLOYQT_MODE} WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX} OUTPUT_QUIET)"
|
|
|
|
COMPONENT Runtime)
|
|
|
|
|
|
|
|
# install OpenSSL library
|
|
|
|
if(WITH_XC_NETWORKING)
|
|
|
|
find_file(OPENSSL_DLL
|
|
|
|
NAMES libssl-1_1.dll libssl-1_1-x64.dll
|
|
|
|
HINTS "${OPENSSL_ROOT_DIR}/bin"
|
|
|
|
)
|
|
|
|
if (NOT OPENSSL_DLL)
|
|
|
|
message(FATAL_ERROR "Cannot find libssl dll, ensure openssl is properly installed.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_file(CRYPTO_DLL
|
|
|
|
NAMES libcrypto-1_1.dll libcrypto-1_1-x64.dll
|
|
|
|
HINTS "${OPENSSL_ROOT_DIR}/bin"
|
|
|
|
)
|
|
|
|
if (NOT CRYPTO_DLL)
|
|
|
|
message(FATAL_ERROR "Cannot find libcrypto dll, ensure openssl is properly installed.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
install(FILES ${OPENSSL_DLL} ${CRYPTO_DLL} DESTINATION ".")
|
2020-04-09 14:18:04 -04:00
|
|
|
endif()
|
2021-09-06 22:26:00 -04:00
|
|
|
endif()
|
2020-04-09 14:18:04 -04:00
|
|
|
|
2021-09-06 22:26:00 -04:00
|
|
|
# install CA cert chains
|
|
|
|
find_file(SSL_CA_BUNDLE ca-bundle.crt PATHS "${Qt5_PREFIX}/ssl/certs")
|
|
|
|
if(SSL_CA_BUNDLE)
|
|
|
|
install(FILES ${SSL_CA_BUNDLE} DESTINATION "ssl/certs")
|
|
|
|
else()
|
|
|
|
file(DOWNLOAD "https://curl.se/ca/cacert.pem" "${CMAKE_BINARY_DIR}/ca-bundle.crt" TLS_VERIFY ON)
|
|
|
|
install(FILES "${CMAKE_BINARY_DIR}/ca-bundle.crt" DESTINATION "ssl/certs")
|
2019-01-31 17:50:16 -05:00
|
|
|
endif()
|
2021-09-06 22:26:00 -04:00
|
|
|
|
2012-10-22 14:40:03 -04:00
|
|
|
endif()
|
2022-03-08 06:30:17 -05:00
|
|
|
|
|
|
|
# The install commands in this subdirectory will be executed after all the install commands in the
|
|
|
|
# current scope are ran. It is required for correct functtioning of macdeployqt.
|
|
|
|
add_subdirectory(post_install)
|