Use GPGME Python bindings for GPG operations #266
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR modifies functions performing GnuPG (GPG) operations to utilize the GPGME Python bindings, rather than calling a user's GPG executable directly.
The new functions behave similarly to the old ones right now. However, more robust exception handling is now possible as more detailed and precise errors are returned. The GUI warning of a verify failure was made more detailed and specific to the nature of the failure.
Right now the verify() function performs the same action whether an error is raised due to a missing public key or a bad signature, but the conditions are now differentiated in the code, so it is a trivial matter to take different actions for either error now.
Additional feedback is needed on if we should attempt to find and import a missing signing key when encountered. It seemed obvious to do so at first, but for security reasons @micahflee may intend it to stay a manual process, so the behaviour was intentionally left the same for now, with the error details being passed on to the GUI pop-up.
See #262