Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel usage of KeePassXC 2.3.4 and 2.4.0 #2899

Closed
bernardo69 opened this issue Mar 28, 2019 · 36 comments
Closed

Parallel usage of KeePassXC 2.3.4 and 2.4.0 #2899

bernardo69 opened this issue Mar 28, 2019 · 36 comments

Comments

@bernardo69
Copy link

bernardo69 commented Mar 28, 2019

Hello all,

Unfortunately I am running among other systems a MacBook from 2009, where the last supported macOS version is 10.11 (El Capitan) and I cannot upgrade to Mojave.

Therefore I cannot install KeePassXC 2.4.0 on that MacBook, as the new version required 10.12 due to the QT update, but I have upgraded on my other systems (mainly Windows). The KDBX database is shared across the devices via Dropbox.

So I am using 2.3.4 and 2.4.0 in parallel on the same KDBX database.

Whenever I am using now 2.4.0 it wants to migrate the KeePassCX Browser settings into the database. When I am using 2.3.4 it creates them outside again. Subsequently I am losing permanently my browser integration settings.

Is there a way to avoid that (except buying a new MacBook with Mojave of course ;-)

Thanks in advance

Best regards
Bernd
2019-03-28 10_09_16-KeePassXC kdbx - KeePassXC

@bernardo69 bernardo69 added the bug label Mar 28, 2019
@droidmonkey
Copy link
Member

This is an interesting problem. Apparently you can run snap packages in osx. Perhaps this will be a viable option. https://docs.snapcraft.io/building-the-snap-on-mac/6751

@droidmonkey
Copy link
Member

@varjolintu
Copy link
Member

Well, you can use both but that popup is going to annoy you every time you open a database that contains older browser extension settings.

I wonder if it's possible to build KeePassXC by yourself with an older Qt version.

@Nocty201
Copy link

In the same boat (of a sort) here; my mac is "stuck" on 10.11 and of course every other PC I use has updated without issue - except now once the database has synched, I can't open it any more on my mac.

I tried installing snap (via brew), and after cloning the git into a directory, snapcraft stops with an error telling me I need multipass. (https://github.com/CanonicalLtd/multipass/releases)

Attempting to clone that errors with "not found".

It's been fun, but this one's a bit of a showstopper until I patch the OS installer to force it to upgrade... Unless someone has an idea otherwise (KeepassXC related, that is).

@Exploder98
Copy link

It is completely possible to build KeepassXC 2.4.0 on macOS 10.11.

I'm also running 10.11 (even though I could update to Mojave... idk why I haven't done that yet) and I managed to build KeepassXC 2.4.0 from source. I installed the dependencies and everything worked, except I had to fix some dynamic library linking problems with the browser integration.

I have Qt 5.11.3, installed with the official installer instead of brew (I used brew for other dependencies though). I followed the build instructions and used

cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_BUILD_TYPE=Release -DKEEPASSXC_BUILD_TYPE=Release -DWITH_XC_AUTOTYPE=ON -DWITH_XC_BROWSER=ON -DWITH_XC_NETWORKING=ON -DWITH_XC_SSHAGENT=ON -DWITH_XC_KEESHARE=ON -DWITH_XC_TOUCHID=OFF -DCMAKE_PREFIX_PATH=/path/to/Qt/5.11.3/clang_64/lib/cmake ..

Then I used make and make package to create a .dmg. Near to the end of the build there was some error related to install_name_tool, however KeepassXC seemed to work - except for the browser integration, which failed because keepassxc-proxy could not find QtNetwork and QtCore dynamic libraries. I noticed that they had been linked with @rpath and the program could not find them even though they were inside the .app package. I managed to fix these using install_name_tool (Assuming KeepassXC.app is in the /Applications directory):

install_name_tool -change @rpath/QtNetwork.framework/Versions/5/QtNetwork "@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork" /Applications/KeePassXC.app/Contents/MacOS/keepassxc-proxy
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore "@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore" /Applications/KeePassXC.app/Contents/MacOS/keepassxc-proxy

So, it's possible to build KeepassXC on El Capitan.
Version
Information from about -> Debug info

KeePassXC - Version 2.4.0
Revision: c51752d

Libraries:
- Qt 5.11.3
- libgcrypt 1.8.4

Operating system: OS X El Capitan (10.11)
CPU architecture: x86_64
Kernel: darwin 15.6.0

Enabled extensions:
- Auto-Type
- Browser Integration
- SSH Agent
- KeeShare (only unsigned sharing)

@phoerious
Copy link
Member

phoerious commented Apr 3, 2019

Yes, it's possible to build, but its impossible to run if built on a newer OS and with Qt 5.12.

