Bug 421856 - KWallet does not accept correct password
Summary: KWallet does not accept correct password
Status: CONFIRMED
Alias: None
Product: frameworks-kwallet
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.18.0
Platform: Neon Linux
: NOR major
Target Milestone: ---
Assignee: Valentin Rusu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-21 10:07 UTC by Venca B Spam
Modified: 2021-07-26 08:17 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch for endianness (1.57 KB, patch)
2020-05-25 23:44 UTC, Chris Coetzee
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Venca B Spam 2020-05-21 10:07:53 UTC
SUMMARY

Let's have Neon testing fully working. The KWallet is used to store all your passwords. The KWallet is configured to be automatically unlocked after login.


STEPS TO REPRODUCE
1. Update your system by 'apt dist-upgrade' 
2. Restart the system
3. Login as usually

OBSERVED RESULT

The KWallet prompts you to enter password to kwallet. Even when you enter the correct password, it responds with message "Error code -9: Read error - possibly incorrect password."
 
EXPECTED RESULT

The system should not forget all my passwords after update/upgrade.


SOFTWARE/OS VERSIONS
Operating System: KDE neon Testing Edition
KDE Plasma Version: 5.18.90
KDE Frameworks Version: 5.71.0
Qt Version: 5.14.2
Kernel Version: 4.15.0-101-generic
OS Type: 64-bit
Wallet Manager: Version 20.04.1

ADDITIONAL INFORMATION
Comment 1 Venca B Spam 2020-05-21 10:14:30 UTC
There is workaround how to save your data.

Let's have another system with Neon, just without the latest update/upgrade, call it healthy.

Take the kdewallet.kwl kdewallet.salt and copy it over the healthy system files.

Open KWallet manager on the healthy system and enter the correct password to open it.

Export the opened wallet to XML (e.g. recovered_wallet.xml) .

Go to the sick system, delete the kdewallet.kwl kdewallet.salt and restart the system.

Once you login on the sick system, open the KWallet manager and import the "recovered_wallet.xml".

This should fix the thing.

Hope it saves other people, as this critical issue can't be prevented by any backups or archives at all.
Comment 2 Venca B Spam 2020-05-21 10:20:39 UTC
This might be related to this issue https://bugs.kde.org/show_bug.cgi?id=416461 . They however also deal with problem with unlocking of the KWallet on login, which in this case works, after fixing the wallet password.
Comment 3 Chris Coetzee 2020-05-25 22:04:16 UTC
I'm experiencing the exact same problem after updating Neon tonight. Looks like my package versions are the same. 

I tried downgrading libkwalletbackend5-5, but I couldn't without breaking other packages.

I didn't dig deep for the official sources, but I saw this commit on kwaller Github project, and it looks like a byte-order change in the encryption may have caused this.

https://github.com/KDE/kwallet/blame/master/src/runtime/kwalletd/backend/blowfish.cc

SOFTWARE/OS VERSIONS
Operating System: KDE neon Testing Edition
KDE Plasma Version: 5.18.90
KDE Frameworks Version: 5.71.0
Qt Version: 5.14.2
Kernel Version: 4.15.0-101-generic
OS Type: 64-bit
Wallet Manager: Version 20.04.1
Wallet Backend: Version 5.70.0
Comment 4 Chris Coetzee 2020-05-25 23:44:35 UTC
Created attachment 128789 [details]
Patch for endianness

I followed build instructions to get KWallet building here:

- https://community.kde.org/KDevelop/HowToCompile_v5 and
- https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Details

I looked up several stackoverflow articles on determining endianness from standard headers, some suggested looking in BOOST, but I found that there's an `endian.h' header on Linux and Mac systems. 

Therefore the patch likely needs revisiting to make it compatible with other platforms / compilers.
Comment 5 Chris Coetzee 2020-05-26 00:07:42 UTC
Corresponding Phabricator revision: https://phabricator.kde.org/D29832
Comment 6 Chris Coetzee 2020-05-26 07:17:45 UTC
Looks like patches and things are now moving to Gitlab, so here's the PR there https://invent.kde.org/frameworks/kwallet/-/merge_requests/1
Comment 7 Venca B Spam 2020-06-07 07:33:56 UTC
It hits me again!

After update of my Neon I received Plasma 5.19. Same symptoms.

Workarounds:

1) Use of previously backed up wallet can fix the thing.

2) Otherwise you can use the steps in my previous comment, you just need to find the system "affected" by the bug, to be able export your wallet to XML.


Feedback to your teams:

