decryption with passphrase fails due to bugs in pygpgme_passphrase_cb
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyGPGME |
New
|
Undecided
|
Unassigned |
Bug Description
According to the GPGME documentation, the user provided callback function must behave as follows:
"The user must write the passphrase, followed by a newline character, to the file descriptor fd. If the user returns 0 indicating success, the user must at least write a newline character before returning from the callback.
"If an error occurs, return the corresponding gpgme_error_t value. You can use the error code GPG_ERR_CANCELED to abort the operation. Otherwise, return 0."
( Source: http://
However, pygpgme_
Specifically, pygpgme_
Furthermore, pygpgme_
I changed the last line of pygpgme_
The pygpgme_
http://
I recommend the following change:
pygpgme_
Also note that if the user provided callback function raises an exception, I believe PyObject_
(I also noticed that the unit tests humorously work around this bug by only using private keys that have no passphrase to protect them. Once this bug is fixed, the unit tests can be improved.)