@bernardo69
Copy link
Author

So, it's possible to build KeepassXC on El Capitan.

Hi,
Thanks a lot. Can you provide this .dmg file somewhere? I am not so experienced in this area to build it by myself.

Thanks in advance.

Best regards
Bernd

@Exploder98
Copy link

Exploder98 commented Apr 3, 2019

I managed to create a .dmg where the KeepassXC binaries seem to work. I had to zip it because Github does not seem to accept .dmg files.

It should be clear that this package comes without any kind of warranty from my side. It is provided 'as is' and its use is at your own risk.

So, if you are brave enough to use software from some random guy in the Internet, here you go :)
EDIT: please do not use this, this one will not work. See my comment below for a working version.

KeePassXC-2.4.0-El-Capitan.dmg.zip

The .app is not signed and macOS will complain about it. If you right click it and select "Open", you should be able to open it anyway.

For record: I fixed the linking problem before packaging by editing build/src/proxy/cmake_install.cmake, on the line where /usr/bin/install_name_tool is used I added

-add_rpath "@executable_path/../Frameworks"

This adds the Frameworks directory within the .app to rpath. Now that part of the file looks like this:

execute_process(COMMAND /usr/bin/install_name_tool
      -delete_rpath "/path/to/Qt/5.11.3/clang_64/lib"
      -add_rpath "@executable_path/../Frameworks"
      "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/KeePassXC.app/Contents/MacOS/keepassxc-proxy")

@bernardo69
Copy link
Author

Thanks a lot! Yes, I am brave enough ;-)

I tried and the binary is running, just the browser integration does not work. Neither Chrome or Firefox can connect to KeePassXC 2.4.0....

Any idea?

@Exploder98
Copy link

Okay, I made a dumb mistake. Those quotes in the line I copied to cmake_install.cmake were "wrong" (unicode quotes) which of course caused the path to be invalid - and the program handling the browser integration could not start. Luckily this was a fast and easy fix (I just replaced those quotes with normal ones) :)

Here's the (hopefully) fixed .dmg:

KeePassXC-2.4.0-El-Capitan-fixed.dmg.zip

Sorry for the mistake, let's hope this one works :)

By the way, it's strange that the incorrect version seemed to work on my system. I guess the working version of the browser integration proxy was running even though I had stopped KeepassXC.

@bernardo69
Copy link
Author

Great! This one works.

Thanks a lot!!

@Nocty201
Copy link

Nocty201 commented Apr 5, 2019

Another thank you.

I would have happily stumbled through your instructions and given it a go but am happy to use your provided DMG. Might be time to replace this Mac or put some kind of *nix on it...

Have a great day!

@bernardo69
Copy link
Author

The dmg of Exploder98 works fine. Thank you!

@bernardo69 bernardo69 reopened this Apr 22, 2019
@bernardo69
Copy link
Author

Hi,

@Exploder98 : Do you have also 2.4.1 compiled dmg for us?

Would appreciate it very much.

Thanks in advance

Best regards
Bernd

@Exploder98
Copy link

Yes, actually, I do.

KeePassXC-2.4.1-el-capitan.dmg.zip

However I do not want to become some kind "compile machine" that provides compatible builds for old systems. I'll definitely upgrade my laptop to some newer macos at some point and then I probably won't be able to create these builds. I think the process could be automated, but I don't know how or where I could do it.

I also think there's a bug somewhere that causes the linking in keepassxc-proxy and keepassxc-cli to be incorrect (the Frameworks directory inside the .app won't be included in rpath by default in those executables when making the package, rpath is some kind of search path where the app looks for libraries). I don't know where the bug is - in KeepassXC's build files, in CMake or in the packaging tool? Or somewhere else entirely, like Qt or XCode? Or is it because my old macos version?

@varjolintu
Copy link
Member

@Exploder98 We made a lot of fixes to the linking of both keepassxc-proxy and keepassxc-cli and confirmed those work with both High Sierra and Mojave (the two most common versions).

Could you copy/paste what otool -L returns from both binaries inside the official .app package? Thanks.

@Exploder98
Copy link

@varjolintu Here are the outputs for the official package:
keepassxc-proxy:

keepassxc-proxy:
	@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.12.0, current version 5.12.2)
	@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.12.0, current version 5.12.2)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)

keepassxc-cli:

