Summary: | When i try to open an encrypted .kmy file the program does not ask me the passphrase and then prompt "could not open the file <filename>: bad passphrase" | ||
---|---|---|---|
Product: | [Applications] kmymoney | Reporter: | Emanuele Andreola <emanuele.andreola> |
Component: | general | Assignee: | KMyMoney Devel Mailing List <kmymoney-devel> |
Status: | RESOLVED WORKSFORME | ||
Severity: | major | CC: | agander93, onet.cristian, ostroffjh, raphagonz |
Priority: | NOR | ||
Version: | 4.6.3 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Emanuele Andreola
2013-04-30 14:38:14 UTC
Can you manually decrypt the file? I'm not sure gpg.conf needs much content - mine has only two keyserver lines and one keyserver-options line. Thanks for your timely reply, Jack I just tried to decrypt the file with gpg using the konsole, it worked. I also opened the decrypted file with KMyMoney and i had no problems, no data loss or anything strange. I probably miss something, 'cause everything else seems to work pretty good... Update: I just encrypted a non-encrypted .kmy file with gpg through the command line and tried to open it with kmymoney. It still prompts the bad passphrase error. I don't use encryption, so I can't really test, but it sounds like a problem with one of the gpg helper apps or configuration. It seems like KMM thinks it either knows the passphrase or can get it from somewhere without prompting you, but it obviously can not. Do you have any other applications that can use gpg? Do they prompt for the passphrase? (perhaps email?) I used to sign my e-mails with a gpg related signature, but it's long i don't do it now. I actually created the gpg key just for kmymoney. Now i'll try to use gpg with some other program. I tried to close the wallet (kdewallet) to see if kmm asks me to open it when opening the file, but it doesn't, and the same error pops up... Update: Just sent my .kmy encrypted file to a diffent computer just to see what happens. when i tried to open it kmm says that it cannot decrypt the file, but it prompted a diffent error window that in my pc. Both computers have kubuntu 13.04 installed, all packages up-to-date. See if this helps - http://mail.kde.org/pipermail/kmymoney-devel/2010-March/001096.html After some googling and thinking i was close to give up, then i tried to run the same command of the guy you linked: input: gpg --use-agent --no-tty --sign output: gpg: gpg-agent non è disponibile in questa sessione gpg: Sorry, no terminal at all requested - can't get input the first line says that gpg-agent is not available in (maybe "for") this session, so maybe it's a gpg-agent misconfiguration error For that error, I find -
> gpg: Sorry, no terminal at all requested - can't get input
Remove the line
no-tty
from ~/.gnupg/gpg.conf or ~/.gnupg/options
Don't know if you tried that. If still not right, try substituting '--batch'.
My ~/.gnupg/gpg.conf file is empty, there's just a comment about Kgpg, nothing else. trying: gpg --use-agent --batch --sign i get: gpg: Passphrase non valida; riprova ... gpg: can't query passphrase in batch mode gpg: no default secret key: passphrase errata gpg: signing failed: passphrase errata first and last mean "bad passphrase" To me this looks like the gpg-agent is not running. You can check that with the following command (includes my output here): thb@thb-nb:~> ps ax | grep gpg-agent 1596 ? Ss 0:17 gpg-agent --daemon 9868 pts/9 S+ 0:00 grep --color=auto gpg-agent 12324 ? Ss 0:08 /usr/bin/gpg-agent --sh --daemon --write-env-file /ho 12353 ? Ss 0:07 gpg-agent --daemon If it does not run, then you need to start it during KDE startup. You can do that by adding the following one-liner to ~/.kde[4]/env/gpg-agent.sh (the filename must end in .sh to be picked up by KDE) and make that file executable: eval "$(gpg-agent --daemon)" After that change you will have to logout of your KDE session and log back in to execute it once. Hi, if i run: ps ax | grep gpg-agent my output is: 2771 pts/3 S+ 0:00 grep --color=auto gpg-agent an nothing else (my output may be wrong, i'm a command-line newbie) anyway, in my ~/.kde[4]/env directory i've no gpg-agent files. Today i tried to use kmm with encryption in a different pc and it worked (even if i've the same linux dristro/updates/programs...). Maybe it's beacuse i use two different partitions for my home and /, and i formatted my home partition last time something like 2 years ago. maybe it's just some strange corrupted setting saved in my /home....i'll try to wipe out all the disk and reinstall everything... On Thu, 02 May 2013 13:01:36 +0000 Emanuele Andreola <emanuele.andreola@gmail.com> wrote: > https://bugs.kde.org/show_bug.cgi?id=319120 > > --- Comment #12 from Emanuele Andreola <emanuele.andreola@gmail.com> > --- Hi, > > if i run: > ps ax | grep gpg-agent > my output is: > 2771 pts/3 S+ 0:00 grep --color=auto gpg-agent > an nothing else (my output may be wrong, i'm a command-line newbie) > > anyway, in my ~/.kde[4]/env directory i've no gpg-agent files. > > Today i tried to use kmm with encryption in a different pc and it > worked (even if i've the same linux dristro/updates/programs...). > Maybe it's beacuse i use two different partitions for my home and /, > and i formatted my home partition last time something like 2 years > ago. maybe it's just some strange corrupted setting saved in > my /home....i'll try to wipe out all the disk and reinstall > everything... > If it's not too late to stop you doing that, can you check if gpg-agent/gnupg -agentis installed. well, if i type: gpg-agent/gnupg -agentis installed it says bash: gpg-agent/gnupg: File o directory non esistente (not existing) Anyway when i check sudo apt-get install gnupg-agent it says that gnupg-agent is installed and up-to-date, same output for pinentry-qt4 On Thu, 02 May 2013 13:28:18 +0000 Emanuele Andreola <emanuele.andreola@gmail.com> wrote: > https://bugs.kde.org/show_bug.cgi?id=319120 > > --- Comment #14 from Emanuele Andreola <emanuele.andreola@gmail.com> > --- well, if i type: > gpg-agent/gnupg -agentis installed > it says > bash: gpg-agent/gnupg: File o directory non esistente (not existing) > > Anyway when i check > sudo apt-get install gnupg-agent > it says that gnupg-agent is installed and up-to-date, same output for > pinentry-qt4 > OK, now you need to get it running, this first time. From Thomas - " If it does not run, then you need to start it during KDE startup. You can do that by adding the following one-liner to ~/.kde[4]/env/gpg-agent.sh (the filename must end in .sh to be picked up by KDE) and make that file executable: eval "$(gpg-agent --daemon)" After that change you will have to logout of your KDE session and log back in to execute it once." But, you say you don't have gpg-agent.sh. I found an example in http://userbase.kde.org/KMail/PGP_MIME/en, although, possibly a typo, it calls it gpgagent.sh . There are some other tips there that may be useful. Allan Hm, I thought it would be clear from what I wrote that if you don't have the file, you need to create it and simply add that one magic line to it and make it executable. Why didn't you do that? There's certainly no need to wipe out the whole disk (we're not on that other OS). You mentioned, that you have the agent, and even the pinentry-qt program is available. All you need to do is get the agent running and the method I use is the small shell script in .kde/env @Allen: the name of the script does not matter. you can call it whatever you like. It only needs to end in .sh (that's "dot s h") and it must be executable. Sorry for the delay, I just solved it, well, I didn't actually solved it, kind of... As I said before I formatted the whole disk, put all my data back into it, installed all the programs i need and rebooted. Now it works. So i didn't really find out what was the problem, but it seems like it's gone with the formatting. @Thomas: before doing what i did i tried your way; it actually pops up the instert-key window, but i wasn't able to type anything into it, and after a few seconds it "disappears" like as if i pressed enter (even if i didn't press any keys). So, well, thank you all for your kind support, you showed up the best of the open-source community: cooperation. Closing this since it has been reported as fixed. Hi, Sorry to come back on this subject I have exactly the same things : - KMM not asking for a passphrase - ps -ef |grep gpg finding gpg-agent --daemon - decrypt file from console ok (and opening the decrypted file in KMM ok) It was working fine before and I have the problem only since I upgraded to Lubuntu 13.10 Thanks for your help Raphael |