Bug 397319 - Cannot access kwallet after upgrading from Fedora 26 to Fedora 28
Summary: Cannot access kwallet after upgrading from Fedora 26 to Fedora 28
Status: RESOLVED WORKSFORME
Alias: None
Product: frameworks-kwallet
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR major
Target Milestone: ---
Assignee: Valentin Rusu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-09 15:23 UTC by 63257245
Modified: 2022-12-29 05:25 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 63257245 2018-08-09 15:23:09 UTC
I have posted about this on the StackExchange website :

https://unix.stackexchange.com/questions/461369/cannot-access-kwallet-after-upgrading-fedora-26-28

Here is the contents of that post:

=====================================
When I try to open my wallet there is the standard read error that suggests the password may be incorrect. This happens both from kwalletmanager5 and using kwallet-query. The password is correct. My guess is something was changed in the KDE software with my upgrade to F28 yesterday. My understanding is that the best approach therefore would be to find a way to open the wallet somehow, say with an older version of kwalletmanager5, and export it to XML, then import it.

What would be my options for accomplishing this? Or is there a better approach?
=====================================

I have also posted this on the Fedora website: https://ask.fedoraproject.org/en/question/125129/cannot-access-kwallet-after-upgrading-f26-f28/ (currently awaiting moderation)


I have tried installing KDE on a CentOS 7 machine, and it has the same issue. I have also tried backups of the kwl and salt files to ensure there is not some unknown issue with data corruption. I am currently open to any possible means to recover the kwallet. Please let me know what logs or information, if any, I can provide to clarify the context of this bug. Sorry, I wasn't sure about the version numbers involved, except for the fact that the kwalletmanager on Fedora 28 that I am using appears to be version 17.12.3.


Thank you
Comment 1 63257245 2018-08-09 21:17:04 UTC
I have managed to compile what I believe to be kwallet 5.45, substituting /usr/lib64/libkwalletbackend5 and /usr/bin/kwalletd5 with the versions built during this process. Unfortunately this didn't work, but I suspect I did something incorrectly.

When kdesrc-build installed the binaries into kwallet/bin, it installed the libraries with version 5.49.0 (i.e. it installed "libkwalletbackend5.so.5.49.0, instead of libkwalletbackend5.so.5.45.0). However I ensured the source at hand for kwallet was 5.45 by downloading the tar.gz myself, putting it in the kdesrc-build local source tree, and disabling git updates using kdesrc-build --build-only. So my suspicion is that this apparently erroneous name for libkwalletbackend5 is due to the kdesrc-build installer thinking it is indeed at 5.49.0 for all the build software.
I haven't been able to figure out by any other means what the versions of these binaries installed are, so if anyone can clarify that would be good.
Comment 2 63257245 2018-08-09 21:58:46 UTC
I figured out why the built files were 5.49.0 instead of 5.45.0. 

Additionally, to test, I replaced not just libkwalletbackend5.so.5 but also libKF5Wallet.so.5, in addition to /usr/bin/kwalletd5. To clarify, I am doing this to try to isolate whatever logic in the backend I presume to have changed in the version which is breaking the wallet opening. Unfortunately, I have just tried this with 5.45, 5.41, and 5.39, and had no success.
I'm not sure what the other moving parts are in this system, and how else I might best try to open my wallet with earlier versions of whatever the relevant encryption logic in kwallet is. So far I have assumed that all the relevant code must reside in those two libraries and kwalletd5 (and kwallet-query, which I have been using to try to open it), but this might be wrong.

Maybe it is something simpler, something to do with Blowfish vs GPG? I don't recall which one my wallet is encrypted with. It might be blowfish.
Comment 3 63257245 2018-08-09 21:59:43 UTC
I should also add, normally I would assume that somehow my wallet had become corrupt, but since I am testing this as well with backups of my wallet files, I don't see any alternative than there is something going on with kwallet.
Comment 4 63257245 2018-08-09 23:06:44 UTC
I've been taking a look at BlowfishPersistHandler::read. What's the best way to output data from here or anywhere in the program, to a log file, so I can examine what's happening ?
Comment 5 Christoph Feck 2018-08-09 23:56:12 UTC
Fedora 26 was KDE4-based, right? I think to migrate the wallet, you would need to have both kwalletmanager4 and kwalletmanager5 installed. Then either the migration might be automatic (I don't know the exact conditions for migration), or you manually export from kwalletmanager4 to XML and import into kwalletmanager5.
Comment 6 63257245 2018-08-10 00:17:01 UTC
Hmm, I don't think so, I've been using kwalletmanager5 and related utilities for a while now. Come to think of it, I do remember upgrading to KDE5.I guess this was when I upgraded from 24 to 26, but with 26, I'm almost positive it's been KDE5.
Comment 7 63257245 2018-08-10 00:48:18 UTC
It certainly is strange .. backendpersisthandler.cpp, the file that ends up returning -9 to indicate the incorrect password, has not changed significantly for some time, and neither have kwalletbackend.cc, blowfish, cc, etc. I wish I could think of a way that some how this is PEBKAC and that I am messing up, but I am testing this using the kwalletpath test binary (passes the path to my wallet directly, instead of by name), and the password is definitely correct, since I have been using this wallet daily for years with the same password.
One thing I have noticied is that since the upgrade, my locale is wrong/broken variously. Many programs warn/alert me that it is broken. I notice that in kwalletd.cpp, line 682, we convert the password to UTF8. I wonder if somehow there is some tricky locale magic happening in there? My password is entirely in [a-zA-Z0-9] though.
Comment 8 63257245 2018-08-10 16:34:53 UTC
F26 and F24, net-install images, were no luck until I uninstalled kf5-kwallet on F24 and reverted to the KDE4 version of kwallet (with kwalletd being started by kwalletmanager via kdeinit4). At that point I was able to open the wallet.
I've been using KDE5 for some time now, so I presume that somehow in my F26 installation of KDE5 the conditions had converged to make it possible to use half KDE5 kwallet, half KDE4, at least insofar as I had been running kwalletd5 (and to my knowledge, kwalletmanager5), yet working with this wallet which apparently is a KDE4 wallet, given that I was only able to open it as described above.
Anyway, having recovered my data, I no longer have a stake in this issue, but I am at your service to examine the issue further and determine what bugs, if any, exist, etc.
Thanks
Comment 9 Justin Zobel 2022-11-29 05:05:57 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 10 Bug Janitor Service 2022-12-14 05:13:37 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 11 Bug Janitor Service 2022-12-29 05:25:13 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!