keepassxc-cli:
	@executable_path/../Frameworks/libgcrypt.20.dylib (compatibility version 23.0.0, current version 23.4.0)
	@executable_path/../Frameworks/libargon2.1.dylib (compatibility version 0.0.0, current version 0.0.0)
	@executable_path/../Frameworks/libgpg-error.0.dylib (compatibility version 28.0.0, current version 28.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	@executable_path/../Frameworks/libsodium.23.dylib (compatibility version 26.0.0, current version 26.0.0)
	@executable_path/../Frameworks/QtSvg.framework/Versions/5/QtSvg (compatibility version 5.12.0, current version 5.12.2)
	@executable_path/../Frameworks/libqrencode.4.dylib (compatibility version 5.0.0, current version 5.2.0)
	@executable_path/../Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent (compatibility version 5.12.0, current version 5.12.2)
	@executable_path/../Frameworks/libyubikey.0.dylib (compatibility version 2.0.0, current version 2.7.0)
	@executable_path/../Frameworks/libykpers-1.1.dylib (compatibility version 21.0.0, current version 21.3.0)
	@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.12.0, current version 5.12.2)
	@executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.12.0, current version 5.12.2)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1570.15.0)
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1671.40.118)
	@executable_path/../Frameworks/QtMacExtras.framework/Versions/5/QtMacExtras (compatibility version 5.12.0, current version 5.12.2)
	@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.12.0, current version 5.12.2)
	@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.12.0, current version 5.12.2)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 58286.251.4)
	/System/Library/Frameworks/LocalAuthentication.framework/Versions/A/LocalAuthentication (compatibility version 1.0.0, current version 425.250.11)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1570.15.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

However when I try to build 2.4.1 myself the output is this:

keepassxc-proxy:
	@rpath/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.11.0, current version 5.11.3)
	@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.11.0, current version 5.11.3)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)

and

keepassxc-cli:
	@executable_path/../Frameworks/libgcrypt.20.dylib (compatibility version 23.0.0, current version 23.4.0)
	@executable_path/../Frameworks/libargon2.1.dylib (compatibility version 0.0.0, current version 0.0.0)
	@executable_path/../Frameworks/libgpg-error.0.dylib (compatibility version 28.0.0, current version 28.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
	@executable_path/../Frameworks/libsodium.23.dylib (compatibility version 26.0.0, current version 26.0.0)
	@rpath/QtSvg.framework/Versions/5/QtSvg (compatibility version 5.11.0, current version 5.11.3)
	@executable_path/../Frameworks/libqrencode.4.dylib (compatibility version 5.0.0, current version 5.2.0)
	@rpath/QtConcurrent.framework/Versions/5/QtConcurrent (compatibility version 5.11.0, current version 5.11.3)
	@rpath/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.11.0, current version 5.11.3)
	@rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.11.0, current version 5.11.3)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1349.25.0)
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1504.75.0)
	@rpath/QtMacExtras.framework/Versions/5/QtMacExtras (compatibility version 5.11.0, current version 5.11.3)
	@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.11.0, current version 5.11.3)
	@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.11.0, current version 5.11.3)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1348.28.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

The official version has @executable_path everywhere but my build has some @rpaths there. Strange.

@varjolintu
Copy link
Member

varjolintu commented Apr 22, 2019

@Exploder98 Maybe the official Qt installer messes something up or the paths differ. We recommend using Homebrew anyway. With that I haven't seen any @rpaths.

@Exploder98
Copy link

Well, homebrew is not an option for me since it just downloads the official .app which won't even start on El Capitan (crashes with EXC_CRASH (Code Signature Invalid)) so I have to build it myself and fix those linking errors with install_name_tool or by patching the .cmake files.

@noplanman
Copy link

noplanman commented Jun 1, 2019

@Exploder98 Wondering if we're lucky and you have 2.4.2 2.4.3 compiled somewhere 😇

@yan12125
Copy link
Contributor

yan12125 commented Jul 4, 2019

Since commit ce1f19c, I need to this patch to make KeePassXC build on Mac OS X < 10.12: https://github.com/macports/macports-ports/blob/master/security/KeePassXC/files/devel/patch-osx10.11.diff

UPDATE: the patch is merged.

@droidmonkey
Copy link
Member

Can you submit that as a PR?

@yan12125
Copy link
Contributor

yan12125 commented Jul 4, 2019

Can you submit that as a PR?

Sure! Opened #3357.

droidmonkey pushed a commit that referenced this issue Dec 21, 2019
This commit reverts #3357.