How hard would be to provide corrupted data migration (e.g. test the password for both variants, if it works, convert the wallet). I understand it is not possible when you do not know about the bug, however in this second case the migration should be part of the solution.
Comment 8 Shantanu Tushar 2020-06-16 05:29:30 UTC
I hit the same issue when I upgraded Neon User Edition today. I can reproduce the issue in A VM as well:
1. Install Neon from an older ISO (I used neon-user-20190919-1119.iso)
2. Setup kdewallet with one application (chromium in my case)
3. sudo apt full-upgrade
4. kdewallet no longer accepts my password (I had used empty password for this test)

Upgrade log (grep'd to kwallet and upgrade):

2020-06-16 10:17:54 upgrade libkf5wallet-bin:amd64 5.62.0-0xneon+18.04+bionic+build28 5.71.0-0xneon+18.04+bionic+build47
2020-06-16 10:17:55 upgrade libkf5wallet5:amd64 5.62.0-0xneon+18.04+bionic+build28 5.71.0-0xneon+18.04+bionic+build47
2020-06-16 10:17:55 upgrade libkf5wallet-data:all 5.62.0-0xneon+18.04+bionic+build28 5.71.0-0xneon+18.04+bionic+build47
2020-06-16 10:17:57 upgrade libkwalletbackend5-5:amd64 5.62.0-0xneon+18.04+bionic+build28 5.71.0-0xneon+18.04+bionic+build47
Comment 9 Karsten Diem 2020-06-16 09:05:05 UTC
Hey Chris,

you might be interested in this:
https://bugs.kde.org/show_bug.cgi?id=345412#c47

I also encountered this bug today, so I downgraded all packages related to kwallet.

You might want to check the correct versions you've been on before upgrading by issuing this command:


grep " upgrade " /var/log/dpkg.log | grep "wallet"

which, on my system, resulted in:

2020-06-10 11:36:54 upgrade libpam-kwallet5:amd64 4:5.18.5-0xneon+18.04+bionic+build50 4:5.19.0-0xneon+18.04+bionic+build51
2020-06-10 11:36:54 upgrade libpam-kwallet-common:all 4:5.18.5-0xneon+18.04+bionic+build50 4:5.19.0-0xneon+18.04+bionic+build51
2020-06-16 09:20:54 upgrade libkf5wallet-bin:amd64 5.70.0-0xneon+18.04+bionic+build42 5.71.0-0xneon+18.04+bionic+build47
2020-06-16 09:20:54 upgrade libkf5wallet-data:all 5.70.0-0xneon+18.04+bionic+build42 5.71.0-0xneon+18.04+bionic+build47
2020-06-16 09:20:54 upgrade libkf5wallet5:amd64 5.70.0-0xneon+18.04+bionic+build42 5.71.0-0xneon+18.04+bionic+build47
2020-06-16 09:20:55 upgrade libkwalletbackend5-5:amd64 5.70.0-0xneon+18.04+bionic+build42 5.71.0-0xneon+18.04+bionic+build47
2020-06-16 09:21:37 upgrade kwalletmanager:amd64 4:20.04.1-0xneon+18.04+bionic+build34 4:20.04.2-0xneon+18.04+bionic+build37




(In reply to Chris Coetzee from comment #3)
> I'm experiencing the exact same problem after updating Neon tonight. Looks
> like my package versions are the same. 
> 
> I tried downgrading libkwalletbackend5-5, but I couldn't without breaking
> other packages.
> 
> I didn't dig deep for the official sources, but I saw this commit on kwaller
> Github project, and it looks like a byte-order change in the encryption may
> have caused this.
> 
> https://github.com/KDE/kwallet/blame/master/src/runtime/kwalletd/backend/
> blowfish.cc
> 
> SOFTWARE/OS VERSIONS
> Operating System: KDE neon Testing Edition
> KDE Plasma Version: 5.18.90
> KDE Frameworks Version: 5.71.0
> Qt Version: 5.14.2
> Kernel Version: 4.15.0-101-generic
> OS Type: 64-bit
> Wallet Manager: Version 20.04.1
> Wallet Backend: Version 5.70.0
Comment 10 Riccardo Robecchi 2020-06-16 14:09:55 UTC
Same here. I updated to KDE Frameworks 5.71 this morning and my wallet has been broken since.
Comment 11 Shantanu Tushar 2020-06-16 16:12:56 UTC
I can confirm that an upgrade to libkf5wallet5 version 5.71.0-0xneon+18.04+bionic+build49u fixed the problem.
Comment 12 Riccardo Robecchi 2020-06-16 17:07:37 UTC
(In reply to Shantanu Tushar from comment #11)
> I can confirm that an upgrade to libkf5wallet5 version
> 5.71.0-0xneon+18.04+bionic+build49u fixed the problem.

I confirm that, too. The update arrived a few moments ago and it fixed the issue.
Comment 13 popov895 2021-07-26 08:02:57 UTC
Looks like this has already been fixed.