Merge branch 'release/2.2.2' into develop

This commit is contained in:
Janek Bevendorff 2017-10-19 21:45:49 +02:00
commit 8592f7e672
17 changed files with 306 additions and 35 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
CMakeLists.txt.* CMakeLists.txt.*
build*/ build*/
cmake-build-*/
release*/ release*/
.idea/ .idea/
*.iml *.iml

View File

@ -75,7 +75,7 @@ cat << EOF > ./usr/bin/keepassxc_env
#!/usr/bin/env bash #!/usr/bin/env bash
#export QT_QPA_PLATFORMTHEME=gtk2 #export QT_QPA_PLATFORMTHEME=gtk2
export LD_LIBRARY_PATH="..$(dirname ${QT_PLUGIN_PATH})/lib:\${LD_LIBRARY_PATH}" export LD_LIBRARY_PATH="..$(dirname ${QT_PLUGIN_PATH})/lib:\${LD_LIBRARY_PATH}"
export QT_PLUGIN_PATH="..${QT_PLUGIN_PATH}" export QT_PLUGIN_PATH="..${QT_PLUGIN_PATH}:\${KPXC_QT_PLUGIN_PATH}"
# unset XDG_DATA_DIRS to make tray icon work in Ubuntu Unity # unset XDG_DATA_DIRS to make tray icon work in Ubuntu Unity
# see https://github.com/probonopd/AppImageKit/issues/351 # see https://github.com/probonopd/AppImageKit/issues/351

View File

@ -52,8 +52,17 @@ set(KEEPASSXC_VERSION_MINOR "2")
set(KEEPASSXC_VERSION_PATCH "1") set(KEEPASSXC_VERSION_PATCH "1")
set(KEEPASSXC_VERSION "${KEEPASSXC_VERSION_MAJOR}.${KEEPASSXC_VERSION_MINOR}.${KEEPASSXC_VERSION_PATCH}") set(KEEPASSXC_VERSION "${KEEPASSXC_VERSION_MAJOR}.${KEEPASSXC_VERSION_MINOR}.${KEEPASSXC_VERSION_PATCH}")
# Special flag for snap builds # Distribution info
set(KEEPASSXC_SNAP_BUILD OFF CACHE BOOL "Set whether this is a build for snap or not") set(KEEPASSXC_DIST True)
set(KEEPASSXC_DIST_TYPE "Other" CACHE STRING "KeePassXC Distribution type")
set_property(CACHE KEEPASSXC_DIST_TYPE PROPERTY STRINGS Snap AppImage Other)
if(KEEPASSXC_DIST_TYPE STREQUAL "Snap")
set(KEEPASSXC_DIST_SNAP True)
elseif(KEEPASSXC_DIST_TYPE STREQUAL "AppImage")
set(KEEPASSXC_DIST_APPIMAGE True)
elseif(KEEPASSXC_DIST_TYPE STREQUAL "Other")
unset(KEEPASSXC_DIST)
endif()
if("${CMAKE_C_COMPILER}" MATCHES "clang$" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") if("${CMAKE_C_COMPILER}" MATCHES "clang$" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_COMPILER_IS_CLANG 1) set(CMAKE_COMPILER_IS_CLANG 1)

View File

@ -23,10 +23,11 @@ RUN set -x \
RUN set -x \ RUN set -x \
&& add-apt-repository ppa:george-edison55/cmake-3.x && add-apt-repository ppa:george-edison55/cmake-3.x
ENV QT_PPA=qt591
ENV QT_VERSION=qt59 ENV QT_VERSION=qt59
RUN set -x \ RUN set -x \
&& add-apt-repository --yes ppa:beineri/opt-${QT_VERSION}-trusty && add-apt-repository --yes ppa:beineri/opt-${QT_PPA}-trusty
RUN set -x \ RUN set -x \

View File

@ -257,19 +257,18 @@ checkChangeLog() {
grep -qPzo "${RELEASE_NAME} \(\d{4}-\d{2}-\d{2}\)\n=+\n" CHANGELOG grep -qPzo "${RELEASE_NAME} \(\d{4}-\d{2}-\d{2}\)\n=+\n" CHANGELOG
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exitError "CHANGELOG does not contain any information about the '${RELEASE_NAME}' release!" exitError "'CHANGELOG' has not been updated to the '${RELEASE_NAME}' release!"
fi fi
} }
checkTransifexCommandExists() { checkAppStreamInfo() {
command -v tx > /dev/null if [ ! -f share/linux/org.keepassxc.appdata.xml ]; then
if [ 0 -ne $? ]; then exitError "No AppStream info file found!"
exitError "Transifex tool 'tx' not installed! Please install it using 'pip install transifex-client'"
fi fi
command -v lupdate-qt5 > /dev/null grep -qPzo "<release version=\"${RELEASE_NAME}\" date=\"\d{4}-\d{2}-\d{2}\">" share/linux/org.keepassxc.appdata.xml
if [ 0 -ne $? ]; then if [ $? -ne 0 ]; then
exitError "Qt Linguist tool (lupdate-qt5) is not installed! Please install using 'apt install qttools5-dev-tools'" exitError "'share/linux/org.keepassxc.appdata.xml' has not been updated to the '${RELEASE_NAME}' release!"
fi fi
} }
@ -281,7 +280,24 @@ checkSnapcraft() {
grep -qPzo "version: ${RELEASE_NAME}" snapcraft.yaml grep -qPzo "version: ${RELEASE_NAME}" snapcraft.yaml
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exitError "snapcraft.yaml has not been updated to the '${RELEASE_NAME}' release!" exitError "'snapcraft.yaml' has not been updated to the '${RELEASE_NAME}' release!"
fi
}
checkTransifexCommandExists() {
command -v tx > /dev/null
if [ 0 -ne $? ]; then
exitError "Transifex tool 'tx' not installed! Please install it using 'pip install transifex-client'"
fi
}
checkQt5LUpdateExists() {
command -v lupdate > /dev/null
if [ 0 -eq $? ] && ! $(lupdate -version | grep -q "lupdate version 5\."); then
command -v lupdate-qt5 > /dev/null
if [ 0 -ne $? ]; then
exitError "Qt Linguist tool (lupdate-qt5) is not installed! Please install using 'apt install qttools5-dev-tools'"
fi
fi fi
} }
@ -296,6 +312,7 @@ performChecks() {
logInfo "Validating toolset and repository..." logInfo "Validating toolset and repository..."
checkTransifexCommandExists checkTransifexCommandExists
checkQt5LUpdateExists
checkGitRepository checkGitRepository
checkReleaseDoesNotExist checkReleaseDoesNotExist
checkWorkingTreeClean checkWorkingTreeClean
@ -309,6 +326,7 @@ performChecks() {
checkVersionInCMake checkVersionInCMake
checkChangeLog checkChangeLog
checkAppStreamInfo
checkSnapcraft checkSnapcraft
logInfo "\e[1m\e[32mAll checks passed!\e[0m" logInfo "\e[1m\e[32mAll checks passed!\e[0m"
@ -598,7 +616,8 @@ build() {
# Building on Linux without Docker container # Building on Linux without Docker container
logInfo "Configuring build..." logInfo "Configuring build..."
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=Off $CMAKE_OPTIONS \ cmake -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=Off $CMAKE_OPTIONS \
-DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" "$SRC_DIR" -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \
-DKEEPASSXC_DIST_TYPE=AppImage "$SRC_DIR"
logInfo "Compiling sources..." logInfo "Compiling sources..."
make $MAKE_OPTIONS make $MAKE_OPTIONS
@ -615,7 +634,7 @@ build() {
logInfo "Launching Docker container to compile sources..." logInfo "Launching Docker container to compile sources..."
docker run --name "$DOCKER_CONTAINER_NAME" --rm \ docker run --name "$DOCKER_CONTAINER_NAME" --rm \
--cap-add SYS_ADMIN --device /dev/fuse \ --cap-add SYS_ADMIN --security-opt apparmor:unconfined --device /dev/fuse \
-e "CC=${CC}" -e "CXX=${CXX}" \ -e "CC=${CC}" -e "CXX=${CXX}" \
-v "$(realpath "$SRC_DIR"):/keepassxc/src:ro" \ -v "$(realpath "$SRC_DIR"):/keepassxc/src:ro" \
-v "$(realpath "$OUTPUT_DIR"):/keepassxc/out:rw" \ -v "$(realpath "$OUTPUT_DIR"):/keepassxc/out:rw" \

View File

@ -30,7 +30,8 @@ if(UNIX AND NOT APPLE)
install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor
FILES_MATCHING PATTERN "application-x-keepassxc.png" PATTERN "application-x-keepassxc.svgz" FILES_MATCHING PATTERN "application-x-keepassxc.png" PATTERN "application-x-keepassxc.svgz"
PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE PATTERN "categories" EXCLUDE) PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE PATTERN "categories" EXCLUDE)
install(FILES linux/keepassxc.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) install(FILES linux/org.keepassxc.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install(FILES linux/org.keepassxc.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
install(FILES linux/keepassxc.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages) install(FILES linux/keepassxc.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
endif(UNIX AND NOT APPLE) endif(UNIX AND NOT APPLE)

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/x-keepass2"> <mime-type type="application/x-keepass2">
<comment>KeePass 2 database</comment> <comment>KeePass 2 Database</comment>
<glob pattern="*.kdbx"/> <glob pattern="*.kdbx"/>
<icon name="application-x-keepassxc"/> <icon name="application-x-keepassxc"/>
</mime-type> </mime-type>

View File

@ -0,0 +1,200 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2017 KeePassXC Team <team@keepassxc.org> -->
<component type="desktop-application">
<id>org.keepassxc</id>
<name>KeePassXC</name>
<metadata_license>CC-BY-3.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<icon type="stock">keepassxc</icon>
<url type="homepage">https://keepassxc.org</url>
<mimetypes>
<mimetype>application/x-keepass2</mimetype>
</mimetypes>
<summary>Community-driven port of the Windows application “KeePass Password Safe”</summary>
<description>
<p>
KeePassXC is an application for people with extremely high demands on secure
personal data management. It has a light interface, is cross-platform and
published under the terms of the GNU General Public License.
</p>
</description>
<launchable type="desktop-id">org.keepassxc.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://keepassxc.org/images/screenshots/linux/screen_001.png</image>
</screenshot>
<screenshot>
<image>https://keepassxc.org/images/screenshots/linux/screen_002.png</image>
</screenshot>
<screenshot>
<image>https://keepassxc.org/images/screenshots/linux/screen_003.png</image>
</screenshot>
<screenshot>
<image>https://keepassxc.org/images/screenshots/linux/screen_004.png</image>
</screenshot>
<screenshot>
<image>https://keepassxc.org/images/screenshots/linux/screen_005.png</image>
</screenshot>
<screenshot>
<image>https://keepassxc.org/images/screenshots/linux/screen_006.png</image>
</screenshot>
<screenshot>
<image>https://keepassxc.org/images/screenshots/linux/screen_007.png</image>
</screenshot>
<screenshot>
<image>https://keepassxc.org/images/screenshots/linux/screen_008.png</image>
</screenshot>
<screenshot>
<image>https://keepassxc.org/images/screenshots/linux/screen_009.png</image>
</screenshot>
<screenshot>
<image>https://keepassxc.org/images/screenshots/linux/screen_010.png</image>
</screenshot>
<screenshot>
<image>https://keepassxc.org/images/screenshots/linux/screen_011.png</image>
</screenshot>
<screenshot>
<image>https://keepassxc.org/images/screenshots/linux/screen_012.png</image>
</screenshot>
<screenshot>
<image>https://keepassxc.org/images/screenshots/linux/screen_013.png</image>
</screenshot>
<screenshot>
<image>https://keepassxc.org/images/screenshots/linux/screen_014.png</image>
</screenshot>
</screenshots>
<releases>
<release version="2.2.1" date="2017-10-01">
<description>
<ul>
<li>Corrected multiple snap issues [#934, #1011]</li>
<li>Corrected multiple custom icon issues [#708, #719, #994]</li>
<li>Corrected multiple Yubikey issues [#880]</li>
<li>Fixed single instance preventing load on occasion [#997]</li>
<li>Keep entry history when merging databases [#970]</li>
<li>Prevent data loss if passwords were mismatched [#1007]</li>
<li>Fixed crash after merge [#941]</li>
<li>Added configurable auto-type default delay [#703]</li>
<li>Unlock database dialog window comes to front [#663]</li>
<li>Translation and compiling fixes</li>
</ul>
</description>
</release>
<release version="2.2.0" date="2017-06-23">
<description>
<ul>
<li>Added YubiKey 2FA integration for unlocking databases [#127]</li>
<li>Added TOTP support [#519]</li>
<li>Added CSV import tool [#146, #490]</li>
<li>Added KeePassXC CLI tool [#254]</li>
<li>Added diceware password generator [#373]</li>
<li>Added support for entry references [#370, #378]</li>
<li>Added support for Twofish encryption [#167]</li>
<li>Enabled DEP and ASLR for in-memory protection [#371]</li>
<li>Enabled single instance mode [#510]</li>
<li>Enabled portable mode [#645]</li>
<li>Enabled database lock on screensaver and session lock [#545]</li>
<li>Redesigned welcome screen with common features and recent databases [#292]</li>
<li>Multiple updates to search behavior [#168, #213, #374, #471, #603, #654]</li>
<li>Added auto-type fields {CLEARFIELD}, {SPACE}, {{}, {}} [#267, #427, #480]</li>
<li>Fixed auto-type errors on Linux [#550]</li>
<li>Prompt user prior to executing a cmd:// URL [#235]</li>
<li>Entry attributes can be protected (hidden) [#220]</li>
<li>Added extended ascii to password generator [#538]</li>
<li>Added new database icon to toolbar [#289]</li>
<li>Added context menu entry to empty recycle bin in databases [#520]</li>
<li>Added "apply" button to entry and group edit windows [#624]</li>
<li>Added macOS tray icon and enabled minimize on close [#583]</li>
<li>Fixed issues with unclean shutdowns [#170, #580]</li>
<li>Changed keyboard shortcut to create new database to CTRL+SHIFT+N [#515]</li>
<li>Compare window title to entry URLs [#556]</li>
<li>Implemented inline error messages [#162]</li>
<li>Ignore group expansion and other minor changes when making database "dirty" [#464]</li>
<li>Updated license and copyright information on souce files [#632]</li>
<li>Added contributors list to about dialog [#629]</li>
</ul>
</description>
</release>
<release version="2.1.4" date="2017-04-09">
<description>
<ul>
<li>Bumped KeePassHTTP version to 1.8.4.2</li>
<li>KeePassHTTP confirmation window comes to foreground [#466]</li>
</ul>
</description>
</release>
<release version="2.1.3" date="2017-03-03">
<description>
<ul>
<li>Fix possible overflow in zxcvbn library [#363]</li>
<li>Revert HiDPI setting to avoid problems on laptop screens [#332]</li>
<li>Set file meta properties in Windows executable [#330]</li>
<li>Suppress error message when auto-reloading a locked database [#345]</li>
<li>Improve usability of question dialog when database is already locked by a different instance [#346]</li>
<li>Fix compiler warnings in QHttp library [#351]</li>
<li>Use unified toolbar on Mac OS X [#361]</li>
<li>Fix an issue on X11 where the main window would be raised instead of closed on Alt+F4 [#362]</li>
</ul>
</description>
</release>
<release version="2.1.2" date="2017-02-17">
<description>
<ul>
<li>Ask for save location when creating a new database [#302]</li>
<li>Remove Libmicrohttpd dependency to clean up the code and ensure better OS X compatibility [#317, #265]</li>
<li>Prevent Qt from degrading Wifi network performance on certain platforms [#318]</li>
<li>Visually refine user interface on OS X and other platforms [#299]</li>
<li>Remove unusable tray icon setting on OS X [#293]</li>
<li>Fix compositing glitches on Ubuntu and prevent flashing when minimizing to the tray at startup [#307]</li>
<li>Fix AppImage tray icon on Ubuntu [#277, #273]</li>
<li>Fix global menu disappearing after restoring KeePassXC from the tray on Ubuntu [#276]</li>
<li>Fix result order in entry search [#320]</li>
<li>Enable HiDPI scaling on supported platforms [#315]</li>
<li>Remove empty directories from installation target [#282]</li>
</ul>
</description>
</release>
<release version="2.1.1" date="2017-02-06">
<description>
<ul>
<li>Enabled HTTP plugin build; plugin is disabled by default and limited to localhost [#147]</li>
<li>Escape HTML in dialog boxes [#247]</li>
<li>Corrected crashes in favicon download and password generator [#233, #226]</li>
<li>Increase font size of password meter [#228]</li>
<li>Fixed compatibility with Qt 5.8 [#211]</li>
<li>Use consistent button heights in password generator [#229]</li>
</ul>
</description>
</release>
<release version="2.1.0" date="2017-01-22">
<description>
<ul>
<li>Show unlock dialog when using autotype on a closed database [#10, #89]</li>
<li>Show different tray icon when database is locked [#37, #46]</li>
<li>Support autotype on Windows and OS X [#42, #60, #63]</li>
<li>Add delay feature to autotype [#76, #77]</li>
<li>Add password strength meter [#84, #92]</li>
<li>Add option for automatically locking the database when minimizing the window [#57]</li>
<li>Add feature to download favicons and use them as entry icons [#30]</li>
<li>Automatically reload and merge database when the file changed on disk [#22, #33, #93]</li>
<li>Add tool for merging two databases [#22, #47, #143]</li>
<li>Add --pw-stdin commandline option to unlock the database by providing a password on STDIN [#54]</li>
<li>Add utility script for reading the database password from KWallet [#55]</li>
<li>Fix some KeePassHTTP settings not being remembered [#34, #65]</li>
<li>Make search box persistent [#15, #67, #157]</li>
<li>Enhance search feature by scoping the search to selected group [#16, #118]</li>
<li>Improve interaction between search field and entry list [#131, #141]</li>
<li>Add stand-alone password-generator [#18, #92]</li>
<li>Don't require password repetition when password is visible [#27, #92]</li>
<li>Add support for entry attributes in autotype sequences [#107]</li>
<li>Always focus password field when opening the database unlock widget [#116, #117]</li>
<li>Fix compilation errors on various platforms [#53, #126, #130]</li>
<li>Restructure and improve kdbx-extract utility [#160]</li>
</ul>
</description>
</release>
</releases>
</component>

View File

@ -1,13 +1,16 @@
[Desktop Entry] [Desktop Entry]
Name=KeePassXC Name=KeePassXC
GenericName=Community Password Manager GenericName=Password Manager
GenericName[de]=Passwortverwaltung GenericName[de]=Passwortverwaltung
GenericName[es]=Gestor de contraseñas GenericName[es]=Gestor de contraseñas
GenericName[fr]=Gestionnaire de mot de passe GenericName[fr]=Gestionnaire de mot de passe
GenericName[ru]=менеджер паролей GenericName[ru]=менеджер паролей
Comment=Community-driven port of the Windows application KeePass Password Safe
Exec=keepassxc %f Exec=keepassxc %f
TryExec=keepassxc
Icon=keepassxc Icon=keepassxc
Terminal=false Terminal=false
Type=Application Type=Application
Categories=Qt;Utility; Version=1.0
Categories=Utility;Security;Qt
MimeType=application/x-keepass2; MimeType=application/x-keepass2;

View File

@ -1,18 +1,18 @@
name: keepassxc name: keepassxc
version: 2.2.1 version: 2.2.1
grade: stable grade: stable
summary: community driven port of the windows application “Keepass Password Safe” summary: Community-driven port of the Windows application “KeePass Password Safe”
description: | description: |
KeePassXC is an application for people with extremely high demands on secure KeePassXC is an application for people with extremely high demands on secure
personal data management. It has a light interface, is cross platform and personal data management. It has a light interface, is cross-platform and
is published under the terms of the GNU General Public License. published under the terms of the GNU General Public License.
confinement: strict confinement: strict
apps: apps:
keepassxc: keepassxc:
command: desktop-launch keepassxc command: desktop-launch keepassxc
plugs: [unity7, x11, opengl, gsettings, home, network, network-bind, removable-media, raw-usb] plugs: [unity7, x11, opengl, gsettings, home, network, network-bind, removable-media, raw-usb]
desktop: usr/share/applications/keepassxc.desktop desktop: usr/share/applications/org.keepassxc.desktop
cli: cli:
command: keepassxc-cli command: keepassxc-cli
plugs: [gsettings, home, removable-media, raw-usb] plugs: [gsettings, home, removable-media, raw-usb]
@ -24,7 +24,7 @@ parts:
configflags: configflags:
- -DCMAKE_BUILD_TYPE=Release - -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr - -DCMAKE_INSTALL_PREFIX=/usr
- -DKEEPASSXC_SNAP_BUILD=ON - -DKEEPASSXC_DIST_TYPE=Snap
- -DWITH_TESTS=OFF - -DWITH_TESTS=OFF
- -DWITH_XC_AUTOTYPE=ON - -DWITH_XC_AUTOTYPE=ON
- -DWITH_XC_HTTP=ON - -DWITH_XC_HTTP=ON
@ -42,7 +42,7 @@ parts:
- libyubikey-dev - libyubikey-dev
- libykpers-1-dev - libykpers-1-dev
install: | install: |
sed -i 's|Icon=keepassxc|Icon=${SNAP}/usr/share/icons/hicolor/256x256/apps/keepassxc.png|g' $SNAPCRAFT_PART_INSTALL/usr/share/applications/keepassxc.desktop sed -i 's|Icon=keepassxc|Icon=${SNAP}/usr/share/icons/hicolor/256x256/apps/keepassxc.png|g' $SNAPCRAFT_PART_INSTALL/usr/share/applications/org.keepassxc.desktop
after: [desktop-qt5] after: [desktop-qt5]
# Redefine desktop-qt5 stage packages to work with Ubuntu 17.04 # Redefine desktop-qt5 stage packages to work with Ubuntu 17.04

View File

@ -16,7 +16,10 @@
#cmakedefine WITH_XC_AUTOTYPE #cmakedefine WITH_XC_AUTOTYPE
#cmakedefine WITH_XC_YUBIKEY #cmakedefine WITH_XC_YUBIKEY
#cmakedefine KEEPASSXC_SNAP_BUILD #cmakedefine KEEPASSXC_DIST
#cmakedefine KEEPASSXC_DIST_TYPE "@KEEPASSXC_DIST_TYPE@"
#cmakedefine KEEPASSXC_DIST_SNAP
#cmakedefine KEEPASSXC_DIST_APPIMAGE
#cmakedefine HAVE_PR_SET_DUMPABLE 1 #cmakedefine HAVE_PR_SET_DUMPABLE 1
#cmakedefine HAVE_RLIMIT_CORE 1 #cmakedefine HAVE_RLIMIT_CORE 1

View File

@ -260,6 +260,25 @@ bool Database::hasKey() const
return m_data.hasKey; return m_data.hasKey;
} }
bool Database::transformKeyWithSeed(const QByteArray& transformSeed)
{
Q_ASSERT(hasKey());
bool ok;
QString errorString;
QByteArray transformedMasterKey =
m_data.key.transform(transformSeed, transformRounds(), &ok, &errorString);
if (!ok) {
return false;
}
m_data.transformSeed = transformSeed;
m_data.transformedMasterKey = transformedMasterKey;
return true;
}
bool Database::verifyKey(const CompositeKey& key) const bool Database::verifyKey(const CompositeKey& key) const
{ {
Q_ASSERT(hasKey()); Q_ASSERT(hasKey());

View File

@ -106,6 +106,7 @@ public:
*/ */
bool setKey(const CompositeKey& key); bool setKey(const CompositeKey& key);
bool hasKey() const; bool hasKey() const;
bool transformKeyWithSeed(const QByteArray& transformSeed);
bool verifyKey(const CompositeKey& key) const; bool verifyKey(const CompositeKey& key) const;
void recycleEntry(Entry* entry); void recycleEntry(Entry* entry);
void recycleGroup(Group* group); void recycleGroup(Group* group);

View File

@ -91,7 +91,7 @@ QString FilePath::pluginPath(const QString& name)
QIcon FilePath::applicationIcon() QIcon FilePath::applicationIcon()
{ {
#ifdef KEEPASSXC_SNAP_BUILD #ifdef KEEPASSXC_DIST_SNAP
return icon("apps", "keepassxc", false); return icon("apps", "keepassxc", false);
#else #else
return icon("apps", "keepassxc"); return icon("apps", "keepassxc");
@ -100,7 +100,7 @@ QIcon FilePath::applicationIcon()
QIcon FilePath::trayIconLocked() QIcon FilePath::trayIconLocked()
{ {
#ifdef KEEPASSXC_SNAP_BUILD #ifdef KEEPASSXC_DIST_SNAP
return icon("apps", "keepassxc-locked", false); return icon("apps", "keepassxc-locked", false);
#else #else
return icon("apps", "keepassxc-locked"); return icon("apps", "keepassxc-locked");
@ -109,7 +109,7 @@ QIcon FilePath::trayIconLocked()
QIcon FilePath::trayIconUnlocked() QIcon FilePath::trayIconUnlocked()
{ {
#ifdef KEEPASSXC_SNAP_BUILD #ifdef KEEPASSXC_DIST_SNAP
return icon("apps", "keepassxc-unlocked", false); return icon("apps", "keepassxc-unlocked", false);
#else #else
return icon("apps", "keepassxc-unlocked"); return icon("apps", "keepassxc-unlocked");

View File

@ -45,6 +45,7 @@ void KeePass2Writer::writeDatabase(QIODevice* device, Database* db)
m_error = false; m_error = false;
m_errorStr.clear(); m_errorStr.clear();
QByteArray transformSeed = randomGen()->randomArray(32);
QByteArray masterSeed = randomGen()->randomArray(32); QByteArray masterSeed = randomGen()->randomArray(32);
QByteArray encryptionIV = randomGen()->randomArray(16); QByteArray encryptionIV = randomGen()->randomArray(16);
QByteArray protectedStreamKey = randomGen()->randomArray(32); QByteArray protectedStreamKey = randomGen()->randomArray(32);
@ -52,7 +53,12 @@ void KeePass2Writer::writeDatabase(QIODevice* device, Database* db)
QByteArray endOfHeader = "\r\n\r\n"; QByteArray endOfHeader = "\r\n\r\n";
if (db->challengeMasterSeed(masterSeed) == false) { if (db->challengeMasterSeed(masterSeed) == false) {
raiseError("Unable to issue challenge-response."); raiseError(tr("Unable to issue challenge-response."));
return;
}
if (!db->transformKeyWithSeed(transformSeed)) {
raiseError(tr("Unable to calculate master key"));
return; return;
} }

View File

@ -18,6 +18,8 @@
#ifndef KEEPASSX_KEEPASS2WRITER_H #ifndef KEEPASSX_KEEPASS2WRITER_H
#define KEEPASSX_KEEPASS2WRITER_H #define KEEPASSX_KEEPASS2WRITER_H
#include <QCoreApplication>
#include "format/KeePass2.h" #include "format/KeePass2.h"
#include "keys/CompositeKey.h" #include "keys/CompositeKey.h"
@ -26,6 +28,8 @@ class QIODevice;
class KeePass2Writer class KeePass2Writer
{ {
Q_DECLARE_TR_FUNCTIONS(KeePass2Writer)
public: public:
KeePass2Writer(); KeePass2Writer();
void writeDatabase(QIODevice* device, Database* db); void writeDatabase(QIODevice* device, Database* db);

View File

@ -55,13 +55,17 @@ AboutDialog::AboutDialog(QWidget* parent)
QString debugInfo = "KeePassXC - "; QString debugInfo = "KeePassXC - ";
debugInfo.append(tr("Version %1\n").arg(KEEPASSX_VERSION)); debugInfo.append(tr("Version %1\n").arg(KEEPASSX_VERSION));
if (!commitHash.isEmpty()) { if (!commitHash.isEmpty()) {
debugInfo.append(tr("Revision: %1").arg(commitHash).append("\n\n")); debugInfo.append(tr("Revision: %1").arg(commitHash.left(7)).append("\n"));
} }
debugInfo.append(QString("%1\n- Qt %2\n- %3\n\n") #ifdef KEEPASSXC_DIST
.arg(tr("Libraries:"), debugInfo.append(tr("Distribution: %1").arg(KEEPASSXC_DIST_TYPE).append("\n"));
QString::fromLocal8Bit(qVersion()), #endif
Crypto::backendVersion()));
debugInfo.append("\n").append(QString("%1\n- Qt %2\n- %3\n\n")
.arg(tr("Libraries:"))
.arg(QString::fromLocal8Bit(qVersion()))
.arg(Crypto::backendVersion()));
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
debugInfo.append(tr("Operating system: %1\nCPU architecture: %2\nKernel: %3 %4") debugInfo.append(tr("Operating system: %1\nCPU architecture: %2\nKernel: %3 %4")