The previous PR is for the new symbol NSEventMaskKeyDown, which is
introduced in #3347. In #3794, #3347 is reverted, so the workaround
in #3357 is no longer needed. Furthermore, it causes build failures
on 10.11 (#3932) as the header file for type NSEventMask is removed
in #3794, too.

Note that this is not a complete fix. A complete patch can be found
at [1]. In MacPorts, the OS version for building a package is the same
as the OS that installs it, so #ifdef can be used to replace @available.
The latter language feature is not available until Xcode 9.

With the patch mentioned in the previous paragraph, KeePassXC 2.5.1
can be built on Mac OS X 10.9 or newer.

Ref: #2899

[1] https://github.com/macports/macports-ports/blob/de1bb703ad19c258ad27eb903cf510dc1930107c/security/KeePassXC/files/patch-old-mac.diff
@noplanman
Copy link

@droidmonkey @yan12125 Will we get pre-built releases to download?
Or does anybody who wants KeepassXC on < 10.12 need to built it manually?

@phoerious
Copy link
Member

phoerious commented Jan 16, 2020

Or does anybody who wants KeepassXC on < 10.12 need to built it manually?

Yes, that.

@noplanman
Copy link

Ok, thanks for letting me know!

Well, if there's any volunteer out there, I'd be highly grateful for a built package 🙏

@yan12125
Copy link
Contributor

FWIW, I previously maintained unofficial binary packages at MacPorts, but I'm no longer working on it as I don't use macOS as my daily driver anymore.

@michaelbliem
Copy link

michaelbliem commented Apr 19, 2020

someone should mention here, that it is absolutely NOT ok to use the build of an unknown person for the use of storing ALL passwords!

either keepassxc developers forbid this methods OR they deliver a build themselves OR they officially announce, that keepassxc is not supporting osx10.11 anymore and el capitan users should switch to macpass instead.

last one is what i will do. if devs cannot keep such a security-tool actual for my system, then there is no sense in using it. i liked keepassxc more than macpass, but in security it is not about 'liking', and therefore...

now i like macpass more :)

@varjolintu
Copy link
Member

@michaelbliem It was announced:
https://keepassxc.org/blog/2019-03-19-2.4.0-released/

Our macOS binaries now have a minimum requirement of macOS 10.12 (Sierra) instead of 10.10 (Yosemite) as before. This is due to a new Qt version which is required in order to provide you with support for the new Mojave dark theme. KeePassXC itself will continue to run on older systems, but would need to be recompiled for that specific macOS version from source.

@michaelbliem
Copy link

right! i didn't want to blame anybody here. in fact i do understand everybody in this thread. but as it is nowhere written here, how it should be (or in this case: how it should definitely NOT be!) i felt like i have to do this.

yes, the source can be compiled, but it is not compiled by devs anymore. so there are only two possibilities left: compile it YOURSELF or switch to another software. using builds of unknown persons is NOT an alternative! and devs of keepassxc should tell so as well if they want to be kept serious in matters of security...

reading this thread gives the impression that it is ok to download password-management-software of unknown source!

@Exploder98
Copy link

someone should mention here, that it is absolutely NOT ok to use the build of an unknown person for the use of storing ALL passwords!

@michaelbliem I agree! That's why I said "if you are brave enough to use software from some random guy in the Internet". I just wanted to be helpful and spare others from finding out how to fix the build - and not everyone knows how to build software, let alone fix strange linking issues.

@varjolintu Maybe builds for older macOS/OS X versions could somehow be included in the CI process as there seems to be one? If that's OK I think I could try to figure out how it works at some point, right now I don't have time for that.

@varjolintu
Copy link
Member

@Exploder98 @phoerious maintains the macOS builds so maybe we could ask him. Could you reply when you have time? Thanks.

@michaelbliem
Copy link

@Exploder98 i understand you and the users who can't compile themselves (as me). i didn't want to blame you at all! but still i can't use your binary, even so i would honestly like to do so!

@droidmonkey
Copy link
Member

droidmonkey commented Apr 19, 2020

@michaelbliem couple points here:

  • macOS 10.11 is so wildly out of date that your system is subject to numerous known exploits. You are already at extremely high risk.

  • Our downloads page is pretty explicit about what we support:

image

@michaelbliem
Copy link

michaelbliem commented Apr 19, 2020

@droidmonkey

do you switch to ad-mode now? i didn't blame you! and no, i will not install a password-manager from unknown source because i anyway have an os without security updates. is this, what you want to recommend?

why not be honest HERE (in this thread only!) and just tell politely that it is not a good idea to use a build of unknown source. even so it is seducing to use it!

you are responsible for keepassxc and its users, not for any os! and for many users here in this thread you accept an (additional) security hole? to be honest: this feedback makes me start liking macpass even more...

@phoerious
Copy link
Member

Please use Macpass, dont bother mansplaining IT security to us any further. We gave you the facts and we don't need you to start swearing at us. Thank you very much and stay healthy.

@keepassxreboot keepassxreboot locked as too heated and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants