Fix Endianness issue during wallet decryption
Needs ReviewPublic

Authored by chriscz on May 26 2020, 12:02 AM.



Correctly determine endianness on the specific platform using `endian.h' header available at least on GCC. Must be verified for other platforms and compilers.

Test Plan

make install; killall kwalletd5; kwalletd5; kwalletmanager5
Open wallet, enter password. Wallet now accepts my password and I can still see my passwords.

Diff Detail

R311 KWallet
Lint Skipped
Unit Tests Skipped
chriscz created this revision.May 26 2020, 12:02 AM
Restricted Application added a project: Frameworks. ยท View Herald TranscriptMay 26 2020, 12:02 AM
Restricted Application added a subscriber: kde-frameworks-devel. ยท View Herald Transcript
chriscz requested review of this revision.May 26 2020, 12:02 AM

This stack overflow answer has a more exhaustive approach to determining endianness. It may be worth extracting this code into a more appropriate header file though. Also here's the issue on the bugzilla tracker

ngraham added a subscriber: ngraham.

Thanks for the patch! FWIW we have moved patch review to GitLab; consider abandoning this and re-submitting it as a merge request at

Here's some documentation:

Hi @ngraham Thanks for letting me know! I've opened the PR over on gitlab: It must be quite a mission getting everyone over to new platforms ๐Ÿ˜“ ๐Ÿ˜„