Version: 0.8.2 (using KDE KDE 3.5.3) Installed from: Ubuntu Packages OS: Linux Reproduce: Save file as encrypted. Attempt to open file, enter wrong passphrase or click cancel. A dialog appears saying: File '<kmymoneyfile>.kmy' not found! The same behavior occurs when the user clicks 'Cancel' on the passphrase dialog. Problem: This message leads the user to believe their file doesn't exists when the file does exists. Solution: Change message to something along the lines: "Can't decrypt '<kmymoneyfile>.kmy'"
Due to the wonderful KIOSlave subsystem, the application does not know at this point, why the operation fails. A possible solution would be to setup the error message before the actual file IO happens as this is where the application still knows about the file contents. Nevertheless, in case of an encrypted file, the message would say that the "file was not found or the passphrase was wrong". Ideas, suggestions?
I looked at the libkgpgfile.{h,cpp} files. Perhaps you could split the open() call into a few functions diagnostic(), decrypt() and open(). - diagnostic() - check to make sure the gpg is working and test if the file is readable and exists. - decrypt() - ask for passphrase and decrypt - open() - open the file. another approach could be to have open() return a masked integer so multiple codes in mask could be returned. I also noticed that libkgpgfile uses the gpg executable and anyone sniffing stdin/stdout can grab the passphrase and file contents. why not use the gpgme library? Also the variable QCString pwd; (libkgpgfile.cpp:174) should be scrambled after it is used. perhaps some pattern random character pattern. These last point could be a separate bug. I can enter it as separate bugs if you'd like.
Perhaps linked to this, Kmymoney 0.85 on debian stable and KDE 3.5.8 seems unable to save my file when using GPG encryption. There are no indications of problems when saving, the problem only becomes apparent the next session when the file has not changed from its initial state (i.e. the version I had before starting to use GPG.
Moving this wish to kmymoney4.
This still seems at least partly the case. Trying to open an encrypted file, and failing to enter the passphrase three times produces a popup: "Cannot open file as requested." Expanding the details points to ".../kmymoney-5.0.8/kmymoney/plugins/xml/xmlstorage.cpp:150" It appears all of the detailed exceptions thrown in that file are caught in kmymoney/kmymoney.cpp and the generic error shown in a messagebox, thus losing any of the details of the different causes of the exception.