Re: [Pyme-help] Problem with decrypting on win32 when private key has a pass phrase
Status: Beta
Brought to you by:
belyi
From: Igor B. <be...@us...> - 2008-08-11 05:16:14
|
Anthony, Thanks for reporting the problem. I'm sorry, for the delay - I had some troubles with reading SF mail. I don't have a Windows machine handy at the moment, but I'll try to look at your problem as soon as I can. I noticed some strange behavior with passphrase callbacks on Linux as well. I'll try to reproduce the problem with pure gpgme to make sure that the problem is in python wrapper and not in the core library. I'll keep you posted. Cheers, Igor Tony Caduto wrote: > Hi, > The latest version of pyme seems to have a issue with decrypting on > windows and possibly linux when the private key has a pass phrase. > > When the key has a pass phrase it calls the call back, but then hangs > forever and the python instance has to be killed. > > The callback gets called and the 3 args get printed to the console > fine, then it hangs, but only when the key has a pass phrase. > > According to the gpgme doc you are supposed to write the password to a > file descriptor, but in all the examples the call back was done like > below. > > For all I know I could be doing something wrong, but it feels like a > bug to me. Other users have also reported the same issue, please see > here: > http://www.codeguru.com/forum/showthread.php?p=1743350 > > def Callback(x, y, z): > """ Callback to give password """ > print x > print y > print z > return "mypassword\n" > > print "gpgme version:", core.check_version(None) > #File to be decrypted using a private key > file_in = core.Data(file="c:\\my_enc_file.pgp") > data_out = core.Data() > #File we will write the encrypted data to > # Initialize our pgp context. > c = core.Context() > c.set_armor(True) > > > #this is needed if the private key has a passphrase, but it does not > seem to work on win32 > c.set_passphrase_cb(Callback) > > # Do the decryption. > try: > c.op_decrypt(file_in, data_out) #<------Hangs here when key has a > pass phrase > data_out.seek(0,0) > file_out = open("c:\\mydecrypted_file.dat","wb") > file_out.write(data_out.read()) > file_out.close() > except errors.GPGMEError, ex: > print ex.getstring() > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > Pyme-help mailing list > Pym...@li... > https://lists.sourceforge.net/lists/listinfo/pyme-help > |